A multi-stage APT attack detection method for virtual power plants
By analyzing the network traffic of virtual power plants, using technologies such as transfer learning and sequence generation adversarial networks to generate virtual power plants characteristic APT attack traffic data, combined with random forest model detection, the problem of multi-stage APT attack detection in virtual power plants is solved, and effective attack recognition is achieved and the stage is determined to ensure the safety of the power plant.
Patent Information
- Application Number
- CN202410140257.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-01
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2044-02-01
Smart Images

Figure CN117692254B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of virtual power plant security technology, and in particular to a multi-stage APT attack detection method for a virtual power plant. Background Art
[0002] APT attacks are advanced, persistent attacks that usually use a variety of attack techniques, collect information through long-term network penetration, lurk inside the target and gradually obtain internal permissions. Therefore, APT attacks have the characteristics of long activity cycles, high concealment and great destructiveness. At present, the construction of domestic virtual power plants is still in its infancy, and mature and complete security protection measures have not yet been established, making it difficult to effectively detect APT attacks in the system. Summary of the invention
[0003] The present invention mainly solves the technical problems existing in the prior art and provides a multi-stage APT attack detection method for a virtual power plant.
[0004] The technical solution adopted by the present invention comprises the following steps:
[0005] Step 1: Analyze the IEC104 protocol network traffic of the virtual power plant and the APT attack network traffic, extract multi-dimensional traffic features, and perform data cleaning;
[0006] Step 2: Use transfer learning to transfer domain knowledge and generate multi-stage APT attack traffic data with virtual power plant communication characteristics;
[0007] Step 3: Use the sequence generation adversarial network and information gain algorithm to perform data enhancement and feature extraction on the multi-stage APT attack traffic, and combine the random forest model to detect the multi-stage APT attack on the virtual power plant to obtain the attack detection results.
[0008] Furthermore, the use of transfer learning to transfer domain knowledge and generate multi-stage APT attack traffic data with virtual power plant communication characteristics specifically includes the following sub-steps:
[0009] Step 2.1: Use the virtual power plant IEC104 protocol network traffic as the transfer learning source domain and the APT attack network traffic as the transfer learning target domain;
[0010] Step 2.2: Remove similar redundant traffic data in the target domain;
[0011] Step 2.3: Using the transfer learning transfer component analysis algorithm, the data of the two domains are embedded in the high-dimensional reproducing kernel Hilbert space, and similar traffic features between the two domains are extracted to minimize the distribution distance between the two domains, so that the source domain knowledge can be applied to the target domain, generating multi-stage APT attack traffic data with virtual power plant communication characteristics.
[0012] Furthermore, the sequence generation adversarial network and information gain algorithm are used to perform data enhancement and feature extraction on multi-stage APT attack traffic, and the multi-stage APT attack on the virtual power plant is detected by combining the random forest model to obtain the attack detection result. The specific implementation includes the following sub-steps:
[0013] Step 3.1: Data scaling of multi-stage APT attack traffic of virtual power plants;
[0014] Step 3.2: Use SeqGAN sequence generation adversarial network to perform data enhancement on multi-stage APT attack traffic;
[0015] Step 3.3: Perform data inverse scaling on the multi-stage APT attack traffic data of the virtual power plant generated by SeqGAN;
[0016] Step 3.4: Calculate the information gain of each traffic feature and extract the traffic features with larger information gain;
[0017] Step 3.5: Build a random forest model, input traffic data to train and test the model, and obtain attack detection results, which can indicate whether there is an APT attack in the virtual power plant, and if there is an attack, clarify the stage of the attack.
[0018] The present invention has the following advantages:
[0019] 1. Using the transfer learning algorithm, the knowledge of virtual power plant communication characteristics based on the IEC104 communication protocol is applied to APT attack traffic, which can form a multi-stage APT attack traffic dataset with virtual power plant communication characteristics.
[0020] 2. The sequence generation adversarial network and information gain algorithm are used to optimize the traffic data characteristics, and combined with the random forest model to detect APT attacks. This can not only achieve effective detection of multi-stage APT attacks on virtual power plants, but also clarify the stage of the attack, which is of great significance for ensuring the information security and stable operation of virtual power plants. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0022] Figure 1 An overall flow chart of a multi-stage APT attack detection method for a virtual power plant provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0023] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. The schematic embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0024] Please see Figure 1 , an overall implementation flow chart of a multi-stage APT attack detection method for a virtual power plant provided by an embodiment of the present invention, the process includes the following steps:
[0025] Step S1: Analyze the IEC104 protocol network traffic of the virtual power plant and the APT attack network traffic, extract multi-dimensional traffic features, and perform data cleaning, including the following steps:
[0026] 1) Obtain the virtual power plant IEC104 protocol network traffic pcap data packets and APT attack network traffic pcap data packets. Configure the CICFlowmeter tool to parse the above data packets to obtain multi-dimensional traffic features, including source port number, destination port number, flow duration, etc.;
[0027] 2) Data cleaning. This includes removing features with null values, removing features with non-numeric values, and removing features with only a single value.
[0028] Step S2: Use transfer learning to transfer domain knowledge and generate multi-stage APT attack traffic data with virtual power plant communication characteristics. Specifically, it includes the following steps:
[0029] Step S2.1: Using the virtual power plant IEC104 protocol network traffic as the transfer learning source domain , using APT attack network traffic as the target domain for transfer learning .in, and denote the source domain and the target domain respectively, and Represent the source domain and target domain traffic data respectively, and Represent the true labels corresponding to the source domain and target domain traffic data, respectively. and Respectively represent the source domain Traffic data and its corresponding labels, and Respectively represent the target domain Traffic data and its corresponding labels, and Respectively represent the number of flow data in the source domain and the target domain;
[0030] Step S2.2: remove similar redundant traffic data in the target domain;
[0031] Step S2.3: Using the transfer learning transfer component analysis algorithm, embed the data of the two domains into the high-dimensional reproducing kernel Hilbert space, extract similar traffic features between the two domains to minimize the distribution distance between the two domains, so that the source domain knowledge can be applied to the target domain, and generate multi-stage APT attack traffic data with virtual power plant communication characteristics. Specifically, the following steps are also included:
[0032] 1) Extract similar traffic features between two domains to minimize the distribution distance between the two domains using the MMD maximum mean difference algorithm:
[0033]
[0034] in, represents the distribution distance between two domains, Represents the Hilbert norm, and the desired feature map is obtained by minimizing the distribution distance ;
[0035] 2) Introducing the kernel matrix It is expressed as:
[0036] K = [ K s , s K s , t K t , s K t , t ]
[0037] in, and Respectively represent the kernel matrices in the source domain and the target domain defined by the kernel function, and represents the kernel matrix defined by the kernel function in the cross-domain;
[0038] 3) Introducing the coefficient matrix It is expressed as:
[0039]
[0040] 4) Use the kernel technique to simplify the MMD distance. After simplification, the distribution distance is expressed as:
[0041]
[0042] in represents the trace of the matrix, is the regularization term, Greater than or equal to 0;
[0043] 5) The kernel matrix Decomposed into ;
[0044] 6) Introducing the matrix The kernel matrix Transform to dimensional space, , expressed as:
[0045]
[0046] Among them, the matrix , is the transpose of the matrix;
[0047] 7) Using the transformed kernel matrix Represents the MMD distance, and the distribution distance is expressed as:
[0048] ;
[0049] 8) The optimization goal of migration component analysis is The matrix solution is as follows
[0050]
[0051] in, is the balance parameter, is the identity matrix, is the center matrix;
[0052] Finally get The solution is Before The matrix composed of feature vectors, that is, the source domain and the target domain are extracted after the transfer learning transfer component analysis calculation. The 3D traffic feature dataset is an APT attack traffic dataset with virtual power plant communication characteristics.
[0053] Step S3: Use the sequence generation adversarial network and information gain algorithm to perform data enhancement and feature extraction on the multi-stage APT attack traffic, and combine the random forest model to detect the multi-stage APT attack on the virtual power plant to obtain the attack detection result. Specifically, it includes the following steps:
[0054] Step S3.1: scaling the multi-stage APT attack traffic of the virtual power plant, and scaling the traffic data value to a fixed interval;
[0055] Step S3.2: Use SeqGAN sequence generation adversarial network to perform data enhancement on multi-stage APT attack traffic. Specifically, it also includes the following steps:
[0056] 1) Construct LSTM long short-term memory neural network and CNN convolutional neural network
[0057] 2) Using LSTM as the generator and CNN as the discriminator, we construct the SeqGAN sequence generation adversarial network;
[0058] 3) Pre-training and testing of the generator and discriminator of SeqGAN;
[0059] 4) Use the adversarial training and testing of the SeqGAN generator and discriminator to generate multi-stage APT attack traffic for virtual power plants;
[0060] Step S3.3: Perform data inverse scaling on the multi-stage APT attack traffic data of the virtual power plant generated by SeqGAN, and inversely scale the traffic data with values in a fixed interval to restore it to the original traffic data value interval;
[0061] Step S3.4: Calculate the information gain of each traffic feature and extract the traffic features with the largest information gain. Specifically, the following steps are included:
[0062] 1) Calculate the information entropy of all traffic data as:
[0063]
[0064] in Indicates the overall flow data, Represents the information entropy of all traffic data, Indicates the proportion of normal traffic or APT attack traffic;
[0065] 2) The conditional entropy of the calculated feature is expressed as:
[0066]
[0067] in, Indicates characteristics, represents the conditional entropy of the feature, Indicated in the feature The value is The proportion of Representing known features The value is Finally, the information entropy of the entire traffic data;
[0068] 3) Subtract the conditional entropy from the information entropy of the feature to obtain the information gain of the feature, which is expressed as:
[0069]
[0070] in, Represents the information gain of the feature;
[0071] 4) Finally, several traffic features with large information gain are extracted to form the virtual power plant APT attack traffic dataset to be input into the model.
[0072] Step S3.5: Build a random forest model, input traffic data to train and test the model, and obtain attack detection results, which can indicate whether there is an APT attack in the virtual power plant, and if an attack exists, clarify the stage of the attack.
[0073] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.
[0074] The above description is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest range consistent with the principles and novel features applied for herein.
Claims
1. A multi-stage APT attack detection method for a virtual power plant, characterized in that include: Step 1: Analyze the IEC104 protocol network traffic of the virtual power plant and the APT attack network traffic, extract multi-dimensional traffic features, and perform data cleaning; The step 1 specifically includes the following sub-steps: 1) Parsing the IEC104 protocol network traffic of the virtual power plant and the APT attack network traffic is as follows: obtaining the pcap data packets of the IEC104 protocol network traffic of the virtual power plant and the pcap data packets of the APT attack network traffic; configuring the CICFlowmeter tool to parse the above data packets to obtain multi-dimensional traffic characteristics, including source port number, destination port number, and flow duration; 2) Data cleaning includes: removing features with null values, removing features with non-numeric values, and removing features with only a single value; Step 2: Use transfer learning to transfer domain knowledge and generate multi-stage APT attack traffic data with virtual power plant communication characteristics; The step 2 specifically includes the following sub-steps: Step 2.1: Using the virtual power plant IEC104 protocol network traffic as the transfer learning source domain Using APT attack network traffic as the target domain for transfer learning Among them, D s and D t represent the source domain and the target domain respectively, X s and X t Represent the source domain and target domain traffic data respectively, Y s and Y t Represent the true labels corresponding to the source domain and target domain traffic data, respectively. and They represent the i-th flow data in the source domain and its corresponding label respectively, and They represent the jth flow data of the target domain and its corresponding label, n and m represent the number of flow data in the source domain and the target domain respectively; Step 2.2: Remove similar redundant traffic data in the target domain; Step 2.3: Using the transfer learning transfer component analysis algorithm, the data of the two domains are embedded into the high-dimensional reproducing kernel Hilbert space, and similar traffic features between the two domains are extracted to minimize the distribution distance between the two domains, so that the source domain knowledge can be applied to the target domain, and multi-stage APT attack traffic data with virtual power plant communication characteristics is generated; The step 2.3 includes the following sub-steps: 1) Extract similar traffic features between two domains to minimize the distribution distance between the two domains using the MMD maximum mean difference algorithm: Among them, Dist(X s ,X t ) represents the distribution distance between two domains, ||·|| H Represents the Hilbert norm, and the desired feature map is obtained by minimizing the distribution distance 2) The kernel matrix K is introduced and expressed as: Among them, K s,s and K t,t Respectively represent the kernel matrices in the source domain and the target domain defined by the kernel function, K s,t and K t,s represents the kernel matrix defined by the kernel function in the cross-domain; 3) The coefficient matrix L is introduced and expressed as: 4) Using the kernel technique to simplify the MMD distance, the simplified distribution distance is expressed as: Dist(X s ,X t )=tr(KL)-λtr(K) Where tr(·) represents the trace of the matrix, λtr(K) is the regularization term, and λ is greater than or equal to 0; 5) Decompose the kernel matrix K into K = (KK -1 / 2 )(K -1 / 2 K); 6) Introducing the matrix Transform the kernel matrix K to d-dimensional space, d≤n+m, expressed as: Among them, the matrix T is the transpose of the matrix; 7) The MMD distance is represented by the transformed kernel matrix K, and the distribution distance is expressed as: Dist(X s ,X t )=tr((KWW T K)L)=tr(W T KLKW); 8) The optimization goal of migration component analysis is to solve the W matrix as follows mintr(W T KLKW)+μtr(W T IN) s.t.W T KHKW=I Among them, μ is the equilibrium parameter, I is the unit matrix, and H is the center matrix; Finally, the solution of W is (I+μKLK) -1 The matrix composed of the first d feature vectors of KHK, that is, the d-dimensional traffic feature dataset extracted after the source domain and the target domain are calculated by transfer learning migration component analysis, that is, the APT attack traffic dataset with virtual power plant communication characteristics; Step 3: Use the sequence generation adversarial network and information gain algorithm to perform data enhancement on the multi-stage APT attack traffic, and then perform feature extraction, and combine the random forest model to detect the multi-stage APT attack on the virtual power plant to obtain the attack detection results; The step 3 includes the following sub-steps: Step 3.1: Data scaling of multi-stage APT attack traffic of virtual power plants; Step 3.2: Use SeqGAN sequence generation adversarial network to perform data enhancement on multi-stage APT attack traffic; The step 3.2 includes the following sub-steps: 1) Construct LSTM long short-term memory neural network and CNN convolutional neural network; 2) Using LSTM as the generator and CNN as the discriminator, we construct the SeqGAN sequence generation adversarial network; 3) Pre-training and testing of the generator and discriminator of SeqGAN; 4) Use the adversarial training and testing of the SeqGAN generator and discriminator to generate multi-stage APT attack traffic for virtual power plants; Step 3.3: Perform data inverse scaling on the multi-stage APT attack traffic data of the virtual power plant generated by SeqGAN; Step 3.4: Calculate the information gain of each traffic feature and extract the traffic features with larger information gain; Step 3.5: Build a random forest model, input traffic data to train and test the model, and obtain attack detection results, which can indicate whether there is an APT attack in the virtual power plant, and if there is an attack, clarify the stage of the attack.
2. According to claim 1, the multi-stage APT attack detection method for virtual power plants is characterized in that The step 3.4 includes the following sub-steps: 1) Calculate the information entropy of all traffic data as: H(Y)=-∑p(y)log2p(y) Where Y represents the total traffic data, H(Y) represents the information entropy of the total traffic data, and p(y) represents the proportion of normal traffic or APT attack traffic; 2) The conditional entropy of the calculated feature is expressed as: H(Y|X)=∑p(x)H(Y|X=x) Where X represents the feature, H(Y|X) represents the conditional entropy of the feature, p(x) represents the proportion of feature X with the value x, and H(Y|X=x) represents the information entropy of the entire traffic data after the feature X value is known to be x; 3) Subtract the conditional entropy from the information entropy of the feature to obtain the information gain of the feature, which is expressed as: IG(X)=H(Y)-H(Y|X) Among them, IG(X) represents the information gain of the feature; 4) Extract several traffic features with large information gain to form the virtual power plant APT attack traffic dataset to be input into the model.
