An attack traffic generation system and method based on adversarial learning

CN117478420BActive Publication Date: 2026-10-23UNIV OF ELECTRONICS SCI & TECH OF CHINA +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311563361.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-22
Publication Date
2026-10-23
Estimated Expiration
2043-11-22

AI Technical Summary

Technical Problem

[0009]本发明的目的在于提供一种基于对抗学习的攻击流量生成原型系统,该系统能够解决当前攻击流量生成策略单一、实现能力弱、可解释性差的问题

Benefits of technology

[0085] Compared with the prior art, the beneficial effects of this invention are as follows:

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117478420B_ABST
    Figure CN117478420B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of artificial intelligence empowerment and confrontation direction, and provides an attack traffic generation system and method based on confrontation learning, aiming to solve the problems of single strategy and weak implementation capability. The system obtains original data through distributed automatic crawler data collection and public data set collection, and learns features by using an adversarial generative network. Then, key features are mined based on adversarial samples, the features are selected for disturbance, and attack traffic is generated in combination with a GAN, and a target NIDS is accessed to optimize the generation model, so that a high bypass rate is ensured. By calculating the influence function of different features of the disturbance importance, the influence degree of the changed features on the model prediction can be determined, and the important features of the attack variants are explained. In addition, the system can also simulate real attacks by grabbing variable parameters of traffic features in an actual network environment, associating key features of adversarial samples, and selecting disturbance features.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence empowerment and adversarial technology, and provides an attack traffic generation system and method based on adversarial learning. Background Technology

[0002] As modern networks grow in size and complexity, and with the numerous applications running on them, communication and network systems become highly vulnerable to various intrusion attacks. To detect increasingly sophisticated attacks, Network Intrusion Detection Systems (NIDS) have been developed and deployed. However, with the advancement of machine learning (ML), these systems have become more sophisticated in recent years, leading to the application and development of ML-based intrusion detection systems that can handle emerging attacks with little or no prior knowledge.

[0003] At the heart of these defensive advancements lies the extraction of high-dimensional feature vectors from network traffic, which are then trained using traditional machine learning or deep learning models to distinguish between benign and malicious traffic. Advances in NIDS make attacks significantly more difficult to succeed.

[0004] Furthermore, Generative Adversarial Networks (GANs) also have broad application potential. GANs consist of a generator and a discriminator that compete against each other to generate high-quality data. They have wide application potential and can be used to generate various types of data and improve existing data; therefore, GANs can be used to generate traffic data.

[0005] However, researchers have proposed some methods to address the problem that most attacks currently struggle to bypass the improved NIDS.

[0006] The work on attack traffic generation is still in its early stages, with most research focusing on detecting abnormal traffic generated during communication by hosts compromised by IoT botnets.

[0007] In the paper "Bringing a GAN to a knife-fight: Adapting malware communication to avoid detection", researchers proposed using generative adversarial networks (GANs) to modify the command and control (C2) channels of malicious traffic to mimic the command and control channels of legitimate applications (such as Facebook traffic), thereby evading detection.

[0008] The paper "Generative adversarial attacks against intrusion detection systems using active learning" demonstrates the ability to compromise IDS using only limited prior knowledge by employing active learning and GANs to launch Adversarial Attacks (AEs) against machine learning-based Intrusion Detection Systems (IDS). Most NIDS circumvention attack methods are based on the assumption that the attacker knows the black-box setup of the system's feature extractor to interfere with the attack traffic signature. This information is then used to disrupt malicious traffic by executing adversarial attacks designed to bypass the NIDS. While these attacks have proven effective at bypassing NIDS, they lose some of their original functionality after applying adversarial perturbations. Therefore, the impact of the attacks on the target network is limited, and in practice, these attacks may not be executable in an end-to-end setup. Summary of the Invention

[0009] The purpose of this invention is to provide a prototype system for generating attack traffic based on adversarial learning, which can solve the problems of current attack traffic generation strategies being singular, having weak implementation capabilities, and poor interpretability.

[0010] To achieve the above objectives, the present invention adopts the following technical solution:

[0011] Specifically, this invention provides a prototype system for generating attack traffic based on adversarial learning, comprising the following devices:

[0012] The traffic data processing module is used to process the collected traffic data.

[0013] First, use the CICflowmeter tool to extract features from the Pcap packets that collect traffic data to obtain the feature vector A of the raw traffic data;

[0014] Next, feature vector A is one-hot encoded, normalized, and its dimensionality reduced to obtain feature vector B;

[0015] An attack traffic generation module based on generative adversarial networks is used to generate attack traffic, including:

[0016] The obtained feature vector B is input into the adversarial network model GAN ​​for learning, resulting in a generator that approximates the real attack feature vector, which is used to simulate the generation of real attack traffic.

[0017] The importance ranking of feature vector A is obtained through recursive feature elimination;

[0018] Based on the ranking, a single feature is selected for interference. The attack traffic with the interference features generated by GAN plays against NIDS. The NIDS is continuously optimized by feedback, resulting in a generator with a high bypass rate against NIDS. The interference features in the successfully bypassed traffic are retained as key features.

[0019] An interpretability module for attack traffic generation, used to interpret the prediction results of the generative model, including:

