Method for training network attack classification model and method for identifying network attack types

By using neural network models and semi-supervised learning algorithms in network attack classification, combined with payload and network attribute characteristics, the identification difficulties of existing technologies in non-plaintext protocols and high-traffic environments are solved, and an efficient and low-cost network is achieved. Attack type identification.

CN114978703BActive Publication Date: 2024-10-25HUBEI TIANRONGXIN NETWORK SECURITY TECH CO LTD +3
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210570610.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-24
Publication Date
2024-10-25
Estimated Expiration
2042-05-24

AI Technical Summary

Technical Problem

Existing network attack classification methods based on clear text protocols have problems with false positives, false negatives and high analysis costs in non-clear text protocols and high traffic environments, making it difficult to quickly identify network attack types.

Method used

By collecting network traffic data, extracting network attribute features, and using payload methods to obtain labeled sample data, the neural network model is trained to improve the accuracy and efficiency of identifying attack types, and semi-supervised learning algorithms and clustering models are used to classify attacks.

Benefits of technology

It improves the detection rate of network attack threats, reduces the cost of attack research and judgment in high-traffic environments, improves identification efficiency, and reduces false positives and false negatives.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114978703B_ABST
    Figure CN114978703B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a method for training a network attack classification model and a method for identifying network attack types. The method for training a network attack classification model includes: collecting network traffic to obtain network traffic data, and processing the network traffic data to obtain network attribute features, wherein the network attribute features at least include network traffic features; obtaining a payload of part of the network traffic data from the network traffic data, and obtaining an attack type corresponding to the part of the network traffic data according to the payload, wherein the network attribute features corresponding to the part of the network traffic data are reference network attribute features; labeling the reference network attribute features based on the attack type to obtain reference sample data; and obtaining a network attack classification model according to the reference sample data and the first network attribute feature. This method improves the detection rate of attack threats based on flow features.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of network security. Specifically, embodiments of the present application relate to a method for training a network attack classification model and a method for identifying network attack types. Background Art

[0002] As the types of network attacks increase, the existing method of using regular expressions based on the payload content of the plaintext protocol to judge the corresponding attack type is becoming increasingly limited. For example, this technical solution has at least the following three defects.

[0003] Defect 1: If it is not a plain text protocol, then traditional network attack classification cannot extract the payload for analysis using existing analysis rules.

[0004] Defect 2: The diversification of attacks, along with the differences in various obfuscation techniques and various application system backgrounds, makes the characteristics of the payload extremely complex, which is not conducive to rapid analysis (i.e. judgment) and will lead to a large number of false positives and false negatives.

[0005] Defect 3: In a high-traffic environment, the traffic volume of each communication is very large, such as 10T / s of messages. The cost of analysis is extremely high through traditional traffic probes, and the efficiency of event detection is low and delayed.

[0006] Therefore, how to improve the identification of network attack types has become a technical problem that needs to be solved urgently. Summary of the invention

[0007] The purpose of the embodiments of the present application is to provide a method for training a network attack classification model and a method for identifying network attack types, by which the attack threat detection rate based on flow features is improved and a low-cost and high-efficiency analysis method is provided for attack analysis in a large-traffic environment.

[0008] In a first aspect, some embodiments of the present application provide a method for training a network attack classification model, the method comprising: collecting network traffic to obtain network traffic data, and processing the network traffic data to obtain network attribute features, wherein the network attribute features at least include network traffic features; obtaining a payload of part of the network traffic data from the network traffic data, and obtaining an attack type corresponding to the part of the network traffic data based on the payload, wherein the network attribute features corresponding to the part of the network traffic data are reference network attribute features; labeling the reference network attribute features based on the attack type to obtain reference sample data; obtaining a network attack classification model based on the reference sample data and a first network attribute feature, wherein the first network attribute feature is the remaining network traffic features included in the network traffic features except the reference network traffic attribute features.

[0009] Some embodiments of the present application obtain labeled sample data corresponding to some network traffic characteristics through payload mode, and then train a neural network model based on the labeled sample data to obtain a network attack classification model, thereby reducing the workload of data annotation and improving the classification effect of the obtained model.

[0010] In some embodiments, obtaining the network attack classification model according to the reference sample data and the first network attribute feature includes: training a clustering model to be trained according to the reference sample data and the first network attribute feature to obtain the network attack classification model.

