A method for generating adversarial attack samples

The improved Wasserstein GAN network generates high-quality adversarial attack samples, which solves the problems of traditional intrusion detection systems' insufficient ability to detect complex attacks and the mode collapse of the adversarial attack sample generation model, and improves the performance and robustness of the intrusion detection system. Achieving more efficient detection results.

CN118337526BActive Publication Date: 2024-09-13CHANGCHUN UNIV
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202410740771.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-11
Publication Date
2024-09-13
Estimated Expiration
2044-06-11

AI Technical Summary

Technical Problem

It is difficult for traditional signature-based intrusion detection systems to detect complex attacks. Machine learning models are susceptible to adversarial attacks, especially white-box attacks and black-box attacks, resulting in reduced detection performance. The adversarial attack sample generation model has mode collapse problems, which affects detection. Generalization ability and robustness of the system.

Method used

The improved Wasserstein GAN network is used to generate high-quality adversarial attack samples by introducing a multi-generator structure and adding a generator loss function with a distortion rate, and uses these samples to confront the detection system, thereby improving the performance and robustness of the intrusion detection system.

Benefits of technology

It achieves the generation of adversarial network traffic that conforms to actual scenarios without knowing the detailed information of the target model, improves the performance and efficiency of the intrusion detection system, reduces the time complexity and cost of adversarial attack sample training, and improves sample generation. quality and detection accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118337526B
    Figure CN118337526B
Patent Text Reader

Abstract

A method for generating adversarial attack samples. The invention belongs to the field of network security technology, and specifically to the field of network intrusion detection technology. An improved Wasserstein GAN network designed independently is used to learn the characteristics of benign traffic, so as to disguise malicious traffic and generate adversarial attack samples, so as to use the adversarial attack samples to better test and upgrade the intrusion detection system based on machine learning. The improved Wasserstein GAN network introduces a multi-generator structure in the Wasserstein GAN network, and adds a distortion rate to the generator loss function. The method of the present invention has a wider range of application scenarios. It can generate adversarial network traffic without knowing the detailed information of the target model, so that the generated adversarial attack samples conform to the actual attack scenario, thereby being able to more accurately improve the performance of the intrusion detection system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of network security, and in particular to the technical field of network intrusion detection. Background Art

[0002] Intrusion Detection System (IDS) is an active defense measure designed to detect and respond to suspicious or malicious activities in networks and systems. Intrusion detection can be divided into two main categories, namely signature-based intrusion detection systems and model-based intrusion detection systems. With the continuous development and optimization of attack technologies, traditional signature-based intrusion detection systems have gradually become unable to meet the increasingly complex detection needs. In recent years, machine learning (ML), especially deep learning, has performed well in handling classification tasks and has therefore been widely used in the field of intrusion detection. Therefore, existing technologies have begun to focus on ML-based IDS to have a more flexible and intelligent response to new attacks.

[0003] Although ML models play a vital role in IDS, their reliability is flawed, resulting in high false positive results. This results in attacks not being detected even if they occur. In addition, because attackers can exploit the vulnerabilities presented by machine learning models when processing input data, a new type of network traffic attack has been triggered, namely adversarial attacks. Adversarial attacks are an attack method specifically targeting machine learning models, which aims to deceive the model into making incorrect classifications through small but carefully designed modifications to input data. This attack can cause serious security issues even with seemingly harmless inputs.

[0004] Adversarial attacks can be divided into two types: black-box attacks and white-box attacks, depending on the attacker's knowledge and visibility of the target network. The core idea of ​​white-box attacks is that the attacker has detailed internal information about the target system, including source code, structure, and algorithms. This allows the attacker to have a deeper understanding of how the system works, thereby launching attacks more effectively. At present, the threat level of white-box attacks is increasing, and with the rapid development of deep learning and artificial intelligence, white-box attacks have become more common and serious. Attackers are able to discover and exploit system weaknesses by analyzing the internal structure of the model, which poses a threat to security in all fields. However, although some classic white-box attack methods have proven their effectiveness against neural networks and demonstrated the ability to circumvent defense mechanisms, some attack methods may not be practical in certain situations due to their implementation limitations in practice. Black-box attacks refer to attacks in which the attacker has no internal information about the system when attacking the target system and can only guess how the system works by observing the input and output. This attack method occupies an important position in modern network security threats. Today's most advanced black-box attack methods include malicious traffic generation methods based on generative adversarial networks (GANs), transfer learning methods, and embedded adversarial sample generation methods.