[0020] For the constructed adversarial network model GAN, the influence function of each perturbed feature is calculated according to its importance to determine the degree of influence of the perturbed feature on the model's prediction, thereby interpreting the model's prediction results;

[0021] The interference feature real attack traffic generation module is used to generate realistic attack traffic, including:

[0022] By analyzing the variable parameters of traffic characteristics in real network environments, and correlating them with the influence function of key features of adversarial examples,

[0023] Among the variable features, the most important features are selected for interference to ensure the functionality of the generated traffic, thereby achieving a realistic simulated attack.

[0024] By using malware to mimic the characteristics of traffic that has successfully bypassed NIDS, the attacker modifies selected characteristics of the attack traffic that needs to be bypassed to achieve an effective and realistic attack that bypasses NIDS, thereby realizing a realistic simulated attack.

[0025] The specific implementation steps of the traffic data processing module in the above technical solution are as follows:

[0026] The CICflowmeter tool is used to extract features from the Pcap packets of the traffic data to obtain the feature vector A of the traffic data, and the commonly used port numbers and protocol numbers of feature vector A are statistically analyzed.

[0027] a1. Process the feature vector A by first filtering features and removing features that have little effect on classification in order to reduce dimensionality;

[0028] a2. Use one-hot encoding to solve the problem of discrete feature values ​​and prevent data dimension explosion caused by a large number of different feature values ​​due to port and protocol characteristics;

[0029] a3. Using commonly used port numbers and protocol numbers as new features, less commonly used port numbers and protocol numbers are classified into another type of feature, with values ​​of 0 or 1.

[0030] a4. Normalize the processed feature vectors to map continuous feature values ​​to the range of 0 to 1, and obtain the processed feature vector B.

[0031] The specific implementation steps of the attack traffic generation module based on generative adversarial networks in the above technical solution are as follows:

[0032] b1. Input the extracted k feature vectors into the Generative Adversarial Network (GAN) model for learning to obtain a generator of feature vectors that approximate the real attack.

[0033] b2. Create a vector from the extracted k features as the initial feature subset;

[0034] b3. Input the initial feature subset into the random forest classifier and calculate the importance of each feature vector;

[0035] b4. Use cross-validation to determine the impact of the initial feature subset on classification;

[0036] b5. Remove the feature vector with the lowest feature importance from the current feature subset to obtain a new feature subset;

[0037] b6. Recursively repeat the previous steps b3-b5 until the feature subset is empty;

[0038] b7. Obtain the importance ranking of feature vector A through recursive feature elimination;

[0039] b8. Select a single feature based on the ranking, use the Generative Adversarial Network (GAN) model to generate attack traffic with interference features and play against NIDS. Continuously feed back and optimize NIDS to obtain a generator with a high bypass rate against NIDS. The traffic features that are successfully bypassed are retained as key features.

[0040] In the above technical solution, the specific implementation steps of the attack traffic generation interpretability module are as follows:

[0041] For the constructed GAN model, the influence function of each perturbation feature is calculated to determine the degree of influence on the prediction of the target NIDS model when a specific feature is changed, so as to interpret the prediction results of the model.

[0042] When feature perturbation is performed, the generated samples will cross the model classification boundary, thus bypassing NIDS. By perturbing features of different importance, different interpretations of the degree of influence on the model can be achieved.

[0043] This explains which features played a crucial role in the traffic generation process, thus enabling the attack variant.

[0044] In the above technical solution, the specific implementation steps of the interference feature real attack traffic generation module are as follows:

[0045] Acquire key features that have a significant impact on the target NIDS;

[0046] Analyze and filter the variable traffic characteristics in the actual network environment, and combine the influence function of the key characteristics obtained above to select the variable characteristics that have a greater impact on the target NIDS and can retain the original offensiveness as attack perturbation characteristics.

[0047] Then, by using malware to mimic the characteristics of a successful bypass, the attacker traffic that needs to be bypassed is modified with selected characteristics to achieve an effective and realistic attack that bypasses NIDS.

[0048] This invention also provides a method for generating attack traffic based on adversarial learning, comprising the following steps:

[0049] Step 1: Process the collected traffic data.

[0050] First, use the CICflowmeter tool to extract features from the Pcap packets that collect traffic data to obtain the feature vector A of the raw traffic data;

[0051] Next, one-hot encoding, normalization, and feature dimensionality reduction are performed on feature vector A to obtain feature vector B;

[0052] Step 2: Generate attack traffic based on generative adversarial networks, including:

[0053] The obtained feature vector B is input into the adversarial network model GAN ​​for learning, resulting in a generator that approximates the real attack feature vector, which is used to simulate the generation of real attack traffic.

[0054] The importance ranking of feature vector A is obtained through recursive feature elimination;

[0055] Based on the ranking, a single feature is selected for interference. The attack traffic with the interference features generated by GAN plays against NIDS. The NIDS is continuously optimized by feedback, resulting in a generator with a high bypass rate against NIDS. The interference features in the successfully bypassed traffic are retained as key features.

[0056] Step 3: Interpret the prediction results of the generative model, specifically including:

