APT attack tracing method and system based on log graph representation method
Through the method based on log graph representation, a traceability map is constructed and APT attack characteristics are identified using graph matching technology, which solves the problem of traceability of complex APT attacks, and efficient and accurate attack behavior tracking and organizational identity recognition are achieved, which significantly improves network security protection capabilities.
Patent Information
- Application Number
- CN202411093393.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-09
- Publication Date
- 2024-11-29
- Estimated Expiration
- 2044-08-09
AI Technical Summary
It is difficult for the existing technology to effectively trace complex APT attacks, especially in the face of massive log data, encrypted traffic and high-tech attackers, traditional methods are difficult to identify attack characteristics and organizational identity, resulting in untimely detection and incomplete traceability.
Using a method based on log graph representation, we use graph matching technology and pruning strategies to trace the source map and organize identity identification of APT attacks by constructing traceability maps, extracting attack feature map sample libraries, performing exception detection and matching algorithms.
It improves the accuracy and efficiency of traceability of APT attacks, can comprehensively analyze attack behavior, quickly locate attack paths and key nodes, identify attack organization characteristics, and provide accurate organizational identity identification, which significantly improves network security protection capabilities.
Smart Images

Figure CN119051923A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer security, and in particular to an APT attack tracing method and system based on a log graph representation method. Background Art
[0002] Advanced persistent threat (APT) attacks are complex and long-term cyber attacks that are highly concealed and destructive. They are usually launched by organized attackers with the goal of stealing sensitive information, destroying critical infrastructure, or causing serious economic losses. The uniqueness of APT attacks lies in their persistence and targeting. Attackers will lurk in the target network for months or even years, gradually advancing through carefully designed attack chains and ultimately achieving their attack objectives. APT attacks are extremely harmful and often target key areas such as government agencies, financial institutions, and the energy sector. They can steal a large amount of sensitive information and endanger national security and economic interests.
[0003] Attackers usually adopt multi-stage and multi-level attack strategies, and each step may involve different attack methods and technologies, which increases the complexity of tracing. Attackers also use various technical means to hide their activity traces, such as encrypted communications, disguised network traffic, and log deletion, making it difficult for traditional tracing methods to effectively track. In addition, APT attackers usually have high-level technical capabilities and abundant resources, and can continuously fight and evade security protection measures, further increasing the difficulty of tracing. Existing tracing methods mainly include log analysis, traffic analysis, and behavioral analysis, but these methods often seem powerless when facing complex APT attacks. Log analysis requires processing massive amounts of data, and logs are easily tampered with or deleted; traffic analysis is difficult to identify malicious activities in encrypted traffic; behavioral analysis is difficult to distinguish APT attacks from normal operations. Summary of the invention
[0004] In view of the problems in the prior art of difficulty in identifying APT (advanced persistent threat) attacks, complex log processing, difficulty in learning the temporal correlation between data, high attack concealment leading to untimely detection, and inability to fully trace the entire event chain, the present invention provides an APT attack tracing method based on a log graph representation method, which can review and detect APT attack behaviors, identify APT attack features, and find the organizational features behind different APT events.
[0005] The present invention is achieved through the following technical solutions:
[0006] A method for tracing the source of an APT attack based on a log graph representation method comprises the following steps:
[0007] Step 1: Build a traceability graph based on the public attack logs of the attack event;
[0008] Step 2: Extract APT tracing graphs with attack characteristics based on the tracing graphs, and build an APT tracing graph sample library based on the APT tracing graphs with attack characteristics;
[0009] Step 3: Perform anomaly detection on the log data before and after the time period when the attack behavior corresponding to the APT tracing diagram with attack characteristics is generated, extract nodes that have set differences from normal logs, classify the statistical data corresponding to all nodes according to the attack organization, obtain the behavior characteristics of the APT attack organization, and build a behavior characteristic sample library based on the behavior characteristics of the APT attack organization;
[0010] Step 4: Obtain an APT source tracing graph with attack characteristics of the abnormal log to be detected according to the methods of steps 1 and 2, match the APT source tracing graph with attack characteristics with each sample in the APT source tracing graph sample library, determine whether the abnormal log is an attack behavior based on the matching result, and identify the organizational identity of the APT attack based on the feature sample library.
[0011] Preferably, in step 1, a traceability graph is constructed by analyzing the temporal relationship of the attack behavior based on the public attack logs.
[0012] Preferably, the method for determining the timing relationship is as follows:
[0013] The public attack logs are converted into corresponding graph representations through the Camflow tool, and the temporal connections between various attack behaviors are determined based on the graph representations.
[0014] Preferably, the method for extracting the APT source tracing graph with attack characteristics in step 2 is as follows:
[0015] According to the whitelist behavior, the edges in the traceability graph that are completely unrelated to the attack node are deleted to generate isolated subgraphs and / or isolated nodes. The isolated nodes are removed and the isolated subgraphs are connected according to the access IP and timing relationship to obtain an APT traceability graph with attack characteristics.
[0016] Preferably, the isolated subgraphs are connected according to the access IP and timing relationship to obtain an APT source tracing graph with attack characteristics, including:
[0017] Create a head node for the time segment of each isolated subgraph, and assign head node attributes with IP and timing. Add directed edges to the head nodes with the same IP according to the timing relationship, connect the isolated subgraphs corresponding to the same IP, and obtain an APT tracing graph with attack characteristics.
[0018] Preferably, in step 4, a matching algorithm is used to match the APT source tracing graph with attack characteristics of the abnormal log with each sample in the APT source tracing graph sample library.
[0019] Preferably, the matching algorithm is a VF2 subgraph isomorphism matching algorithm.
[0020] Preferably, when a corresponding sample is matched in step 4, the abnormal log is an attack behavior, and the attack node path of the abnormal log is located to complete the tracing of the APT attack.
[0021] Preferably, the method for identifying the identity of the organization of the APT attack according to the feature sample library in step 4 is as follows:
[0022] The log data before and after the attack behavior corresponding to the node path is compared with the behavioral characteristics of the APT attack organization to identify the organization that carried out the APT attack.
[0023] A system for tracing the source of an APT attack based on a log graph representation method, comprising:
[0024] The collection module is used to build a traceability graph based on the public attack logs of attack events;
[0025] The source tracing graph module is used to extract the APT source tracing graph with attack characteristics according to the source tracing graph, and build an APT source tracing graph sample library according to the APT source tracing graph with attack characteristics;
[0026] The feature sample module is used to perform anomaly detection based on the log data before and after the time period when the attack behavior corresponding to the APT tracing diagram with attack characteristics is generated, extract the nodes that have set differences from the normal logs, classify the statistical data corresponding to all nodes according to the attack organization, obtain the behavior characteristics of the APT attack organization, and build a behavior characteristic sample library based on the behavior characteristics of the APT attack organization;
[0027] The identification module is used to obtain the APT source tracing graph with attack characteristics of the abnormal log to be detected, match the APT source tracing graph with attack characteristics with each sample in the APT source tracing graph sample library, determine whether the abnormal log is an attack behavior based on the matching result, and identify the organizational identity of the APT attack based on the feature sample library.
[0028] Compared with the prior art, the present invention has the following beneficial technical effects:
[0029] The present invention provides an APT attack tracing method based on a log graph representation method. The method converts the APT attack log data into a graph representation, solves the problem that there is no direct behavior relationship in the log template data, can display the temporal connection between various behaviors, and realizes a comprehensive analysis and review of the attack behavior. Secondly, the method solves the problem of the infeasibility of large-scale graph matching calculations through graph matching technology and pruning strategies, effectively reduces the computational complexity, and ensures the feasibility and efficiency of the matching process. The system accurately matches the attack behavior on the layer plane, and uses the VF2 subgraph isomorphism algorithm to efficiently identify known attack patterns, quickly locate attack paths and key nodes. By performing statistical analysis on the extracted APT attack features, it is not only possible to detect and trace the APT attack, but also to identify the organizational characteristics of the attack, and provide accurate organizational identity. In summary, the present invention significantly improves the accuracy and efficiency of APT attack tracing, and provides strong technical support for network security protection. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 This is a flowchart of the APT source tracing graph extraction and attack detection of the present invention;
[0031] Figure 2 This is an example diagram of the APT traceability graph pruning solution of the present invention;
[0032] Figure 3 The graph matching process for detecting APT attacks in the present invention;
[0033] Figure 4 This is a performance comparison between this solution and other existing solutions in APT tracing. DETAILED DESCRIPTION
[0034] The present invention will be further described in detail below in conjunction with the accompanying drawings, which are intended to explain the present invention rather than to limit it.
[0035] A method and system for tracing the source of an APT attack based on a log graph representation method, the specific steps are as follows:
[0036] Step 1: Obtain the public attack logs of the attack events, determine the time sequence of the attack behaviors analyzed in the public attack logs, and construct a traceability graph based on the time sequence.
[0037] Collect public attack logs of various attack events, and convert the log data into corresponding graph representations through the CamFlow tool to show the temporal connections between various attack behaviors and build a traceability graph based on the temporal connections.
[0038] Step 2: Extract APT tracing graphs with attack characteristics based on the tracing graphs, and build an APT tracing graph sample library based on the APT tracing graphs with attack characteristics. The specific method is as follows:
[0039] S2.1. Set a whitelist behavior, delete the edges in the traceability graph that are completely unrelated to the attack node according to the whitelist behavior, and generate isolated subgraphs and / or isolated nodes;
[0040] S2.2. Remove isolated nodes to eliminate the interference of normal access behavior on graph data.
[0041] S2.3. Connect the isolated subgraphs according to the access IP and timing relationship to obtain an APT tracing graph with attack characteristics. The method is as follows:
[0042] Create a head node for the time segment of each isolated subgraph, and assign head node attributes with IP and timing. Add directed edges to the head nodes with the same IP according to the timing relationship, connect the isolated subgraphs corresponding to the same IP, and obtain an APT tracing graph with attack characteristics.
[0043] S2.4. The extracted APT source tracing graphs with attack features are stored in the APT source tracing graph sample library.
[0044] Step 3: Perform anomaly detection on the log data before and after the time period when the attack behavior corresponding to the APT tracing diagram with attack characteristics is generated, extract nodes that have set differences from normal logs, classify the statistical data corresponding to all nodes according to the attack organization, obtain the behavioral characteristics of the APT attack organization, and build a behavioral characteristic sample library based on the behavioral characteristics of the APT attack organization.
[0045] Step 4: Obtain an APT source tracing graph with attack characteristics of the abnormal log to be detected according to the methods of steps 1 and 2, match the APT source tracing graph with attack characteristics with each sample in the APT source tracing graph sample library, and determine whether the abnormal log is an attack behavior based on the matching result.
[0046] A matching algorithm is used to match the APT source tracing graph with attack characteristics in the abnormal log with each sample in the APT source tracing graph sample library.
[0047] In this embodiment, the VF2 subgraph isomorphic matching algorithm is used to match the APT source tracing graph with attack characteristics of the abnormal log to be detected with the sample in the database. When the corresponding sample is matched, the abnormal log is an attack behavior, and the attack node path of the abnormal log is located to complete the tracing of the APT attack.
[0048] The log data before and after the attack behavior corresponding to the node path is compared with the behavioral characteristics of the APT attack organization to identify the organization that carried out the APT attack.
[0049] Example 1
[0050] A method and system for tracing the source of an APT attack based on a log graph representation method, the specific steps are as follows:
[0051] Step 1: Collect attack event logs. Collect public attack logs of various attack events and convert the log data into corresponding graph representations GGG through the calmflow tool to show the temporal connections between various behaviors and build a traceability graph based on the temporal connections.
[0052] The nodes V in the graph representation G represent attack events, and the edges E represent the relationship between events. For example, suppose the log data includes the following lines:
[0053] 2023-07-01 12:00:00,IP:192.168.0.1,Action:Login
[0054] 2023-07-01 12:05:00,IP:192.168.0.1,Action:File Access
[0055] 2023-07-01 12:10:00,IP:192.168.0.2,Action:Login
[0056] 2023-07-01 12:15:00,IP:192.168.0.1,Action:Data Transfer
[0057] Through the calmflow tool, these log data are converted into the following graph representation:
[0058] Node set V = {v1,v2,v3,v4}
[0059] Edge set E = {(v1, v2), (v2, v3), (v3, v4)}, where nodes represent specific log events and edges represent the temporal relationship between events.
[0060] Step 2: Extract the APT source map with attack characteristics based on the source map. Figure 2 , the specific steps are as follows:
[0061] Eliminate irrelevant edges and nodes: Remove all edges and nodes from graph G that are not in the edge set of query graph Q, such as Figure 2(b). Assume that the initial graph G contains the node set V = {v1, v2, v3, v4} and the edge set E = {(v1, v2), (v2, v3), (v3, v4), and the query graph Q contains the node set VQ = {v1, v2, v3} and the edge set EQ = {(v1, v2), (v2, v3)}. By the formula E′ = E∩EQ, we get the optimized edge set E′ = {(v1, v2), (v2, v3) and node set V′ = {v1, v2, v3}.
[0062] Cut off isolated nodes, such as Figure 2 (c): Based on V′ and E′ obtained in the previous step, assuming V′={v1,v2,v3,v5} and E′={(v1,v2),(v2,v3)}, the isolated node v5 will be removed, and V″={v1,v2,v3} will be obtained.
[0063] Connecting isolated subgraphs: Connecting isolated subgraphs based on access IP and timing relationships, such as Figure 2 (d). For example, for each time segment ti, create a head node Hi and connect it to Vti. Assume t1 contains v1 and v2, and t2 contains v3, then create head nodes H1 and H2 and connect them to v1, v2 and v3 respectively. The final graph is represented by V = {H1, H2, v1, v2, v3} and E = {(H1, v1), (H1, v2), (H2, v3)}.
[0064] Step 3: Extract the collected APT attack log data with organizational characteristics in step 2, perform anomaly detection on the log data before and after the time period when the main attack behavior occurs, compare the differences between each behavior, statistically analyze the attack characteristics of a certain organization, and extract the identity of the organization.
[0065] Anomaly detection: Perform anomaly detection on log data D within the time window W. For example, set the time window to 5 minutes and detect abnormal behaviors within the window. For example, use the Bayesian inference algorithm to calculate the probability of the behavior and identify abnormal behaviors.
[0066] P(A|B)=P(B|A)·P(A)P(B)
[0067] Feature extraction: Perform statistical analysis on the detection results R and extract tissue features F.
[0068] F = Statistical analysis (R)
[0069] Identity: Extract feature identification anomaly detection model ID from feature F.
[0070] ID = Extract Identity (F)
[0071] Step 4: Abnormal log detection and matching. Perform steps 1 and 2 on the abnormal logs to be detected, and perform VF2 subgraph isomorphism matching algorithm on the obtained graph G′ and the graph Q in the sample library. The effect is as follows: Figure 3 .
[0072] Subgraph isomorphism matching: Use the VF2 algorithm to match the graph G′ and the query graph Q. The specific steps of the VF2 algorithm are as follows:
[0073] Initialization state Recursively expand state Si until a complete match M is found
[0074] Where Si represents the matching status and M represents the complete matching result. The matching conditions are:
[0075] Make label (u) = label (u′) and label (v) = label (v′) Match result analysis: If the match is successful, the node path P related to the attack is located.
[0076] P={(u′,v′)∈G′|(u,v)∈Q satisfies the matching condition}
[0077] Attack tracing and organization identification: Restore the extracted graph to the log tracing base map, perform statistical analysis on the data in the corresponding time window, and compare it with the organization identity recognition model ID extracted in step 3 to identify the organization that carried out the APT attack.
[0078] Identify tissue O = compare (ID, P)
[0079] Example 2
[0080] An APT attack tracing system based on a log graph representation method includes:
[0081] The collection module is used to build a traceability graph based on the public attack logs of attack events;
[0082] The source tracing graph module is used to extract the APT source tracing graph with attack characteristics according to the source tracing graph, and build an APT source tracing graph sample library according to the APT source tracing graph with attack characteristics;
[0083] The feature sample module is used to perform anomaly detection based on the log data before and after the time period when the attack behavior corresponding to the APT tracing diagram with attack characteristics is generated, extract the nodes that have set differences from the normal logs, classify the statistical data corresponding to all nodes according to the attack organization, obtain the behavior characteristics of the APT attack organization, and build a behavior characteristic sample library based on the behavior characteristics of the APT attack organization;
[0084] The identification module is used to obtain the APT source tracing graph with attack characteristics of the abnormal log to be detected, match the APT source tracing graph with attack characteristics with each sample in the APT source tracing graph sample library, determine whether the abnormal log is an attack behavior based on the matching result, and identify the organizational identity of the APT attack based on the feature sample library.
[0085] The present invention solves the problem of infeasible large-scale graph matching calculations in APT attack tracing by introducing graph representation and graph matching strategies, and significantly improves the efficiency of APT attack detection and tracing. By using Bayesian reasoning for anomaly detection, it is possible to accurately identify abnormal behaviors in log data, and comprehensively review the attack process through graph operation methods to achieve fine tracking at the node level. Combined with the subgraph isomorphism matching of the VF2 algorithm, the present invention can efficiently identify known attack patterns, quickly locate attack paths and key nodes, and accurately identify APT attack organizations through the extracted organizational features through statistical analysis. The present invention has good scalability and adaptability in large-scale network environments, and provides strong technical support for network security protection.
[0086] Compared with the prior art, the APT attack tracing method based on graph operation of the present invention has significant advantages. The graph representation method can comprehensively review the overall attack process. By constructing an APT tracing graph, each event in the attack chain is used as a node, and the causal relationship between events is used as an edge to form an overall graph structure. This graph structure can intuitively display the attacker's action path and strategy, helping security analysts to fully understand the attack process. The graph operation method can also achieve node-level tracking. By performing fine-grained operations and analysis on the graph, key nodes and events in the attack chain can be accurately located, such as the initial intrusion point, privilege escalation operation, and lateral movement path. Graph matching technology can efficiently identify known attack patterns. By matching known attack patterns through graph isomorphism algorithms, potential attack paths and steps can be quickly identified. Combined with pruning strategies, the matching process is optimized, the computational complexity is reduced, and the matching efficiency is improved. In addition, the graph operation method also has good scalability and adaptability. Whether facing complex attack chains or large-scale network environments, graph representation and matching technologies can effectively process large amounts of data and complex relationships, and provide efficient and reliable tracing results. By applying the mature graph operations and pruning strategies in CPG (Code Property Graph) to the APT traceability graph, the APT attack path can be efficiently identified and tracked in a large-scale network environment. This method not only improves the efficiency and accuracy of APT attack traceability, but also comprehensively reviews the attack process and achieves node-level fine tracking, providing strong support for network security protection.
[0087] The above contents are only for explaining the technical idea of the present invention and cannot be used to limit the protection scope of the present invention. Any changes made on the basis of the technical solution in accordance with the technical idea proposed by the present invention shall fall within the protection scope of the claims of the present invention.
Claims
1. A method for tracing the source of an APT attack based on a log graph representation method, characterized in that: The following steps are involved: Step 1: Build a traceability graph based on the public attack logs of the attack event; Step 2: Extract APT tracing graphs with attack characteristics based on the tracing graphs, and build an APT tracing graph sample library based on the APT tracing graphs with attack characteristics; Step 3: Perform anomaly detection on the log data before and after the time period when the attack behavior corresponding to the APT traceability diagram with attack characteristics occurs. Nodes with set differences from normal logs are extracted. The statistical data corresponding to all nodes are classified according to the attack organization to obtain the behavioral characteristics of the APT attack organization. A behavioral characteristic sample library is constructed based on the behavioral characteristics of the APT attack organization. Step 4: Obtain an APT traceability graph with attack characteristics for the abnormal log to be detected according to the methods of steps 1 and 2, match the APT traceability graph with attack characteristics with each sample in the APT traceability graph sample library, determine whether the abnormal log is an attack behavior based on the matching result, and identify the organizational identity of the APT attack based on the feature sample library.
2. The APT attack tracing method based on the log graph representation method according to claim 1 is characterized in that: In step 1, the temporal relationship of the attack behavior is analyzed based on the public attack logs to construct a traceability graph.
3. The APT attack tracing method based on log graph representation method according to claim 2 is characterized in that: The method for determining the timing relationship is as follows: The public attack logs are converted into corresponding graph representations using the CamFlow tool, and the temporal connections between various attack behaviors are determined based on the graph representations.
4. The APT attack tracing method based on log graph representation method according to claim 1 is characterized in that: The method for extracting the APT source traceability graph with attack characteristics described in step 2 is as follows: According to the whitelist behavior, the edges in the traceability graph that are completely unrelated to the attack node are deleted to generate isolated subgraphs and / or isolated nodes. The isolated nodes are removed and the isolated subgraphs are connected according to the access IP and timing relationship to obtain an APT traceability graph with attack characteristics.
5. The APT attack tracing method based on the log graph representation method according to claim 4 is characterized in that: Connect the isolated subgraphs based on the access IP and timing relationships to obtain an APT traceability graph with attack characteristics, including: Create a head node for the time segment of each isolated subgraph, and assign the head node attributes with IP and time sequence. Add directed edges to the head nodes with the same IP according to the time sequence relationship, so that the isolated subgraphs corresponding to the same IP are connected to obtain an APT tracing graph with attack characteristics.
6. The APT attack tracing method based on log graph representation method according to claim 1 is characterized in that: In step 4, a matching algorithm is used to match the APT source tracing graph with attack characteristics in the abnormal log with each sample in the APT source tracing graph sample library.
7. The APT attack tracing method based on log graph representation method according to claim 6 is characterized in that: The matching algorithm is a VF2 subgraph isomorphism matching algorithm.
8. The APT attack tracing method based on the log graph representation method according to claim 1 or 7, characterized in that: In step 4, when the corresponding sample is matched, the abnormal log is an attack behavior, and the attack node path of the abnormal log is located to complete the tracing of the APT attack.
9. The APT attack tracing method based on log graph representation method according to claim 8 is characterized in that: The method for identifying the organization behind the APT attack based on the signature sample library in step 4 is as follows: The log data before and after the attack behavior corresponding to the node path is compared with the behavioral characteristics of the APT attack organization to identify the organization that carried out the APT attack.
10. A system for executing the APT attack tracing method based on the log graph representation method according to any one of claims 1 to 9, characterized in that: include: The collection module is used to build a traceability map based on the public attack logs of attack events; The source tracing graph module is used to extract APT source tracing graphs with attack characteristics based on the source tracing graph, and build an APT source tracing graph sample library based on the APT source tracing graphs with attack characteristics; The feature sample module is used to perform anomaly detection based on the log data before and after the time period of the attack behavior corresponding to the APT traceability diagram with attack characteristics, extract nodes that have set differences from normal logs, classify the statistical data corresponding to all nodes according to the attack organization, obtain the behavioral characteristics of the APT attack organization, and build a behavioral feature sample library based on the behavioral characteristics of the APT attack organization; The identification module is used to obtain an APT traceability graph with attack characteristics of the abnormal log to be detected, match the APT traceability graph with attack characteristics with each sample in the APT traceability graph sample library, determine whether the abnormal log is an attack behavior based on the matching result, and identify the organizational identity of the APT attack based on the feature sample library.
Citation Information
Patent Citations
Unsupervised host intrusion detection method and system
CN114741688A
Unsupervised APT attack detection method and system based on abnormal node identification
CN115270954A
APT attack sequence detection method based on subgraph matching
CN115473667A
APT attack detection method and device based on traceability graph path
CN117792775A
Beacon and threat intelligence based apt detection
US20240039893A1
Cited By
Heuristic APT attack tracing method based on flow detection and attack graph
CN120602118A
Mail system advanced threat tracing and detection method and system based on dynamic attribute graph
CN121814439A