[0005] The principle of using GAN to disguise malicious traffic to evade IDS is to use the competitive training between the generator and discriminator of GAN to generate network traffic that is similar to normal traffic but has malicious purposes. Due to the continuous adversarial training between the generator and discriminator of GAN, the generator structure of GAN can generate highly realistic fake samples. At the same time, because GAN is an end-to-end training model, it can flexibly adjust the network structure and training strategy according to different attack scenarios and target systems, making it highly adaptable. It is difficult for traditional IDS to accurately detect these malicious traffic from a large amount of traffic.

[0006] Malicious traffic generated by GAN has attracted much attention at present. Using malicious traffic generated by improved GAN disguise to retrain machine learning-based intrusion detection systems can enable intrusion detection systems to identify more diverse malicious attack traffic, making them more generalizable and robust, and having better performance. Technicians have widely adopted the method of simulating adversarial attack samples to simulate the generation of malicious traffic, thereby testing and upgrading the detection network. However, there is still a key challenge, namely, mode collapse when simulating adversarial attack samples, which has a significant impact on the diversity of samples generated by the generator. Since the GAN model mainly generates data through the game between the generator and the discriminator, and the game between the generator and the discriminator is mainly achieved through the loss function, the choice of the loss function will directly affect the diversity and quality of the generated data. Therefore, although significant progress has been made in generating adversarial attack samples using GAN, we still need to further study and explore more complex and diverse model architectures to improve the quality and fidelity of generated adversarial attack samples. Summary of the invention

[0007] In order to solve the above technical problems, the present invention provides a method for generating adversarial attack samples, which uses a self-designed GAN network to learn the characteristics of benign traffic, thereby disguising malicious traffic to generate adversarial attack samples, thereby using the adversarial attack samples to better test and upgrade the intrusion detection system based on machine learning. The method comprises the following steps:

[0008] S1, obtain a traffic sample set and pre-process it, and divide the processed data into a normal traffic sample set and a malicious traffic sample set;

[0009] S2, input the data in the normal traffic sample set into the improved Wasserstein GAN network, and use the improved Wasserstein GAN to learn the characteristics of the normal traffic samples;

[0010] The improved Wasserstein GAN network introduces a multi-generator structure into the Wasserstein GAN network, and adds a distortion rate to the generator loss function;

[0011] S3, inputting the data in the malicious traffic sample set into the improved Wasserstein GAN network according to their categories, and disguising the malicious traffic sample data using the normal traffic sample features learned by the improved Wasserstein GAN network to generate data that is the adversarial attack sample;

[0012] S4. Input the generated adversarial attack sample into the discriminator in the improved Wasserstein GAN network for discrimination. If it is discriminated as a normal traffic sample, it proves that the generated adversarial attack sample meets the requirements.

[0013] The beneficial effects of the method of the present invention are:

[0014] (1) The method of the present invention is universal and has a wider range of application scenarios. It can generate adversarial network traffic without knowing the detailed information of the target model, so that the generated adversarial attack samples are consistent with the actual attack scenario, thereby being able to more accurately improve the performance of the intrusion detection system.

[0015] (2) The method described in the present invention also has the advantages of high efficiency and low resource consumption. The adversarial sample generation method in the present invention integrates multiple generators to generate adversarial samples, effectively improving the quality of the data generated by the generator and solving the mode collapse problem of Wasserstein GAN (WGAN) to a certain extent. The loss function is adjusted in a targeted manner to help the model more accurately measure the difference between the generated data and the real data, and help the generator to more finely adjust the characteristics of the generated data, thereby improving the training effect of the generator and the quality of the generated samples; thereby reducing the time complexity of adversarial attack sample training, saving time and space, and improving accuracy while reducing costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 This is the Wasserstein GAN network structure diagram;