[0057] For the constructed adversarial network model GAN, the influence function of each perturbed feature is calculated according to its importance to determine the degree of influence of the perturbed feature on the model's prediction, thereby interpreting the model's prediction results;

[0058] Step 4: Generating Real Attack Traffic with Disruptive Features. This involves generating realistic attack traffic, including:

[0059] By analyzing the variable parameters of traffic characteristics in real network environments, and correlating them with the influence function of key features of adversarial examples,

[0060] Among the variable features, the most important features are selected for interference to ensure the functionality of the generated traffic, thereby achieving a realistic simulated attack.

[0061] By using malware to mimic the characteristics of traffic that has successfully bypassed NIDS, the attacker modifies selected characteristics of the attack traffic that needs to be bypassed to achieve an effective and realistic attack that bypasses NIDS, thereby realizing a realistic simulated attack.

[0062] In the above technical solution, step 1 is as follows:

[0063] The CICflowmeter tool is used to extract features from the Pcap packets of the traffic data to obtain the feature vector A of the traffic data, and the commonly used port numbers and protocol numbers of feature vector A are statistically analyzed.

[0064] a1. Process the feature vector A by first filtering features and removing features that have little effect on classification in order to reduce dimensionality;

[0065] a2. Use one-hot encoding to solve the problem of discrete feature values ​​and prevent data dimension explosion caused by a large number of different feature values ​​due to port and protocol characteristics;

[0066] a3. Using commonly used port numbers and protocol numbers as new features, less commonly used port numbers and protocol numbers are classified into another type of feature, with values ​​of 0 or 1.

[0067] a4. Normalize the processed feature vectors to map continuous feature values ​​to the range of 0 to 1, and obtain the processed feature vector B.

[0068] The specific implementation steps for generating attack traffic based on generative adversarial networks in the above technical solution are as follows:

[0069] b1. Input the extracted k feature vectors into the Generative Adversarial Network (GAN) model for learning to obtain a generator of feature vectors that approximate the real attack.

[0070] b2. Create a vector from the extracted k features as the initial feature subset;

[0071] b3. Input the initial feature subset into the random forest classifier and calculate the importance of each feature vector;

[0072] b4. Use cross-validation to determine the impact of the initial feature subset on classification;

[0073] b5. Remove the feature vector with the lowest feature importance from the current feature subset to obtain a new feature subset;

[0074] b6. Recursively repeat the previous steps b3-b5 until the feature subset is empty;

[0075] b7. Obtain the importance ranking of feature vector A through recursive feature elimination;

[0076] b8. Select a single feature based on the ranking, use the Generative Adversarial Network (GAN) model to generate attack traffic with interference features and play against NIDS. Continuously feed back and optimize NIDS to obtain a generator with a high bypass rate against NIDS. The traffic features that are successfully bypassed are retained as key features.

[0077] In the above technical solution, the specific steps for ensuring the interpretability of attack traffic generation are as follows:

[0078] For the constructed GAN model, the influence function of each perturbation feature is calculated to determine the degree of influence on the prediction of the target NIDS model when a specific feature is changed, so as to interpret the prediction results of the model.

[0079] When feature perturbation is performed, the generated samples will cross the model classification boundary, thus bypassing NIDS. By perturbing features of different importance, different interpretations of the degree of influence on the model can be achieved.

[0080] This explains which features played a crucial role in the traffic generation process, thus enabling the attack variant.

[0081] In the above technical solution, the specific implementation steps for generating real attack traffic with interference characteristics are as follows:

[0082] Acquire key features that have a significant impact on the target NIDS;

[0083] Analyze and filter the variable traffic characteristics in the actual network environment, and combine the influence function of the key characteristics obtained above to select the variable characteristics that have a greater impact on the target NIDS and can retain the original offensiveness as attack perturbation characteristics.

[0084] Then, by using malware to mimic the characteristics of a successful bypass, the attacker traffic that needs to be bypassed is modified with selected characteristics to achieve an effective and realistic attack that bypasses NIDS.

[0085] Compared with the prior art, the beneficial effects of this invention are as follows:

[0086] First, by learning from attack traffic data of various scenarios and types, the types of attacks generated can be more diverse and adapted to the continuously optimized NIDS scenarios.

[0087] II. The main advantage of this invention is its ability to maintain the content of attack packets and adjust them in real time based on frequent target network responses. It eliminates the need for knowledge of NIDS, thus enabling black-box attacks.

[0088] Third, in view of the fact that most current methods only focus on bypassing NIDS to interfere with malicious traffic characteristics for attack, but ignore the preservation of the original functions of these attacks, resulting in the limited impact of the attacks on the target network, a perturbation method that combines actual network traffic characteristics is proposed.

[0089] Fourth, a traffic generation model interpretation technique based on influence functions is proposed. For the constructed GAN model, the influence function of each perturbation feature is calculated to determine the degree of influence on the model prediction when a specific feature is changed, so as to interpret the prediction results of the model. Attached Figure Description

[0090] Figure 1 This is the overall architecture diagram of the present invention. Detailed Implementation

[0091] The present invention will now be further described in conjunction with the accompanying drawings and specific embodiments.