[0011] In some embodiments of the present application, the sampled network traffic data (i.e., part of the network traffic data) is used to obtain the attack type and label the attack type (i.e., obtain reference sample data) using a payload method, and then the clustering model is trained based on the reference sample data to obtain a network attack classification model. The clustering effect of the clustering model obtained by directly training the clustering model with data without any annotation content is more accurate and the training speed is improved.

[0012] In some embodiments, the network attack classification model is obtained by training the clustering model to be trained based on the reference sample data and the first network attribute characteristics, including: performing anti-artificial screening on the clustering results on the clustering boundaries, adjusting the number of clustering layers and parameters, until the first network attribute characteristics are all marked with attack classification marks, thereby obtaining the network attack classification model.

[0013] Some embodiments of the present application improve the accuracy of clustering results of the trained clustering model by adjusting the number of clustering layers and parameters through anti-artificial screening.

[0014] In some embodiments, the training of the clustering model to be trained according to the reference sample data and the first network attribute feature to obtain the network attack classification model includes: monitoring whether the training process of the clustering model to be trained can be terminated according to the reference sample data.

[0015] Some embodiments of the present application confirm whether the training of the clustering model can be terminated by referring to sample data, thereby improving the clustering effect of the obtained clustering model.

[0016] In some embodiments, the monitoring of whether the training process of the clustering model to be trained can be terminated based on the reference sample data includes: manually evaluating the clustering results and adjusting the erroneous clustering results to obtain adjusted clustering results; and continuing to train the clustering model according to the adjusted clustering results until the network attack classification model is obtained.

[0017] Some embodiments of the present application adjust the clustering results of the clustering model through manual intervention, and then retrain the clustering model according to the adjusted results to improve the clustering accuracy of the obtained clustering model.

[0018] In some embodiments, obtaining a network attack classification model based on the reference sample data and the first network attribute feature includes: clustering the reference sample data and the first network attribute feature to obtain a clustering result; and training a network attack classification model to be trained based on the clustering result to obtain the network attack classification model.

[0019] Some embodiments of the present application use clustering results (since the existence of reference sample data during clustering can confirm the accuracy of the clustering results) as training data to train a network attack classification model, thereby improving the accuracy of the obtained network attack classification model.

[0020] In some embodiments, clustering the reference sample data and the first network attribute feature to obtain a clustering result includes: if the clustering result of the reference sample data meets set requirements, confirming that the clustering result is obtained.

[0021] Some embodiments of the present application determine whether the obtained clustering results can be used as training data by referring to sample data, which can improve the labeling accuracy of the obtained training data.

[0022] In some embodiments, the type of network traffic characteristics includes at least one of: flow rate, packet size of uploaded or downloaded data, number of IPs communicating within a set time period, and communication frequency.

[0023] In some embodiments, the network attribute characteristics also include: local area network characteristics and wide area network characteristics.

[0024] In a second aspect, some embodiments of the present application provide a method for identifying network attack types, the method comprising: obtaining network attribute characteristics of network traffic data to be identified; inputting the network attribute characteristics into the network attack classification model, and obtaining the attack type corresponding to the network traffic data through the network attack classification model.

[0025] In a third aspect, some embodiments of the present application provide a device for training a network attack classification model, the device comprising: a network attribute feature acquisition module, configured to collect network traffic to obtain network traffic data, and process the network traffic data to obtain network attribute features, wherein the network attribute features at least include network traffic features; an attack type acquisition module, configured to obtain a payload of part of the network traffic data from the network traffic data, and obtain an attack type corresponding to the part of the network traffic data based on the payload, wherein the network attribute features corresponding to the part of the network traffic data are reference network attribute features; a labeled data acquisition module, configured to label the reference network attribute features based on the attack type to obtain reference sample data; a network attack classification model acquisition module, configured to obtain a network attack classification model based on the reference sample data and a first network attribute feature, wherein the first network attribute feature is the remaining network traffic features included in the network traffic features except the reference network traffic attribute features.

