APT attack detection method based on graph theory and statistical method
Through the network interaction graph model based on graph theory and statistical methods, APT attacks are identified and detected, which solves the problem of difficulty in identifying complex network attacks with existing technologies and achieves more efficient detection and response capabilities.
Patent Information
- Application Number
- CN202410767677.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-14
- Publication Date
- 2024-10-01
AI Technical Summary
It is difficult for existing technologies to effectively identify and defend against complex network attacks. In particular, the high concealment and harm of APT attacks make it difficult for traditional security measures to detect these attacks.
Adopt an attack detection method based on graph theory and statistical methods, build a network interaction graph model, extract node and edge features, use graph theory analysis and statistical methods to establish a normal behavior baseline, monitor and update the graph structure in real time, and identify abnormal behaviors.
It enhances the detection capabilities of APT attacks, reduces false positives and false negatives, supports real-time monitoring and rapid response, and can adapt to changing network environments and attack technologies.
Smart Images

Figure CN118740440A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of network security and relates to an attack detection method based on graph theory and statistical methods. Background Art
[0002] The rapid development of information technology and the increasing number of Internet applications have made network security issues particularly prominent and have become a major obstacle to the development of information technology. In such a complex network environment, how to effectively identify and resist various security threats and ensure the security and stability of information systems is a technical challenge that urgently needs to be solved.
[0003] APT attack detection methods based on graph theory and statistical methods use graph theory and statistical analysis to identify and defend against complex network attacks. APT attacks are usually launched by organized groups with the purpose of lurking in the target network for a long time, quietly collecting intelligence or carrying out damage. Due to the characteristics of high persistence, high concealment, and high harm of APT attacks, these attacks are difficult to be discovered by traditional security measures. APT attack detection method based on small sample learning of attack path [Beijing University of Technology. APT attack detection method based on small sample learning of attack path: CN202311784987.6[P].2024-04-19.] According to the audit log data traceability graph, it is constructed and optimized and potential attack behaviors are mined to achieve accurate attack detection of small samples. APT attack detection and path reconstruction method based on network traffic [Shanghai Jiaotong University. A method for APT attack detection and path reconstruction based on network traffic: CN202410026473.2[P].2024-04-19.] By extracting specific traffic features to identify anomalies in the traffic, and locating abnormal nodes in the network, these anomalies are then associated to reconstruct the attack path to identify anomalies. Due to the high concealment of APT attacks, it is difficult to detect them with a single indicator. Detection technology based on graph theory and statistical methods can comprehensively analyze network security traffic data, and promptly alarm and record any anomalies.
[0004] Graph theory provides a powerful tool to represent and analyze entities and their relationships in complex networks. In APT attack detection, devices, users, processes, etc. in the network can be regarded as nodes, and the interactions between them (such as communication, data access) can be regarded as edges. Through graph theory, network traffic and system log data can be analyzed, a graph model of network interaction can be constructed, and key features can be extracted from it.
[0005] Statistical methods are used in APT attack detection to establish a baseline for normal behavior and identify behaviors that deviate from normal patterns. By analyzing historical data, statistical parameters (such as mean, standard deviation, and probability distribution) of various network behavior characteristics can be calculated. When the behavior monitored in real time is significantly different from the baseline data, an alarm can be triggered for further analysis. The core of APT attack detection lies in anomaly detection. By continuously collecting network traffic and system logs, a graph structure is constructed and updated in real time. Then, statistical methods are used to model normal behavior, and any behavior that does not match the model will be considered anomaly and require further investigation. Summary of the invention
[0006] In order to overcome the deficiencies of the prior art, the present invention provides an attack detection method based on graph theory and statistical methods, which provides a strong guarantee for network security and the efficient operation of related equipment.
[0007] The technical solution of the present invention:
[0008] A method for detecting APT attacks based on graph theory and statistical methods. The steps are as follows:
[0009] S1. Data collection and graph construction
[0010] S1.1. Collect data:
[0011] First, you need to collect network traffic data and system logs;
[0012] Network traffic data includes source IP, destination IP, port, protocol, connection duration, data transmission volume, etc.
[0013] System logs include process startup, file access, user login, permission changes, etc.
[0014] S1.2. Build graph structure:
[0015] The collected data is transformed into a graph where:
[0016] Node set V: Each node represents a system entity, such as a host, user, process, or file.
[0017] Edge set E: Each edge represents the interaction between system entities, such as network connection, file access, and process communication.
[0018] Node type: host (H), user (U), process (P), file (F).
[0019] Edge types: network connection (C), file access (A), process communication (T).
[0020] The following are some examples:
[0021] The network connections of a host to multiple other hosts will be represented as edges between the host nodes.
[0022] A user logged in to multiple hosts will be represented as edges between the user node and multiple host nodes.
[0023] A process accessing multiple files will be represented as edges between the process node and multiple file nodes.
[0024] S2. Feature extraction and graph theory analysis
[0025] S2.1. Extract node features:
[0026] For each node v∈V, extract the feature vector h v =[h v1 ,h v2 ,…,h vd ], features include:
[0027] Host node (H): Connection times (h v1 ), the number of unique IPs connected (h v2 ), the amount of data transmitted (h v3 )wait.
[0028] User node (U): Number of logins (h v4 ), the number of files accessed (h v5 ), the number of processes started (h v6 )wait.
[0029] Process node (P): Start times (h v7 ), the number of files accessed (h v8 ), the number of connected networks (h v9 )wait.
[0030] File node (F): number of accesses (h v10 ), the number of users visiting (h v11 ), modified times (h v12 )wait.
[0031] S2.2. Extract edge features:
[0032] For each edge e∈E, extract the feature vector h e =[h e1 ,h e2, …,h em ], features include:
[0033] Network connection edge (C): connection frequency (h e1 ), data transmission volume (h e2 ), connection duration (h e3 )wait.
[0034] File access edge (A): access frequency (h e4 ), visit duration (h e5 ), access mode (h e6 )wait.
[0035] Process communication edge (T): Communication frequency (h e7 ), communication data volume (h e8 ), communication duration (h e9 )wait.
[0036] S2.3. Graph Theory Analysis:
[0037] Analyze graph structure features using graph theory methods
[0038] Degree: The degree d(v) of a node v represents the number of edges connected to the node v;
[0039]
[0040] Where A is the adjacency matrix of the graph, A vu =1 indicates that there is an edge between nodes v and u.
[0041] Clustering Coefficient: The clustering coefficient C(v) of a node v indicates the density of connections between its neighbors.
[0042]
[0043] Where E(v) is the number of edges between neighbors of node v;
[0044] Connected Components: The number of connected subgraphs in a graph, that is, the largest subgraph in which every node in the graph can reach other nodes through edges.
[0045] Centrality: The importance of node v in the graph. Common centrality indicators include
[0046] Betweenness Centrality: The frequency of occurrence of node v in all shortest paths
[0047]
[0048] Among them, σ st is the number of shortest paths between nodes s and t, σ st (v) is the number of shortest paths passing through node v.
[0049] Degree Centrality: The degree of a node v, which indicates the number of nodes it is directly connected to.
[0050] D(v)=d(v)
[0051] Use graph analytics to identify anomalous patterns or behaviors, such as unusual communication patterns, unauthorized access, or potential insider threats, by comparing to a baseline of normal behavior.
[0052] S3. Anomaly detection model training
[0053] S3.1. Calculate feature distribution:
[0054] For normal behavior data, calculate each feature h ji The mean μ i and standard deviation σ i
[0055]
[0056]
[0057] Where N is the number of samples of normal behavior data, h ji is the i-th eigenvalue of the j-th sample;
[0058] S3.2. Establish a baseline model:
[0059] 1) Define normal behavior: Determine whether the behavior is normal based on system, network or environmental variables and historical experience data and import it into analysis.
[0060] 2) Data Collection: Collect graph data under normal operating conditions. This may include network traffic, communication patterns, user activity logs, etc.
[0061] 3) Feature extraction: Extract features from the graph that help describe normal behavior. These features include:
[0062] Node degree (number of connections to each node);
[0063] Clustering coefficient (local connection density);
[0064] Centrality indicators (such as degree centrality and betweenness centrality);
[0065] 4) Statistical analysis: Statistical analysis is performed on the extracted features to determine their distribution under normal conditions. This includes:
[0066] Calculate mean, median, variance, and standard deviation;
[0067] Determine the distribution type of the feature (such as normal distribution, exponential distribution, etc.);
[0068] 5) Baseline model development: Use the results of statistical analysis to develop a baseline model. Involving:
[0069] Establish descriptive statistical models;
[0070] Apply probabilistic models to simulate the distribution of features;
[0071] Use machine learning techniques to identify patterns of normal behavior;
[0072] 6) Baseline model verification: Verify the accuracy and effectiveness of the baseline model by comparing it with actual data.
[0073] 7) Baseline model adjustment: Adjust model parameters based on the validation results and optimize the model to better match the characteristics of normal behavior.
[0074] 8) Baseline establishment: Determine the baseline, which is the reference range of normal behavioral characteristics. Including:
[0075] The typical value or central tendency of a characteristic (such as the mean);
[0076] Normal range of variation (standard deviation);
[0077] Determine the threshold T based on the mean and standard deviation v ;
[0078] S3.3. Calculate the anomaly score:
[0079] For the new behavior feature vector h v , calculate its distance from the normal behavior baseline
[0080]
[0081] Among them, μ i and σ i are the mean and standard deviation of the i-th feature, and d is the feature dimension.
[0082] Specific formula:
[0083] For each node v, the feature vector h v include:
[0084] Degree h vd =d(v)
[0085] Clustering coefficient h vc =C(v)
[0086] Betweenness centrality h vb =B(v)
[0087]
[0088] μd , μ c , μ b are the means of degree, clustering coefficient, and betweenness centrality, σ d , σ c , σ b is the standard deviation of degree, clustering coefficient, and betweenness centrality.
[0089] Set the threshold T v , when D v When the threshold is exceeded, the node v is considered abnormal.
[0090] S4. Continue to collect network traffic data and system logs and update the graph structure.
[0091] Beneficial effects of the present invention:
[0092] Enhanced detection capabilities: Through graph theory, entities in the network and their interactions can be more comprehensively represented and analyzed, thereby enhancing the detection capabilities of APT attacks.
[0093] Behavioral baseline modeling: Using statistical methods to model normal network behavior can establish a behavioral baseline, making abnormal behavior easier to identify.
[0094] Real-time monitoring and response: This method supports real-time monitoring of network traffic and system logs, timely updates of graph structures, and rapid responses to possible APT attacks.
[0095] Reduce false positives and false negatives: Through precise feature extraction and advanced statistical analysis, false positives and false negatives can be reduced, improving the accuracy of APT attack detection.
[0096] Strong adaptability: This method can adapt to the ever-changing network environment and attack techniques, and respond to new APT attack strategies by learning and updating the detection model. BRIEF DESCRIPTION OF THE DRAWINGS
[0097] Figure 1 It is a flow chart of the APT attack detection method based on graph theory and statistical methods of the present invention.
[0098] Figure 2 It is a schematic diagram of the practical application of the present invention. DETAILED DESCRIPTION
[0099] The specific implementation of the present invention is further described below in conjunction with the accompanying drawings and technical solutions.
[0100] Step 1: Real-time monitoring: Continuously collect network traffic data and system logs, and update the graph structure G.
[0101] Real-time monitoring is a key task in network security management, which involves the continuous collection of network traffic data and system logs to understand the various activities occurring in the network and system in real time. In this process, every activity in the network, such as data transmission, user login, file access, etc., will be recorded and used to update the graph structure G. The graph structure G is an abstract model that represents the entities in the network (such as hosts, users, processes, files) as nodes in the graph, and the interactions between entities (such as network connections, file access, process communication) are represented as edges.
[0102] Step 2: Update the graph structure: Dynamically update the nodes and edges in the graph based on the new data.
[0103] Updating the graph structure is a dynamic process that requires adjusting the nodes and edges in the graph based on new data collected in real time. For example, when a new network connection is detected, a new edge is added to the graph G and associated with the corresponding node. If an entity stops being active or is removed, the corresponding node or edge is also deleted from the graph. This process ensures that the graph structure G always reflects the latest network status and provides an accurate data basis for subsequent analysis and detection.
[0104] Step 3: Anomaly detection: Anomaly detection is another important part of network security. It relies on the analysis of the behavior feature vectors h_v and h_e of nodes and edges in the graph structure G. The behavior feature vector of each node and edge contains multiple attributes, such as the number of connections, access frequency, amount of data transmitted, etc. By real-time monitoring and analysis of these features, a baseline model of normal behavior can be established.
[0105]
[0106] If D v Exceeds the preset threshold T v , then the node v is considered abnormal.
[0107] Baseline models are usually built using statistical methods, calculating the mean and standard deviation of each feature by analyzing historical data. When network behavior deviates significantly from the normal baseline, it may indicate abnormal or malicious behavior. The anomaly detection system calculates the distance between the new behavior feature vector and the normal baseline. This distance can be measured by a variety of mathematical methods, such as Euclidean distance, Manhattan distance, or cosine similarity.
[0108] Once the detected distance exceeds the preset threshold, the system will mark the behavior as suspicious and conduct further analysis. This may involve deeper data mining, behavioral pattern recognition, or manual review. If the behavior is confirmed to be abnormal, the system will trigger security response measures, such as isolating infected devices, blocking suspicious network connections, changing permission settings, or generating alarm notifications.
[0109] This APT detection method based on graph theory and statistical methods builds and analyzes graph structures and uses statistical models to detect abnormal behaviors, thereby achieving efficient detection and response to complex APT attacks. This method does not rely on deep learning models, but can make full use of the rich relationship information in network and system logs to effectively respond to advanced persistent threats.
Claims
1. A method for detecting APT attacks based on graph theory and statistical methods, characterized in that: The steps are as follows: S1. Data collection and graph construction S1.
1. Collect data: Collect network traffic data and system logs; Network traffic data includes source IP, destination IP, port, protocol, connection duration, and data transmission volume; System logs include process startup, file access, user login, and permission changes; S1.
2. Build graph structure: The collected data is transformed into a graph where: Node set V: Each node represents a system entity; Edge set E: Each edge represents the interaction between system entities; Node type: host, user, process, file; Edge type: network connection, file access, process communication; S2. Feature extraction and graph theory analysis S2.
1. Extract node features: For each node v∈V, extract the feature vector h v =[h v1 ,h v2 ,…,h vd ], features include: Host node: number of connections, number of unique IPs connected, amount of data transferred; User node: number of logins, number of files accessed, number of processes started; Process node: number of starts, number of files accessed, number of networks connected; File node: number of accesses, number of users who accessed, number of modifications; S2.
2. Extract edge features: For each edge e∈E, extract the feature vector h e =[h e1 ,h e2 ,…,h em ], features include: Network connection side: connection frequency, data transmission volume, connection duration; File access edge: access frequency, access duration, access mode; Process communication edge: communication frequency, communication data volume, and communication duration; S2.
3. Graph Theory Analysis: Use graph theory methods to analyze graph structural characteristics Degree: The degree d(v) of a node v represents the number of edges connected to the node v; Where A is the adjacency matrix of the graph, A vu =1 means there is an edge between nodes v and u; Clustering coefficient: The clustering coefficient C(v) of a node v indicates the density of connections between its neighbors; Where E(v) is the number of edges between neighbors of node v; Connected component: the number of connected subgraphs in a graph, that is, the largest subgraph in which every node in the graph can reach other nodes through edges; Centrality: The importance of node v in the graph. Centrality indicators further include: Betweenness centrality: the frequency of occurrence of node v in all shortest paths Among them, σ st is the number of shortest paths between nodes s and t, σ st (v) is the number of shortest paths passing through node v; Degree centrality: The degree of node v, which indicates the number of nodes it is directly connected to; D(v)=d(v) S3. Anomaly detection model training S3.
1. Calculate feature distribution: For normal behavior data, calculate each feature h ji The mean μ i and standard deviation σ i Where N is the number of samples of normal behavior data, h ji is the i-th eigenvalue of the j-th sample; S3.
2. Establish a baseline of normal behavior; S3.
3. Calculate the anomaly score: For the new behavior feature vector h v , and calculate its distance from the normal behavior baseline: Among them, μ i and σ i are the mean and standard deviation of the i-th feature, and d is the feature dimension; Among them, the feature h v Including degree d(v), clustering coefficient C(v), betweenness centrality B(v) and other characteristics; Set the threshold T v , when D v When the threshold is exceeded, the node v is considered abnormal; S4. Continue to collect network traffic data and system logs and update the graph structure.
Citation Information
Cited By
API abnormal access detection and encryption protection method based on behavior analysis
CN119906582A