[0092] Current attack traffic generation models generally have relatively fixed architectures, limited attack types and scenarios, making it difficult to simulate real attacks and effectively address complex and diverse network interaction environments and the ever-evolving NIDS scenarios. Most attack evasion methods rely on perturbation attacks on traffic characteristics, assuming attackers understand the white-box settings of the system's feature extractor. They then use this knowledge to reshape malicious traffic by executing adversarial attacks designed to bypass NIDS. While these attacks have proven effective at bypassing NIDS, they lose some of their original functionality after applying adversarial perturbations. Furthermore, existing attack evasion research focuses solely on perturbing traffic characteristics to bypass NIDS, neglecting to explain how successful variant attacks work after bypassing NIDS, hindering analysts' understanding and analysis of errors in model-generated traffic. To address these problems, this invention aims to provide a prototype attack traffic generation system based on adversarial learning, which solves the problems of current attack traffic generation strategies being limited in scope, weak in implementation, and poor in interpretability.

[0093] Therefore, this invention provides an attack traffic generation method based on adversarial learning, which consists of three parts: an attack traffic generation module based on generative adversarial networks, a real attack traffic generation module with interference features, and an interpretable attack traffic generation module. The method mainly includes the following steps:

[0094] S1: First, raw traffic data is collected from public datasets through distributed automated crawler data collection. Then, the attack traffic of different types and scenarios in the collected data is preprocessed to extract behavioral features.

[0095] S2: Input the extracted attack traffic features into the GAN model for learning, set the similarity threshold parameter, and obtain a generator that approximates the real attack. Obtain the ranking of the importance of the original data features through recursive feature elimination.

[0096] S3: Select a single feature based on the ranking, use GAN to generate interference features, and then play a game with NIDS. Continuously feed back and optimize NIDS to obtain a generator with a high bypass rate against NIDS. The features of the successfully bypassed traffic are retained as key features.

[0097] S4: For the constructed GAN model, calculate the influence function of each perturbation feature according to its importance to determine the degree of influence of changing a specific feature on the model's prediction, and interpret the model's prediction results.

[0098] S5: By analyzing traffic characteristic parameters in the actual network environment that will not lose their original attack capabilities due to changes, and combining them with the key feature influence function obtained earlier, variable features that have a greater impact on the target NIDS and can retain the original attack capability are selected as attack perturbation features. Then, malware is used to imitate the traffic characteristics of successfully bypassing the NIDS, and the selected features are modified on the attack traffic that needs to be bypassed to achieve an effective and realistic attack that bypasses the NIDS.

[0099] To further achieve the above objectives, the present invention adopts the following technical solution:

[0100] First, raw data is collected through publicly available data collection. Then, traffic data preprocessing is used to clean the raw data and transform it into spatial feature vectors. An adversarial generative network (GAN) is then used to fully learn these features. Next, based on adversarial examples, key features capable of bypassing NIDS are mined. These key features are selected, perturbed, and combined with a GAN to generate attack traffic while simultaneously accessing the target NIDS to optimize the generation model, thus ensuring a high bypass rate for the generated attack traffic. For the constructed GAN model, the influence function of features with different perturbation importance is calculated to determine the degree of impact of changing features on model prediction, thereby explaining which features play a crucial role in traffic generation. By capturing variable parameters of traffic characteristics from the actual network environment and associating them with key features of adversarial examples, perturbation features are selected, ensuring that the model can simulate real attacks and providing a reliable basis for network security protection.

[0101] Specifically, this invention provides a prototype system for generating attack traffic based on adversarial learning, comprising the following devices:

[0102] Traffic data processing module: First, the CICflowmeter tool is used to extract features from the Pcap packets of the collected traffic data to obtain the preliminary feature vector A of the traffic data; then, one-hot encoding, normalization and feature dimensionality reduction are performed on feature vector A to obtain feature vector B.

[0103] The attack traffic generation module based on generative adversarial networks (GANs) works by inputting the obtained feature vector B into a GAN model for learning, resulting in a generator that approximates the real attack feature vector. Through recursive feature elimination, the importance of the original data features is ranked. Based on the ranking, a single feature is selected for interference, generating attack traffic to play against NIDS. The NIDS is continuously optimized through feedback, resulting in a generator with a high bypass rate against NIDS. The features of successfully bypassed traffic are retained as key features.

[0104] Interpretability of attack traffic generation: For the constructed GAN model, the influence function of each perturbation feature is calculated according to its importance to determine the degree of influence of changing a specific feature on the model's prediction, thereby interpreting the model's prediction results.

[0105] The interference feature real attack traffic generation module analyzes the variable parameters of traffic characteristics in the actual network environment (such as packet size, timestamp, etc.), correlates them with the influence function of key features of adversarial samples, selects the most important features from the variable features to interfere with, so as to ensure the functionality of the generated traffic and thus realize a realistic simulated attack.