[0026] In a fourth aspect, some embodiments of the present application provide a device for identifying network attack types, the device comprising: a feature acquisition module for to-be-identified, configured to acquire network attribute features of network traffic data to be identified; an attack type acquisition module, configured to input the network attribute features into the network attack classification model, and obtain the attack type corresponding to the network traffic data through the network attack classification model.

[0027] In a fifth aspect, some embodiments of the present application provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, can implement the method described in any embodiment of the first aspect or the second aspect.

[0028] In a sixth aspect, some embodiments of the present application provide an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method described in any embodiment of the first aspect or the second aspect can be implemented.

[0029] In the seventh aspect, some embodiments of the present application provide a computer program product, wherein the computer program product includes a computer program, wherein when the computer program is executed by a processor, it can implement the method described in any embodiment of the first aspect or the second aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0031] Figure 1 A diagram showing the composition of a network attack type identification system provided in an embodiment of the present application;

[0032] Figure 2 One of the flow charts of the method for training a network attack classification model provided in an embodiment of the present application;

[0033] Figure 3 A second flowchart of a method for training a network attack classification model provided in an embodiment of the present application;

[0034] Figure 4 A flow chart of a method for identifying network attack types provided in an embodiment of the present application;

[0035] Figure 5 A block diagram of the apparatus for training a network attack classification model provided in an embodiment of the present application;

[0036] Figure 6 A block diagram of the device for identifying network attack types provided in an embodiment of the present application;

[0037] Figure 7 A schematic diagram of the composition of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0038] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.

[0039] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0040] Some embodiments of the present application can be applied to scenarios where flow features are actively learned to classify attacks. The key technical points involved are as follows: (1) Active learning algorithms under weak supervision are used in flow feature analysis. (2) Full flow sampling detection is used for labeling before flow feature screening. While increasing manual participation, the detection rate of attack events is greatly increased.

[0041] That is to say, some embodiments of the present application provide a method and device for classifying attacks after feature extraction of flows on network boundaries (as opposed to terminal devices, for example, the gateway boundary includes gateway devices) using a semi-supervised learning algorithm, which is characterized by optimizing the false alarm and missed alarm problems of traditional flow-based attack detection.