[0017] Figure 2 This is the improved Wasserstein GAN network structure diagram;

[0018] Figure 3 A flow chart for generating the anti-attack sample according to the present invention. DETAILED DESCRIPTION

[0019] The technical solution of the present invention will be described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the protection scope of the present invention.

[0020] Embodiment 1,

[0021] The method of the present invention comprises the following steps:

[0022] S1, obtain a traffic sample set and pre-process it, and divide the processed data into a normal traffic sample set and a malicious traffic sample set;

[0023] S2, input the data in the normal traffic sample set into the improved Wasserstein GAN network, and use the improved Wasserstein GAN to learn the characteristics of the normal traffic samples;

[0024] The improved Wasserstein GAN network introduces a multi-generator structure into the Wasserstein GAN network, and adds a distortion rate to the generator loss function;

[0025] S3, inputting the data in the malicious traffic sample set into the improved Wasserstein GAN network according to their categories, and disguising the malicious traffic sample data using the normal traffic sample features learned by the improved Wasserstein GAN network to generate data that is the adversarial attack sample;

[0026] S4. Input the generated adversarial attack sample into the discriminator in the improved Wasserstein GAN network for discrimination. If it is discriminated as a normal traffic sample, it proves that the generated adversarial attack sample meets the requirements.

[0027] Embodiment 2,

[0028] This embodiment is a further limitation of Embodiment 1.

[0029] The preprocessing in step S1 is specifically as follows:

[0030] S11, performing data cleaning, feature extraction and data normalization operations on the traffic sample set;

[0031] The specific data cleaning is as follows: delete the samples containing Nan and Infinity in the sample set;

[0032] Feature extraction is as follows: mutual information is used to calculate the correlation between each feature and the sample label to which it belongs, and then the correlation is sorted and the features with weak correlation are deleted. Specifically, the top 70 features in the sorting are retained and the others are deleted.

[0033] The specific calculation formula of correlation is as follows:

[0034] ;

[0035] in, X and Y The specific meanings are explained as follows:

[0036] Assume that the data set after data cleaning is D, which contains n data, expressed as: x =( x1,x2...xn ) belongs to D;

[0037] For each piece of data, there is m Data, before m -1 is feature data, m The label to which this piece of data belongs;

[0038] Take the calculation of the correlation between the sample labels of the first feature data as an example, assuming that all n The first feature of a data item is a sample set, i.e. T , suppose all n The sample label of each piece of data is a sample set. L ;

[0039] When using the above formula for calculation, X The representative sample set T , in the formula Y The representative sample set L ;

[0040] x represents the feature data in X, y express Y Sample labels in ;

[0041] p ( x , y )express x and y The joint probability distribution of p ( x )express x The marginal probability distribution of p ( y )express y The marginal probability distribution of

[0042] Data normalization is as follows: use maximum and minimum normalization to normalize the sample set. This step is conducive to model training and convergence. The specific calculation formula is as follows:

[0043] = ;

[0044] in, represents the normalized value of the calculated feature, represents the minimum value of this feature in the data, Indicates the maximum value of this feature in the data.

[0045] S12. Analyze the significance of each feature and determine the features that need to be retained in the end.

[0046] The standard for retaining features is: the original label attributes of the data remain unchanged while being able to evade the machine learning-based intrusion detection system. Among them, the source IP address, destination IP address and port number in the TCP / IP protocol cannot be modified.

[0047] Taking the CICIDS2017 dataset as an example, the characteristic data in Table 1 are retained and no disguised modification is allowed:

[0048] Table 1:

[0049]

[0050] In step S1, the processed data is divided into a normal traffic sample set and a malicious traffic sample set, specifically:

[0051] Each piece of data has multiple features, the last of which is the category to which the data belongs, namely the traffic label. The data is divided into a normal traffic sample set and a malicious traffic sample set according to the traffic label. Common data sets are CICIDS2017 and NSL-KDD data sets, and their division methods are shown in Table 2 and Table 3 respectively:

[0052] Table 2:

[0053]

[0054] Table 3:

[0055]

[0056] Embodiment 3,