[0106] When the system starts, it first collects raw data through distributed automated crawling and public datasets. Then, it preprocesses the raw data by cleaning, formatting, and transforming it into spatial feature vectors. A Generative Adversarial Network (GAN) is then used to fully learn these features. Next, based on adversarial examples, key features that can bypass NIDS are mined. These key features are selected, perturbed, and combined with a GAN to generate attack traffic while simultaneously connecting to the target NIDS to optimize the generation model, thus ensuring a high bypass rate for the generated attack traffic. For the constructed GAN model, the influence function of features with different perturbation importance is calculated to determine the degree of impact of changing features on model prediction. This explains which features play a crucial role in traffic generation, thereby realizing attack variants. Furthermore, by capturing variable parameters of traffic characteristics from the actual network environment and associating them with key features of adversarial examples, perturbation features are selected to ensure that the system can simulate real attacks.

[0107] The specific implementation steps of the traffic data processing module in the above technical solution are as follows:

[0108] S1: Use the CICflowmeter tool to extract features from the Pcap packets of the collected traffic data to obtain the preliminary feature vector A of the attack traffic data, and count the commonly used port numbers and protocol numbers of feature vector A.

[0109] S2: After reading feature vector A, further processing is performed. First, feature filtering is used to remove features from the feature vector that have little effect on classification to reduce dimensionality, such as Flow ID. Then, one-hot encoding is used to solve the problem of feature value discreteness. Furthermore, to prevent data dimensionality explosion during one-hot encoding due to a large number of different feature values ​​for port and protocol features, commonly used port numbers and protocol numbers are used as new features in the feature vector. Less commonly used port and protocol numbers are categorized into two other feature classes. Their values ​​are either 0 or 1, where 1 indicates that the sample contains the feature, and 0 indicates that the sample does not contain the feature.

[0110] S3: Normalization is used to process continuous feature values, mapping them all to the range of 0 to 1 to avoid the influence of different numerical levels between feature values ​​on the model. The final processed feature vector B is obtained.

[0111] In the above technical solution, the attack traffic generation module based on generative adversarial networks has the following specific implementation steps:

[0112] S1: The extracted feature vectors are input into the generative adversarial network model for learning. A similarity threshold parameter is set to obtain a generator that approximates the real attack feature vectors.

[0113] S2: Use the extracted k features as initial features and obtain the original data feature importance ranking through recursive feature elimination;

[0114] S3: Select a single feature based on the ranking, use GAN to generate interference features, and then use the attack traffic to play against NIDS. Continuously feed back and optimize NIDS to obtain a generator with a high bypass rate against NIDS. The traffic features that are successfully bypassed are retained as key features.

[0115] In the above technical solution, the interpretability of attack traffic generation is specifically implemented as follows: For the constructed GAN model, calculate the influence function of each perturbation feature to determine the degree of influence on the prediction of the target NIDS model when changing a specific feature, so as to interpret the prediction results of the model.

[0116] In the above technical solution, the module for generating real attack traffic with interference features has the following specific implementation steps:

[0117] S1: After obtaining the key features that have a significant impact on the target NIDS, in order to prevent the attack traffic after the disturbance from failing to achieve its original attack behavior, it is necessary to analyze and filter the variable traffic features (such as packet size, sending time interval, etc.) in the actual network environment.

[0118] S2: Combining the key feature influence function obtained above, select the variable feature that has a greater impact on the target NIDS and can retain the original aggressiveness as the attack perturbation feature;

[0119] S3: By using malware to mimic the characteristics of successful bypasses, select features of the attack traffic that needs to be bypassed are modified to achieve an effective and realistic attack that bypasses NIDS.

[0120] This invention also provides a method for generating attack traffic based on adversarial learning, which consists of three parts: an adversarial learning attack traffic generation module, an interpretable attack traffic generation module, and a key feature interference traffic generation module. The method mainly includes the following steps:

[0121] S1: First, raw traffic data is collected from public datasets through distributed automated crawler data collection. Then, the attack traffic of different types and scenarios in the collected data is preprocessed to extract behavioral features.

[0122] S2: Input the extracted attack traffic features into the GAN model for learning, set the similarity threshold parameter, and obtain a generator that approximates the real attack. Obtain the ranking of the importance of the original data features through recursive feature elimination.

[0123] S3: Select a single feature based on the ranking, use GAN to generate interference features, and then play a game with NIDS. Continuously feed back and optimize NIDS to obtain a generator with a high bypass rate against NIDS. The features of the successfully bypassed traffic are retained as key features.

[0124] S4: For the constructed GAN model, calculate the influence function of each perturbation feature according to its importance to determine the degree of influence of changing a specific feature on the model's prediction, and interpret the model's prediction results.

[0125] S5: By analyzing traffic characteristic parameters (such as packet size, timestamps, etc.) in the actual network environment that will not lose their original attack capabilities due to changes, and combining them with the key feature influence function obtained earlier, variable features that have a greater impact on the target NIDS and can retain the original attack capability are selected as attack perturbation features. Then, malware is used to imitate the traffic characteristics of successfully bypassing the NIDS, and the selected features are modified on the attack traffic that needs to be bypassed to achieve an effective and realistic attack that bypasses the NIDS.

[0126] Example 1

[0127] A prototype system for generating attack traffic based on adversarial learning includes the following components:

[0128] Traffic data processing module: First, the CICflowmeter tool is used to extract features from the Pcap packets of the collected traffic data to obtain the preliminary feature vector A of the traffic data; then, one-hot encoding, normalization and feature dimensionality reduction are performed on feature vector A to obtain feature vector B.