[0042] Please see Figure 1 , Figure 1 Some embodiments of the present application provide a network attack type identification system, the system includes multiple collected objects (for example, Figure 1 The first gateway 201 and the second gateway 202 (it can be understood that other collected network element objects may also be included) and the server 100, wherein a network attack classification model is deployed on the server 100.

[0043] collection Figure 1 The network traffic data on each gateway is collected and sent to the server, and then the server 100 identifies the specific type of network attack through the network attack classification model deployed thereon.

[0044] It should be noted that the network attack classification model deployed by the server 100 is a neural network model, so it needs to be obtained through advance training.

[0045] Combine the following Figure 2 The method of training a neural network model to obtain a network attack classification model is exemplified.

[0046] like Figure 2As shown, some embodiments of the present application provide a method for training a network attack classification model, the method comprising: S101, collecting network traffic to obtain network traffic data, and processing the network traffic data to obtain network attribute features, wherein the network attribute features at least include network traffic features. S102, obtaining a payload of a portion of the network traffic data from the network traffic data, and obtaining an attack type corresponding to the portion of the network traffic data based on the payload, wherein the network attribute features corresponding to the portion of the network traffic data are reference network attribute features. S103, labeling the reference network attribute features based on the attack type to obtain reference sample data. And S104, obtaining a network attack classification model based on the reference sample data and a first network attribute feature, wherein the first network attribute feature is the remaining network traffic features included in the network traffic features except for the reference network traffic attribute features.

[0047] It should be noted that S104 includes at least two embodiments. In some embodiments of the present application, S104 exemplarily includes: training the clustering model to be trained according to the reference sample data and the first network attribute feature to obtain the network attack classification model. In some embodiments of the present application, S104 exemplarily includes: clustering the reference sample data and the first network attribute feature to obtain a clustering result; training the network attack classification model to be trained according to the clustering result to obtain the network attack classification model.

[0048] The following is an example of the implementation process of training the clustering model to obtain a network attack classification model.

[0049] S101 illustratively includes: capturing traffic characteristics of communication entity objects in the flow.

[0050] It should be noted that what S101 collects from the gateway device is network traffic data, and then it is necessary to extract features from these network traffic data to obtain network attribute features. For example, the network attribute features further include network traffic features (for example, east-west, south-north flow rate, packet size (upload and download packet size), number of recently communicated IPs, communication frequency, intervals between syn packets and ack packets, TCP proportion, etc.) and other feature data (for example, feature data related to LAN and WAN).

[0051] S102 is used to identify the specific attack type corresponding to the network traffic data by using the existing technology according to the extracted payload of the plaintext traffic.

[0052] For example, some embodiments of the present application obtain sampled data by randomly sampling 1% of the collected network traffic data, obtain the message information of the relevant asset context corresponding to the sampled data, and then classify the sampled data according to the message information and the existing basic plaintext judgment model (belonging to the existing judgment model) to obtain the specific attack type corresponding to the network traffic data. It can be understood that the specific attack type corresponding to some network attribute characteristics is obtained through the existing payload method.

[0053] S103: This step labels the corresponding network traffic data based on the attack type obtained in S102 to obtain reference sample data.

[0054] It should be noted that some embodiments of the present application use the reference sample data obtained in S103 to verify whether the clustering result is accurate, whether the process of training the clustering model can be ended, or whether the clustering result can be used as training data to train the network attack classification model.

[0055] By executing the above three steps, we get the following matrix function:

[0056]

[0057] The left side of the formula represents the model related to model type and parameters.

[0058] The right side of the formula is a matrix with n+1 rows and k columns, where k are the indicators of the features, and y represents the results in the training set, which is also the content that needs to be output and verified. The q array represents the weight of each data itself, and m represents the model type and parameters, using tree classification, polynomial classification, etc., specific parameters, normalization processing methods, etc. The indicators are filled with traffic features, not including payload features, and y is the detected attack label. The purpose of clustering in some embodiments of the present application is to make y as valuable and accurate as possible.

[0059] The implementation process of S104 is described below by way of example.

[0060] For example, in some embodiments of the present application, S104 exemplarily includes: performing anti-artificial screening on the clustering results on the clustering boundaries, adjusting the number of clustering layers and parameters, until the first network attribute features are all marked with attack classification tags, and obtaining the network attack classification model.

[0061] For example, in some embodiments of the present application, S104 exemplarily includes: monitoring whether the training process of the clustering model to be trained can be terminated according to the reference sample data. For example, in some embodiments, monitoring whether the training process of the clustering model to be trained can be terminated according to the reference sample data includes: manually evaluating the clustering results and adjusting the erroneous clustering results to obtain the adjusted clustering results; continuing to train the clustering model according to the adjusted clustering results until the network attack classification model is obtained.

[0062] For example, in some embodiments of the present application, clustering the reference sample data and the first network attribute feature to obtain a clustering result includes: if the clustering result of the reference sample data meets the set requirements, confirming that the clustering result is obtained.

[0063] It is understandable that in some embodiments of the present application, the clustering results are also used as training data to train an attack classification model to obtain a network attack classification model.

[0064] Combine the following Figure 3 The clustering model and classification model training process are explained exemplarily.

[0065] S201, capturing characteristics of communication entity objects, traffic characteristics, etc. in the flow.

[0066] S202, using existing methods to obtain attack types for plaintext traffic and labeling network attribute features corresponding to the plaintext traffic (ie, labeling these data to obtain attack types).

[0067] Plaintext traffic can be labeled with attack classifications through existing feature libraries.

[0068]

[0069] The left side of the formula represents the model related to the test set, training set, model type and parameters.

[0070] The right side of the formula is a matrix with n+1 rows and k columns, where the rows represent the index set of the test data, the index of k features, y represents the results in the training set, and is also the content that the test set expects to output and test. The q array represents the weight of each data, m represents the model type and parameters, using tree classification, polynomial classification, etc., specific parameters, normalization processing methods, etc.

[0071] The indicators are filled with traffic features, not payload features, and y is the detected attack label. Our goal is to make y as valuable and accurate as possible. The cost function is

[0072]

[0073] Some embodiments of the present application here use the cross entropy cost function, which is also the most commonly used multi-classification function, where C represents the category. For example, attacks are divided into 7 categories here, then C=7, y is the predicted value of the category as above, and h represents the model parameter.

[0074] The clusters are clearly divided, and according to manual analysis, the number of false positives on cluster boundaries is relatively small.

[0075] S203, classify the attacks according to their flow features, and perform active learning on both labeled and unlabeled attacks.

[0076] S204, de-labeling noise data, abnormal data outside the clusters, etc.

[0077] After clustering, we manually analyze and judge the reasonable and unreasonable parts of the clustering ratio. For example, the previously labeled data are outside the cluster, and some of the labeled data between clusters are inaccurately classified. Here, we extract these inaccurately classified data, remove the labels, and obtain new labeled data, and re-cluster them based on the new labeled data.

[0078] S205, repeat the previous step until 95% of the data are labeled.

[0079] That is, step S204 is repeated until 95% of the data are labeled (that is, the attack types of all network attribute feature data are obtained and labeled). Because the cost of training is high, it is not necessary to classify all data very accurately, and the cost does not match the detection rate.

[0080] S206, saving the classification model.

[0081] Save the cluster analysis model. If you want to improve the accuracy of the model, you can repeatedly save multiple groups of data in S205 to perform supervised learning (that is, use the clustering results as training data to train the network attack classification model). Here, we recommend the lightgb polynomial model (as a specific classification model) for training, and then save the model for subsequent deployment on the server.

[0082] It should be noted that, in some embodiments of the present application, the type of network traffic feature includes: at least one of flow rate, packet size of uploaded or downloaded data, number of IPs communicating within a set time period, and communication frequency. In some embodiments of the present application, the network attribute feature also includes: local area network features and wide area network features.

[0083] The following describes the method for training a network attack classification model in the present application in conjunction with a specific scenario.

[0084] In an IDC computer room environment, the boundary traffic has a throughput of 10T / s. The pcap of the traffic packets of IPv4 communication starting with 100-200 within 2 hours is extracted and saved.

[0085] Step 1: Use traditional IDS detection equipment to classify the saved pcap, such as conventional xss, sql, csrf, rce, data leakage, cve-exploit, stack-overflow and other attacks, and label the classified data with attack tags. Here we focus on labeling under plain text protocol traffic (without tls). If the plain text traffic is not labeled, it is normal traffic.

[0086] Step 2: Form an M-dimensional matrix based on the number of traffic features M, and label it with Y. [Mx]=> the classification relationship of Y. In addition, add other unlabeled encrypted traffic relationship flow data to form an active learning algorithm model under unsupervised learning.

[0087] Step 3: Here, we select a conventional clustering algorithm to try to group all the existing labeled data into one cluster and generate a cluster evaluation function.

[0088] Step 4: De-noising, normalization, and parameter adjustment. Extract data outside the cluster that should be in the cluster but is not, extract data on the cluster boundary for inspection, randomly extract data in the cluster for manual inspection, etc. Optimize the existing cluster analysis method and de-label the data that is not manually confirmed or affected by noise.

[0089] Step 5: Repeat the operation of Step 4 for the data that has been optimized and re-labeled in Step 4, with manual intervention and retraining.

[0090] Step 6: The number of labeled items reaches 95%, of which 5% are for attack analysis and 90% are for normal traffic, which meets the threshold of the proportion of regular attacks. Save the classification model.

[0091] Step 7: Apply the saved classification model to a large traffic environment. There is no need to extract pcap here. You only need to calculate the regular flow information, IP hop count, IP traffic, flow size and other features. By passing the IP context data into the classifier, you can know whether the IP has attack behavior in the current environment and which category the corresponding attack behavior belongs to.

[0092] like Figure 4As shown, some embodiments of the present application provide a method for identifying network attack types, the method comprising: S301, obtaining network attribute characteristics of network traffic data to be identified; S302, inputting the network attribute characteristics into a network attack classification model, and obtaining the attack type corresponding to the network traffic data through the network attack classification model.

[0093] It is understandable that the network attack classification model involved in S302 is based on the following Figure 2 and Figure 3 The network attack classification model obtained by training with this method will not be described in detail here to avoid repetition.

[0094] Please refer to Figure 5 , Figure 5 The apparatus for training a network attack classification model provided in an embodiment of the present application is shown. It should be understood that the apparatus is similar to the above-mentioned Figure 2 The method embodiment corresponds to the method embodiment, and can execute each step involved in the above method embodiment. The specific functions of the device can be found in the description above. To avoid repetition, the detailed description is appropriately omitted here. The device includes at least one software function module that can be stored in the memory in the form of software or firmware or solidified in the operating system of the device. The device for training the network attack classification model includes: a network attribute feature acquisition module 401, an attack type acquisition module 402, a label data acquisition module 403, and a network attack classification model acquisition module 404.

[0095] The network attribute feature acquisition module 401 is configured to collect network traffic to obtain network traffic data, and process the network traffic data to obtain network attribute features, wherein the network attribute features at least include network traffic features.

[0096] The attack type acquisition module 402 is configured to obtain the payload of part of the network traffic data from the network traffic data, and obtain the attack type corresponding to the part of the network traffic data according to the payload, wherein the network attribute feature corresponding to the part of the network traffic data is the reference network attribute feature.

[0097] The labeled data acquisition module 403 is configured to label the reference network attribute features based on the attack type to obtain reference sample data.

[0098] The network attack classification model acquisition module 404 is configured to obtain a network attack classification model based on the reference sample data and the first network attribute feature, wherein the first network attribute feature is the remaining network traffic feature included in the network traffic feature except the reference network traffic attribute feature.

[0099] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the device described above can refer to the corresponding process in the aforementioned method, and will not be described in detail here.

[0100] Please refer to Figure 6 , Figure 6 The device for identifying the type of network attack provided by the embodiment of the present application is shown. It should be understood that the device is similar to the above-mentioned Figure 4 The method embodiment corresponds to the method embodiment, and can execute each step involved in the above method embodiment. The specific functions of the device can refer to the description above. To avoid repetition, the detailed description is appropriately omitted here. The device includes at least one software function module that can be stored in the memory in the form of software or firmware or solidified in the operating system of the device. The device for identifying the type of network attack includes: a feature acquisition module 501 to be identified and an attack type acquisition module 502.

[0101] The to-be-identified feature acquisition module 501 is configured to acquire network attribute features of the to-be-identified network traffic data.

[0102] The attack type acquisition module 502 is configured to input the network attribute feature into the network attack classification model, and obtain the attack type corresponding to the network traffic data through the network attack classification model.

[0103] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the device described above can refer to the corresponding process in the aforementioned method, and will not be described in detail here.

[0104] Some embodiments of the present application provide a computer-readable storage medium having a computer program stored thereon, and when the program is executed by a processor, the method described in any of the above embodiments can be implemented.

[0105] Some embodiments of the present application provide a computer program product, wherein the computer program product includes a computer program, wherein when the computer program is executed by a processor, the method described in any of the above embodiments can be implemented.

[0106] like Figure 7 As shown, some embodiments of the present application provide an electronic device 600, which includes a memory 610, a processor 620, a bus 630, and a computer program stored in the memory 610 and executable on the processor 620, wherein the processor 620 can implement the method described in any of the above embodiments when reading the program from the memory 610 through the bus 630 and executing the program.

[0107] Processor 620 can process digital signals and can include various computing structures, such as complex instruction set computer structure, reduced instruction set computer structure, or a structure that implements a combination of multiple instruction sets. In some examples, processor 620 can be a microprocessor.

[0108] The memory 610 may be used to store instructions executed by the processor 620 or data related to the execution of instructions. These instructions and / or data may include code to implement some or all functions of one or more modules described in the embodiments of the present application. The processor 620 of the present embodiment may be used to execute the instructions in the memory 610 to implement Figure 2 The memory 610 includes a dynamic random access memory, a static random access memory, a flash memory, an optical memory or other memory known to those skilled in the art.

[0109] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0110] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