[0057] This embodiment is a further limitation of Embodiment 1. The improved Wasserstein GAN network improves the original Wasserstein GAN network in the following specific aspects:

[0058] Multi-generator structure: The improved Wasserstein GAN network uses the Wasserstein GAN network as the basic model and introduces a multi-generator structure. The structure of the Wasserstein GAN network model is as follows: Figure 1 As shown in the figure, X BENIGN represents normal traffic sample data, X MAL represents malicious traffic sample data, G represents the generator, and D represents the discriminator. In the WassersteinGAN network, data is generated by a single generator, and the generated data and the original data are input into the discriminator for identification. After multiple iterations, the discriminator cannot determine whether the input data is real data or data generated by the generator.

[0059] The improved Wasserstein GAN network introduces a multi-generator structure, such as Figure 2 As shown, G 1~n Represents n generators, Bot and DOS represent the categories to which specific malicious traffic sample data belongs; n generator structures are designed, where n represents the number of specific categories of input data, so that each category of data uses an independent generator of that category. Using a generator for each category of data can effectively improve the quality of the data generated by the generator and solve the mode collapse problem of the Wasserstein GAN network to a certain extent.

[0060] Improved loss function: In the Wasserstein GAN network, the Wasserstein distance is minimized by limiting the parameters of the discriminator to Lipschitz continuity and then optimizing a loss function with truncated gradients. On the basis of the generator loss function of the Wasserstein GAN network, the distortion rate is added to measure the distance between the real data and the generated data; this improvement can help the model more accurately measure the difference between the generated data and the real data, and help the generator to more finely adjust the characteristics of the generated data, thereby improving the training effect of the generator and the quality of the generated samples; the loss function formulas of the generator and discriminator of the improved Wasserstein GAN network are as follows:

[0061] ;

[0062] ;

[0063] in, L G represents the loss function of the generator, L D represents the loss function of the discriminator, P r is the real data distribution given by the dataset, P g is the generator distribution of the improved Wasserstein GAN network, N is the total number of samples, i Indicates the first i Features, Represents the generated distribution P g The expected value of the sample in Represents the distribution from real data P r The expected value of the sample in Represents the output of the discriminator. The output result is the truth or falsity of the data, 0 for true and 1 for false.

[0064] Embodiment 4,

[0065] This embodiment is a further limitation of Embodiment 1, and the step S3 is specifically as follows:

[0066] S31, inputting the data in the malicious traffic sample set into the improved Wasserstein GAN network according to their categories;

[0067] S32, using the generator of the improved Wasserstein GAN network to generate adversarial samples, and using the features retained in step S12 to replace the corresponding parts in the generated adversarial samples;

[0068] Due to the particularity of traffic data, many of the characteristic data determine the category attributes of the traffic. If the characteristics of the traffic data are arbitrarily changed, it will lose its original attributes.

[0069] Therefore, retaining some traffic features will retain the original label attributes of the traffic and allow the experiment to proceed normally. If the feature data is changed arbitrarily, the following results may occur:

[0070] Invalidate traffic data and do not comply with TCP and other communication protocols;

[0071] The traffic data loses its original label and the maliciousness of the original data, thus confusing the experiment and reducing the experimental effect;

[0072] Embodiment 5,

[0073] This embodiment is a further limitation of Embodiment 1, and step S4 is specifically as follows:

[0074] S41, input the generated adversarial sample into the discriminator, use the discriminator and the normal traffic sample set to perform classification judgment, and confirm whether the generated adversarial sample can pass the judgment of the discriminator;

[0075] S42, using the generator to generate adversarial samples and the loss generated in the discriminator judgment process to feedback update the generator and the discriminator;

[0076] S43. The above operation is iterated multiple times to improve the performance of the improved Wasserstein GAN network.