[0129] The attack traffic generation module based on generative adversarial networks (GANs) works by inputting the obtained feature vector B into a GAN model for learning, resulting in a generator that approximates the real attack feature vector. Through recursive feature elimination, the importance of the original data features is ranked. Based on the ranking, a single feature is selected for interference, generating attack traffic to play against NIDS. The NIDS is continuously optimized through feedback, resulting in a generator with a high bypass rate against NIDS. The features of successfully bypassed traffic are retained as key features.

[0130] Interpretability of attack traffic generation: For the constructed GAN model, the influence function of each perturbation feature is calculated according to its importance to determine the degree of influence of changing a specific feature on the model's prediction, thereby interpreting the model's prediction results.

[0131] The interference feature real attack traffic generation module analyzes the variable parameters of traffic characteristics in the actual network environment (such as packet size, timestamp, etc.), correlates them with the influence function of key features of adversarial samples, selects the most important features from the variable features to interfere with, so as to ensure the functionality of the generated traffic and thus realize a realistic simulated attack.

[0132] The specific implementation steps of the traffic data processing module in the above technical solution are as follows:

[0133] S1: Use the CICflowmeter tool to extract features from the Pcap packets of the collected traffic data to obtain the preliminary feature vector A of the attack traffic data, and count the commonly used port numbers and protocol numbers of feature vector A.

[0134] S2: After reading feature vector A, further processing is performed. First, feature filtering is used to remove features from the feature vector that have little effect on classification to reduce dimensionality, such as Flow ID. Then, one-hot encoding is used to solve the problem of feature value discreteness. Furthermore, to prevent data dimensionality explosion during one-hot encoding due to a large number of different feature values ​​for port and protocol features, commonly used port numbers and protocol numbers are used as new features in the feature vector. Less commonly used port and protocol numbers are categorized into two other feature classes. Their values ​​are either 0 or 1, where 1 indicates that the sample contains the feature, and 0 indicates that the sample does not contain the feature.

[0135] S3: Normalization is used to process continuous feature values, mapping them all to the range of 0 to 1 to avoid the influence of different numerical levels between feature values ​​on the model. The final processed feature vector B is obtained.

[0136] In the above technical solution, the attack traffic generation module based on generative adversarial networks has the following specific implementation steps:

[0137] S1: The extracted feature vectors are input into the generative adversarial network model for learning. A similarity threshold parameter is set to obtain a generator that approximates the real attack feature vectors.

[0138] S2: Use the extracted k features as initial features and obtain the original data feature importance ranking through recursive feature elimination;

[0139] S3: Select a single feature based on the ranking, use GAN to generate interference features, and then use the attack traffic to play against NIDS. Continuously feed back and optimize NIDS to obtain a generator with a high bypass rate against NIDS. The traffic features that are successfully bypassed are retained as key features.

[0140] In the above technical solution, the interpretability of attack traffic generation is specifically implemented as follows: For the constructed GAN model, calculate the influence function of each perturbation feature to determine the degree of influence on the prediction of the target NIDS model when changing a specific feature, so as to interpret the prediction results of the model.

[0141] In the above technical solution, the module for generating real attack traffic with interference features is implemented in the following ways:

[0142] S1: After obtaining the key features that have a significant impact on the target NIDS, in order to prevent the attack traffic after the disturbance from failing to achieve its original attack behavior, it is necessary to analyze and filter the variable traffic features (such as packet size, sending time interval, etc.) in the actual network environment.

[0143] S2: Combining the key feature influence function obtained above, by comparing the relationship between the change of NIDS and the change of training sample weights, the variable feature that has a greater impact on the target NIDS and can retain the original aggressiveness is selected as the attack perturbation feature.

[0144] S3: By using malware to mimic the characteristics of successful bypasses, select features of the attack traffic that needs to be bypassed are modified to achieve an effective and realistic attack that bypasses NIDS.

[0145] This invention also provides a method for generating attack traffic based on adversarial learning, which consists of three parts: an adversarial learning attack traffic generation module, an interpretable attack traffic generation module, and a key feature interference traffic generation module. The method mainly includes the following steps:

[0146] S1: First, raw traffic data is collected from public datasets through distributed automated crawler data collection. Then, the attack traffic of different types and scenarios in the collected data is preprocessed to extract behavioral features.

[0147] S2: Input the extracted attack traffic features into the GAN model for learning, set the similarity threshold parameter, and obtain a generator that approximates the real attack. Obtain the ranking of the importance of the original data features through recursive feature elimination.

[0148] S3: Select a single feature based on the ranking, use GAN to generate interference features, and then play a game with NIDS. Continuously feed back and optimize NIDS to obtain a generator with a high bypass rate against NIDS. The features of the successfully bypassed traffic are retained as key features.

[0149] S4: For the constructed GAN model, calculate the influence function of each perturbation feature according to its importance to determine the degree of influence of changing a specific feature on the model's prediction, and interpret the model's prediction results.