[0111] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0112] The above description is only an embodiment of the present application and is not intended to limit the scope of protection of the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the scope of protection of the present application. It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings.

[0113] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0114] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

Claims

1. A method for training a network attack classification model, characterized in that: The method comprises: Collecting network traffic to obtain network traffic data, and processing the network traffic data to obtain network attribute characteristics, wherein the network attribute characteristics at least include network traffic characteristics, and the types of the network traffic characteristics include: at least one of flow rate, packet size of uploaded or downloaded data, number of IPs communicating within a set time period, and communication frequency; Acquire a payload of part of the network traffic data from the network traffic data, and obtain an attack type corresponding to the part of the network traffic data according to the payload, wherein the network attribute feature corresponding to the part of the network traffic data is a reference network attribute feature; Labeling the reference network attribute features based on the attack type to obtain reference sample data; Obtaining a network attack classification model according to the reference sample data and the first network attribute feature, wherein the first network attribute feature is the remaining network attribute features included in the network attribute feature except the reference network attribute feature; The obtaining of a network attack classification model according to the reference sample data and the first network attribute feature includes: Training the clustering model to be trained according to the reference sample data and the first network attribute feature to obtain the network attack classification model; The step of training the clustering model to be trained according to the reference sample data and the first network attribute feature to obtain the network attack classification model includes: The network attack classification model is obtained by manually screening the clustering results on the clustering boundary and adjusting the number of clustering layers and parameters until all the first network attribute features are marked with attack classification marks.