[0077] The flowchart of the entire adversarial attack sample generation is as follows Figure 3 As shown, we first obtain the traffic sample set and preprocess it, and then divide the processed data into the normal traffic sample set X BENIGN and malicious traffic sample set X MAL; Input the data in the normal traffic sample set into the improved Wasserstein GAN network, and use the improved Wasserstein GAN network to learn the characteristics of normal traffic samples; Input the data in the malicious traffic sample set into the improved Wasserstein GAN network according to their categories. Bot, DOS...DDOS, and XSS in the figure represent different categories respectively. 1~n Represents n generators; the data generated by disguising malicious traffic sample data using the normal traffic sample features learned by the improved Wasserstein GAN network is the adversarial attack sample; the adversarial attack sample is input into the discriminator and the discriminator is used to classify and judge it with the normal traffic sample. When the output result is 0, the adversarial attack sample is judged to be true, that is, the discriminator judges it as a normal traffic sample. When the output result is 1, the adversarial attack sample is judged to be false, that is, the discriminator judges it as a malicious traffic sample.

Claims

1. A method for generating an adversarial attack sample, characterized in that: The method comprises the following steps: S1, obtain a traffic sample set and pre-process it, and divide the processed data into a normal traffic sample set and a malicious traffic sample set; S2, input the data in the normal traffic sample set into the improved Wasserstein GAN network, and use the improved Wasserstein GAN to learn the characteristics of the normal traffic samples; The improved Wasserstein GAN network introduces a multi-generator structure into the Wasserstein GAN network, and adds a distortion rate to the generator loss function; In the improved Wasserstein GAN network, the number of generators is set according to the specific number of categories of input data; In the improved Wasserstein GAN network, the loss function formulas of the generator and discriminator are as follows: ; ; in, L G represents the loss function of the generator, L D represents the loss function of the discriminator, P r is the actual data distribution given by the dataset, P g is the generator distribution of the improved Wasserstein GAN network, N is the total number of samples, i Indicates the data i Features, Represents the generated distribution P g The expected value of the sample in Represents the distribution from real data P r The expected value of the sample in Represents the output of the discriminator. The output result is the truth or falsehood of the data. True is 0 for passing, and false is 1 for failing. S3, inputting the data in the malicious traffic sample set into the improved Wasserstein GAN network according to their categories, and disguising the malicious traffic sample data using the normal traffic sample features learned by the improved Wasserstein GAN network to generate data that is the adversarial attack sample; S4. Input the generated adversarial attack sample into the discriminator in the improved Wasserstein GAN network for discrimination. If it is discriminated as a normal traffic sample, it proves that the generated adversarial attack sample meets the requirements.

2. The method for generating an adversarial attack sample according to claim 1, characterized in that: The pre-processing is specifically as follows: S21, data cleaning: delete samples containing Nan and Infinity in the sample set; S22, feature extraction: use mutual information to calculate the correlation between each feature and the sample label to which it belongs, then sort the correlations, retain the top 70 features in the sort, and delete the others; S23, data normalization: use maximum and minimum normalization to normalize the data of the sample set; S24. Analyze the significance of each feature and determine the features that need to be retained in the end: The standard for retaining features is to ensure that the data does not change its original label attributes while being able to evade the machine learning-based intrusion detection system. Among them, the source IP address, destination IP address and port number in the TCP / IP protocol must be retained.

3. The method for generating an adversarial attack sample according to claim 2, characterized in that: The step S3 is specifically as follows: S31, inputting the data in the malicious traffic sample set into the improved Wasserstein GAN network according to their categories; S32. Use the generator of the improved Wasserstein GAN network to generate adversarial samples, and use the features retained in step S24 to replace the corresponding parts in the generated adversarial samples.

4. The method for generating an adversarial attack sample according to claim 3, characterized in that: The step S4 is specifically as follows: S41, input the generated adversarial sample into the discriminator, use the discriminator and the normal traffic sample set to perform classification judgment, and confirm whether the generated adversarial sample can pass the judgment of the discriminator; S42, using the generator to generate adversarial samples and the loss generated in the discriminator judgment process to feedback update the generator and the discriminator; S43, iterating steps S41-S42 multiple times to improve the performance of the improved Wasserstein GAN network.

Citation Information

Cited By

  • Network threat perception defense strategy optimization system and method based on machine learning

    CN119996009A

  • Network threat perception and defense strategy optimization system and method based on machine learning

    CN119996009B

  • Table data type adversarial sample generation method based on double-discriminator CTGAN

    CN120281536A