[0150] S5: By analyzing traffic characteristic parameters (such as packet size, timestamps, etc.) in the actual network environment that will not lose their original attack capabilities due to changes, and combining them with the key feature influence function obtained earlier, variable features that have a greater impact on the target NIDS and can retain the original attack capability are selected as attack perturbation features. Then, malware is used to imitate the traffic characteristics of successfully bypassing the NIDS, and the selected features are modified on the attack traffic that needs to be bypassed to achieve an effective and realistic attack that bypasses the NIDS.

Claims

1. A prototype system for generating attack traffic based on adversarial learning, characterized in that, Includes the following devices: The traffic data processing module is used to process the collected traffic data. First, use the CICflowmeter tool to extract features from the Pcap packets that collect traffic data to obtain the feature vector A of the raw traffic data; Next, feature vector A is one-hot encoded, normalized, and its dimensionality reduced to obtain feature vector B; An attack traffic generation module based on generative adversarial networks is used to generate attack traffic, including: The obtained feature vector B is input into the adversarial network model GAN ​​for learning, resulting in a generator that approximates the real attack feature vector, which is used to simulate the generation of real attack traffic. The importance ranking of feature vector A is obtained through recursive feature elimination; Based on the ranking, a single feature is selected for interference. The attack traffic with the interference features generated by GAN plays against NIDS. The NIDS is continuously optimized by feedback, resulting in a generator with a high bypass rate against NIDS. The interference features in the successfully bypassed traffic are retained as key features. An interpretability module for attack traffic generation, used to interpret the prediction results of the generative model, including: For the constructed adversarial network model GAN, the influence function of each perturbed feature is calculated according to its importance to determine the degree of influence of the perturbed feature on the model's prediction, thereby interpreting the model's prediction results; The interference feature real attack traffic generation module is used to generate realistic attack traffic, including: By analyzing the variable parameters of traffic characteristics in real network environments, and correlating them with the influence function of key features of adversarial examples, Among the variable features, the most important features are selected for interference to ensure the functionality of the generated traffic, thereby achieving a realistic simulated attack. By using malware to mimic the characteristics of traffic that has successfully bypassed NIDS, the attacker modifies selected characteristics of the attack traffic that needs to be bypassed to achieve an effective and realistic attack that bypasses NIDS, thereby realizing a realistic simulated attack.

2. The prototype system for generating attack traffic based on adversarial learning according to claim 1, characterized in that, The specific implementation steps of the traffic data processing module are as follows: The CICflowmeter tool is used to extract features from the Pcap packets of the traffic data, resulting in a feature vector A. The commonly used port numbers and protocol numbers for feature vector A are then statistically analyzed. a1. Process the feature vector A by first performing feature filtering to remove features that have little effect on classification, thereby reducing dimensionality; a2. Use one-hot encoding to solve the problem of discrete feature values ​​and prevent data dimension explosion caused by a large number of different feature values ​​due to port and protocol characteristics; a3. Using commonly used port numbers and protocol numbers as new features, less commonly used port numbers and protocol numbers are classified into another type of feature, with values ​​of 0 or 1. a4. Normalize the processed feature vectors to map continuous feature values ​​to the range of 0 to 1, and obtain the processed feature vector B.

3. The prototype system for generating attack traffic based on adversarial learning according to claim 1, characterized in that, The specific implementation steps of the attack traffic generation module based on generative adversarial networks are as follows: b1. Input the extracted k feature vectors into the Generative Adversarial Network (GAN) model for learning to obtain a generator of feature vectors that approximate the real attack. b2. Generate a vector from the extracted k features as the initial feature subset; b3. Input the initial feature subset into the random forest classifier and calculate the importance of each feature vector; b4. Use cross-validation to determine the impact of the initial feature subset on classification; b5. Remove the feature vector with the lowest feature importance from the current feature subset to obtain a new feature subset; b6. Recursively repeat the previous steps b3-b5 until the feature subset is empty; b7. Obtain the importance ranking of feature vector A through recursive feature elimination; b8. Select a single feature based on the ranking, use the Generative Adversarial Network (GAN) model to generate attack traffic with interference features and play against NIDS. Continuously feed back and optimize NIDS to obtain a generator with a high bypass rate against NIDS. The traffic features that are successfully bypassed are retained as key features.

4. The prototype system for generating attack traffic based on adversarial learning according to claim 1, characterized in that, The specific implementation steps of the attack traffic generation interpretability module are as follows: For the constructed GAN model, the influence function of each perturbation feature is calculated to determine the degree of influence on the prediction of the target NIDS model when a specific feature is changed, so as to interpret the prediction results of the model. When feature perturbation is performed, the generated samples will cross the model classification boundary, thus bypassing NIDS. By perturbing features of different importance, different interpretations of the degree of influence on the model can be achieved. This explains which features played a crucial role in the traffic generation process, thus enabling the attack variant.

5. A prototype system for generating attack traffic based on adversarial learning according to claim 1, characterized in that, The specific implementation steps of the interference feature real attack traffic generation module are as follows: Acquire key features that have a significant impact on the target NIDS; Analyze and filter the variable traffic characteristics in the actual network environment, and combine the influence function of the key characteristics obtained above to select the variable characteristics that have a greater impact on the target NIDS and can retain the original offensiveness as attack perturbation characteristics. Then, by using malware to mimic the characteristics of a successful bypass, the attacker traffic that needs to be bypassed is modified with selected characteristics to achieve an effective and realistic attack that bypasses NIDS.