2. The method according to claim 1, characterized in that The step of training the clustering model to be trained according to the reference sample data and the first network attribute feature to obtain the network attack classification model includes: Whether the training process of the clustering model to be trained can be completed is monitored according to the reference sample data.

3. The method according to claim 2, characterized in that The monitoring, based on the reference sample data, whether the training process of the clustering model to be trained can be ended includes: Manually evaluate the clustering results and adjust the erroneous clustering results to obtain the adjusted clustering results; The clustering model is continuously trained according to the adjusted clustering result until the network attack classification model is obtained.

4. The method according to claim 1, characterized in that The obtaining of a network attack classification model according to the reference sample data and the first network attribute feature includes: Clustering the reference sample data and the first network attribute feature to obtain a clustering result; The network attack classification model to be trained is trained according to the clustering result to obtain the network attack classification model.

5. The method according to claim 4, characterized in that The clustering of the reference sample data and the first network attribute feature to obtain a clustering result includes: if the clustering result of the reference sample data meets a set requirement, confirming that the clustering result is obtained.

6. The method according to any one of claims 1 to 5, characterized in that: The network attribute characteristics also include: local area network characteristics and wide area network characteristics.

7. A method for identifying network attack types, characterized in that: The method comprises: Obtain network attribute characteristics of the network traffic data to be identified; The network attribute features are input into a network attack classification model trained by the method according to any one of claims 1 to 6, and the attack type corresponding to the network traffic data is obtained through the network attack classification model.

8. A device for training a network attack classification model, characterized in that: The device comprises: The network attribute feature acquisition module is configured to collect network traffic to obtain network traffic data, and process the network traffic data to obtain network attribute features, wherein the network attribute features at least include network traffic features, and the types of the network traffic features include: at least one of flow rate, packet size of uploaded or downloaded data, number of IPs communicating within a set time period, and communication frequency; an attack type acquisition module, configured to acquire a payload of a portion of the network traffic data from the network traffic data, and obtain an attack type corresponding to the portion of the network traffic data according to the payload, wherein the network attribute feature corresponding to the portion of the network traffic data is a reference network attribute feature; A label data acquisition module is configured to label the reference network attribute features based on the attack type to obtain reference sample data; A network attack classification model acquisition module is configured to obtain a network attack classification model according to the reference sample data and a first network attribute feature, wherein the first network attribute feature is a remaining network attribute feature included in the network attribute feature except the reference network attribute feature; The network attack classification model acquisition module is further configured to: Training the clustering model to be trained according to the reference sample data and the first network attribute feature to obtain the network attack classification model; The network attack classification model acquisition module is further configured to: The network attack classification model is obtained by manually screening the clustering results on the clustering boundary and adjusting the number of clustering layers and parameters until all the first network attribute features are marked with attack classification marks.

9. A device for identifying network attack types, characterized in that: The device comprises: A feature acquisition module to be identified, configured to acquire network attribute features of network traffic data to be identified; The attack type acquisition module is configured to input the network attribute features into a network attack classification model trained by any method according to claims 1-6, and obtain the attack type corresponding to the network traffic data through the network attack classification model.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method described in any one of claims 1 to 7 can be implemented.

11. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the method described in any one of claims 1 to 7 can be implemented.

12. A computer program product, characterized in that The computer program product comprises a computer program, wherein the computer program can implement the method according to any one of claims 1 to 7 when executed by a processor.