6. A method for generating attack traffic based on adversarial learning, characterized in that: step: Step 1: Process the collected traffic data. First, use the CICflowmeter tool to extract features from the Pcap packets that collect traffic data to obtain the feature vector A of the raw traffic data; Next, feature vector A is one-hot encoded, normalized, and its dimensionality reduced to obtain feature vector B; Step 2: Generate attack traffic based on generative adversarial networks, including: The obtained feature vector B is input into the adversarial network model GAN ​​for learning, resulting in a generator that approximates the real attack feature vector, which is used to simulate the generation of real attack traffic. The importance ranking of feature vector A is obtained through recursive feature elimination; Based on the ranking, a single feature is selected for interference. The attack traffic with the interference features generated by GAN plays against NIDS. The NIDS is continuously optimized by feedback, resulting in a generator with a high bypass rate against NIDS. The interference features in the successfully bypassed traffic are retained as key features. Step 3: Interpret the prediction results of the generative model, specifically including: For the constructed adversarial network model GAN, the influence function of each perturbed feature is calculated according to its importance to determine the degree of influence of the perturbed feature on the model's prediction, thereby interpreting the model's prediction results; Step 4: Generating Real Attack Traffic with Disruptive Features. This involves generating realistic attack traffic, including: By analyzing the variable parameters of traffic characteristics in real network environments, and correlating them with the influence function of key features of adversarial examples, Among the variable features, the most important features are selected for interference to ensure the functionality of the generated traffic, thereby achieving a realistic simulated attack. By using malware to mimic the characteristics of traffic that has successfully bypassed NIDS, the attacker modifies selected characteristics of the attack traffic that needs to be bypassed to achieve an effective and realistic attack that bypasses NIDS, thereby realizing a realistic simulated attack.

7. The attack traffic generation method based on adversarial learning according to claim 6, characterized in that, Step 1 is as follows: The CICflowmeter tool is used to extract features from the Pcap packets of the traffic data, resulting in a feature vector A. The commonly used port numbers and protocol numbers for feature vector A are then statistically analyzed. a1. Process the feature vector A by first performing feature filtering to remove features that have little effect on classification, thereby reducing dimensionality; a2. Use one-hot encoding to solve the problem of discrete feature values ​​and prevent data dimension explosion caused by a large number of different feature values ​​due to port and protocol characteristics; a3. Using commonly used port numbers and protocol numbers as new features, less commonly used port numbers and protocol numbers are classified into another type of feature, with values ​​of 0 or 1. a4. Normalize the processed feature vectors to map continuous feature values ​​to the range of 0 to 1, and obtain the processed feature vector B.

8. The attack traffic generation method based on adversarial learning according to claim 6, characterized in that, The specific steps for generating attack traffic based on generative adversarial networks are as follows: b1. Input the extracted k feature vectors into the Generative Adversarial Network (GAN) model for learning to obtain a generator of feature vectors that approximate the real attack. b2. Generate a vector from the extracted k features as the initial feature subset; b3. Input the initial feature subset into the random forest classifier and calculate the importance of each feature vector; b4. Use cross-validation to determine the impact of the initial feature subset on classification; b5. Remove the feature vector with the lowest feature importance from the current feature subset to obtain a new feature subset; b6. Recursively repeat the previous steps b3-b5 until the feature subset is empty; b7. Obtain the importance ranking of feature vector A through recursive feature elimination; b8. Select a single feature based on the ranking, use the Generative Adversarial Network (GAN) model to generate attack traffic with interference features and play against NIDS. Continuously feed back and optimize NIDS to obtain a generator with a high bypass rate against NIDS. The traffic features that are successfully bypassed are retained as key features.

9. The attack traffic generation method based on adversarial learning according to claim 6, characterized in that, The specific steps for ensuring the interpretability of attack traffic generation are as follows: For the constructed GAN model, the influence function of each perturbation feature is calculated to determine the degree of influence on the prediction of the target NIDS model when a specific feature is changed, so as to interpret the prediction results of the model. When feature perturbation is performed, the generated samples will cross the model classification boundary, thus bypassing NIDS. By perturbing features of different importance, different interpretations of the degree of influence on the model can be achieved. This explains which features played a crucial role in the traffic generation process, thus enabling the attack variant.

10. The attack traffic generation method based on adversarial learning according to claim 6, characterized in that, The specific steps for generating real attack traffic with interference characteristics are as follows: Acquire key features that have a significant impact on the target NIDS; Analyze and filter the variable traffic characteristics in the actual network environment, and combine the influence function of the key characteristics obtained above to select the variable characteristics that have a greater impact on the target NIDS and can retain the original offensiveness as attack perturbation characteristics. Then, by using malware to mimic the characteristics of a successful bypass, the attacker traffic that needs to be bypassed is modified with selected characteristics to achieve an effective and realistic attack that bypasses NIDS.

Citation Information

Patent Citations

  • Network intrusion detection method based on antagonism machine learning

    CN114765561A

  • Vulnerability amplification type backdoor attack security assessment method for network intrusion detection system

    CN114866341A