Traffic lateral movement attack detection method and system based on heterogeneous graph
Through heterogeneous graph construction and meta-path analysis, lateral movement attacks are identified and processed, solving the problem of inaccurate identification in existing technologies, achieving high accuracy and reliability of lateral movement attack detection, and dynamically managing industrial IoT traffic.
Patent Information
- Application Number
- CN202410908348.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-08
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2044-07-08
AI Technical Summary
Existing technologies fail to fully utilize heterogeneous graph information in lateral movement attack detection, resulting in inaccurate recognition results and a lack of effective solutions.
The heterogeneous graph construction method is used to obtain communication traffic through the policy dynamic generation module, the metapath2vec++ algorithm is used to construct the meta-path, random walk is used to obtain the node sequence, the Skip-Gram model is input to generate the node embedding vector, and the unsupervised autoencoder model is used to identify unknown lateral directions. Mobile behavior and generate network isolation policies.
It improves the accuracy and reliability of lateral movement attack identification, dynamically generates micro-isolation strategies, realizes the management and control of industrial IoT intranet traffic, and promptly detects and processes abnormal traffic.
Smart Images

Figure 00000000_0000
Abstract
Description
Technical Field
[0001] The present invention relates to the field of network security technology, and in particular to a method, system, electronic device and readable storage medium for detecting traffic lateral movement attacks based on a heterogeneous graph. Background Art
[0002] Advanced persistent threat (APT) attacks are characterized by complex processes, long duration, high concealment, and strong destructiveness, which seriously threaten the interests of organizations and the privacy of individual users. The APT life cycle includes six stages: intelligence reconnaissance and attack tool construction, attack tool delivery and initial intrusion, command and control (C&C) communication, lateral movement, network asset and data discovery, and the final attack target. Among them, lateral movement is the key for attackers to penetrate into the network, expand the scope of threats, and achieve the final attack goal. Accurately detecting and blocking lateral movement behavior can effectively defend against APT attacks and prevent major security incidents and economic losses.
[0003] In the prior art, it is proposed to use graph technology to jump between different data tables when detecting lateral movement attacks, which greatly reduces the efficiency of obtaining data association relationships. There are also graph neural network technologies used for lateral movement attack detection and identification, but the graph neural network constructed by this method only uses isomorphic graph data, that is, the association relationship between nodes of the same type, and does not fully utilize heterogeneous graph information containing multiple association relationships, that is, it does not fully utilize the mutual association relationship between different types of data for different lateral movement attack detection, resulting in inaccurate recognition results.
[0004] There is currently no effective solution to the problem of inaccurate identification of lateral movement attacks in the prior art. Summary of the invention
[0005] The purpose of this application is to provide a traffic lateral movement attack detection method, system, electronic device and computer-readable storage medium based on a heterogeneous graph, which can improve the accuracy and reliability of lateral movement attack identification without increasing system costs.
[0006] To achieve the above objectives:
[0007] In a first aspect, an embodiment of the present application provides a method for detecting traffic lateral movement attacks of a heterogeneous graph, the method comprising: step S1, obtaining the communication traffic between micro-isolated security domains through a traffic capturer in a policy dynamic generation module; step S2, the traffic capturer stores the communication traffic in an asynchronous processing manner to obtain a communication traffic data set; step S3, constructing a traffic scenario heterogeneous graph G= based on the traffic data set <V,E,T V , T E >, where V represents a node, E represents an edge between nodes, and T V, T E Respectively represent the node type and the edge type between nodes; step S4, in the heterogeneous graph, construct a meta-path between nodes of different types based on the metapath2vec++ algorithm; step S5, perform a random walk on the meta-path to obtain a random walk path, obtain a corresponding random walk node sequence based on the random walk path, and input the random walk node sequence into the Skip-Gram model to obtain the embedding vector of the node in the heterogeneous graph; step S6, input the embedding vector of the node generated by the Skip-Gram model into the unsupervised autoencoder model; the unsupervised autoencoder model outputs the embedding vector of the reconstructed node; use a predetermined reconstruction error function to calculate the reconstruction error between the embedding vector of the reconstructed node and the embedding vector of the node generated by the Skip-Gram model, and identify unknown lateral movement based on the reconstruction error; step S7, after the server identifies the unknown lateral movement behavior, it generates a network isolation policy and sends the network isolation policy to the administrator, the administrator decides whether to cut off the line, and sends the final policy to the llot gateway device.
[0008] Preferably, step S1 includes: processing network data packets through Python's third-party library Scapy to obtain communication traffic between micro-isolation security domains; the traffic filtering conditions used in the process of obtaining communication traffic are set according to the computer, user, login, logout, process creation, file creation, event attributes, protocols, and ports.
[0009] Preferably, the traffic scenario heterogeneous graph G is constructed based on the traffic data set. <V,E,T V , T E >, including:
[0010] The abnormal traffic detector in the strategy dynamic generation module mines the traffic data set at different time intervals to perform traffic detection and obtain the traffic time series graph; the points and edges in the traffic time series graph are represented to obtain the traffic scene heterogeneous graph G= <V,E,T V ,T E >.
[0011] Preferably, the construction of a metapath between nodes of different types based on the selection of a three-dimensional metapath2vec++ algorithm includes: the metapath is defined as follows: Where V1, V2, ..., V l Refers to the node type, R1, R2, ..., R l-1 It refers to node transfer. Represents a composite operation of a relation, where l is an integer greater than 1.
[0012] Preferably, the probability of node transfer is As shown in the following formula:
[0013]
[0014] Among them, p is the set of meta-paths, E is the link edge, represents the i-th node of the t-th type, v i represents the i-th node, Refers to the node V t-1 Type of neighboring nodes.
[0015] Preferably, inputting the random walk node sequence into the Skip-Gram model to obtain the embedding vector of the node in the heterogeneous graph includes: inputting the random walk node sequence into the Skip-Gram model to maximize the probability of the existence of the surrounding nodes of the node, and the probability maximization function is:
[0016]
[0017] Among them, V represents node combination, T V Represents a set of node types, N t (v) refers to the t-th type of node among the neighboring nodes of node v, P(c t |v; θ) is the softmax function, θ is the parameter of the model, specifically:
[0018]
[0019] Among them, X v represents the embedding vector of node v, Represents node c t The embedding vector of the meta-path around the node, Indicates the uth t The embedding vectors of the node types, It means traversing all nodes of the tth type, and the output of the Skip-Gram model is the embedding vector of the node.
[0020] Preferably, step S6 includes: inputting the embedding vector of the node generated by the Skip-Gram model into the unsupervised autoencoder model; the unsupervised autoencoder model outputs the embedding vector of the reconstructed node; using a predetermined reconstruction error function to calculate the reconstruction error between the embedding vector of the reconstructed node and the embedding vector of the node generated by the Skip-Gram model, and identifying unknown lateral movement according to the reconstruction error. Specifically, the reconstruction error value is compared with a preset threshold value, and if the reconstruction error is greater than the preset threshold value, it is determined that an unknown lateral movement attack exists, wherein the predetermined reconstruction error function includes: either a mean square error function or a mean absolute error function.
[0021] Among them, Mean Squared Error (MSE): in and Represents the value of the i-th dimension of the embedding vector of the starting and ending nodes respectively, and d is the dimension of the embedding vector. Mean Absolute Error (MAE): same, and Represents the value of the i-th dimension of the embedding vector of the starting and ending nodes respectively. These reconstruction error metrics can be used to evaluate the quality of path representation. The smaller the reconstruction error, the more similar the embedding vectors of the starting and ending nodes are, reflecting the close relationship between the nodes on the path.
[0022] In a second aspect, an embodiment of the present application provides a heterogeneous graph traffic lateral movement attack detection system, the system comprising: a communication traffic capture module, which obtains the communication traffic between micro-isolated security domains through a traffic capturer in a policy dynamic generation module; a communication traffic storage module, the traffic capturer stores the communication traffic in an asynchronous processing manner to obtain a communication traffic data set; a heterogeneous graph construction module, which constructs a traffic scenario heterogeneous graph G= based on the traffic data set <V,E,T V ,T E >, where V represents a node, E represents an edge between nodes, and T V , T ERespectively represent the node type and the edge type between nodes; a meta-path construction module, in the heterogeneous graph, constructs a meta-path between nodes of different types based on the metapath2vec++ algorithm; an embedding vector generation module, performs a random walk on the meta-path to obtain a random walk path, obtains a corresponding random walk node sequence based on the random walk path, and inputs the random walk node sequence into the Skip-Gram model to obtain the embedding vector of the node in the heterogeneous graph; an unknown lateral movement identification module, inputs the embedding vector of the node generated by the Skip-Gram model into the unsupervised autoencoder model; the unsupervised autoencoder model outputs the embedding vector of the reconstructed node; a predetermined reconstruction error function is used to calculate the reconstruction error between the embedding vector of the reconstructed node and the embedding vector of the node generated by the Skip-Gram model, and identifies unknown lateral movement based on the reconstruction error; a manual judgment module, after the server identifies the unknown lateral movement behavior, generates a network isolation policy, and sends the network isolation policy to the administrator, the administrator decides whether to cut off the line, and sends the final policy to the llot gateway device.
[0023] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor and a memory storing a computer program; when the processor executes the computer program, the steps of the fault diagnosis method of the above-mentioned engineering machinery control system are implemented.
[0024] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the fault diagnosis method of the above-mentioned engineering machinery control system is implemented.
[0025] The above-mentioned heterogeneous graph-based traffic lateral movement attack detection method, system, electronic device and computer-readable storage medium construct a heterogeneous graph for the communication traffic between micro-isolated security domains to obtain multi-type relationships of internal network nodes, then use the metapath2vec++ algorithm to construct a meta-path, perform a random walk on the meta-path to obtain a random walk path, obtain a corresponding random walk node sequence based on the random walk path, and input the random walk node sequence into the Skip-Gram model to obtain the embedding vector of the node in the heterogeneous graph; the embedding vector of the node generated by the Skip-Gram model is input into the unsupervised autoencoder model; the unsupervised autoencoder model outputs the embedding vector of the reconstructed node; a predetermined reconstruction error function is used to calculate the reconstruction error between the embedding vector of the reconstructed node and the embedding vector of the node generated by the Skip-Gram model, and unknown lateral movement is identified according to the reconstruction error; after the server identifies the unknown lateral movement behavior, a network isolation policy is generated, and the network isolation policy is sent to the administrator end, the administrator end decides whether to cut off the line, and sends the final policy to the llot gateway device.
[0026] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0027] By adopting heterogeneous graph construction, the path detection module learns and feedback-adjusts different paths to better determine abnormal traffic, thereby achieving the purpose of dynamically generating micro-isolation strategies.
[0028] By adopting the management and control cloud platform, the policy manager module and the policy execution module can visualize and execute the micro-isolation policy, thereby realizing the management and control of the intranet traffic in the industrial Internet of Things, so as to achieve the purpose of timely discovering the lateral movement path of the traffic and making judgments. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 A schematic diagram of a flow chart of a method for detecting a traffic lateral movement attack based on a heterogeneous graph provided in an embodiment of the present invention;
[0030] Figure 2 This is a schematic diagram of the overall architecture of the solution;
[0031] Figure 3 A structural schematic diagram of a lateral movement schematic diagram;
[0032] Figure 4 Another example of a structural schematic diagram for a lateral movement schematic diagram;
[0033] Figure 5 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0034] Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings.
[0035] When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Instead, they are only examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims.
[0036] It should be noted that, in this article, the terms "include", "comprises" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element. In addition, components, features, and elements with the same name in different embodiments of the present application may have the same meaning or different meanings, and their specific meanings need to be determined by their explanation in the specific embodiment or further combined with the context of the specific embodiment.
[0037] It should be understood that, although the terms first, second, third, etc. may be used to describe various information in this article, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of this article, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein can be interpreted as "at the time of..." or "when..." or "in response to determination". Furthermore, as used in this article, the singular forms "one", "one" and "the" are intended to also include plural forms, unless there is an opposite indication in the context. It should be further understood that the terms "comprising", "including" indicate that there are described features, steps, operations, elements, components, projects, kinds, and / or groups, but do not exclude the existence, occurrence or addition of one or more other features, steps, operations, elements, components, projects, kinds, and / or groups. The terms "or" and "and / or" used herein are interpreted as inclusive, or mean any one or any combination. Thus, “A, B, or C” or “A, B and / or C” means “any of the following: A; B; C; A and B; A and C; B and C; A, B, and C.” An exception to this definition will occur only when a combination of elements, functions, steps, or operations are inherently mutually exclusive in some manner.
[0038] It should be understood that, although the various steps in the flowchart in the embodiment of the present application are displayed in sequence according to the indication of the arrows, these steps are not necessarily performed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and it can be performed in other orders. Moreover, at least a portion of the steps in the figure may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily performed at the same time, but can be performed at different times, and their execution order is not necessarily performed in sequence, but can be performed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
[0039] It should be noted that in this article, step codes such as S1 and S2 are used for the purpose of expressing the corresponding content more clearly and concisely, and do not constitute a substantial limitation on the order. When implementing the step, those skilled in the art may execute S2 first and then S1, etc., but these should all be within the scope of protection of this application.
[0040] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0041] In the subsequent description, the suffixes such as "module", "component" or "unit" used to represent elements are only used to facilitate the description of the present application, and have no specific meanings. Therefore, "module", "component" or "unit" can be used in a mixed manner.
[0042] Figure 1-Figure 3 , which provides a flow chart of a method for detecting traffic lateral movement attacks based on a heterogeneous graph, an overall framework chart, and a structural chart of a lateral movement chart for an embodiment of the present application, see Figure 1 , the method comprising:
[0043] Step S1, obtaining the communication traffic between micro-isolation security domains through the traffic capturer in the policy dynamic generation module;
[0044] Specifically, Python's third-party library Scapy is used to process network packets, capture and parse network traffic. The traffic filtering conditions can be based on the computer, user, event type, including login, logout, process creation, file creation, etc., event attributes, such as login type, authentication type, login result, etc. for login events, and network connections, including protocols, ports, etc.
[0045] Step S2, the traffic capturer stores the communication traffic in an asynchronous processing manner to obtain a communication traffic data set;
[0046] Specifically, the built-in threading module in Python is used to create a thread, the data packet storage function is called periodically, the storage interval is set to 5 seconds, and then the thread call is started to obtain the traffic data set.
[0047] Step S3: construct a traffic scenario heterogeneous graph G based on the traffic data set. <V,E,T V , T E >, where V represents a node, E represents an edge between nodes, and T V , T E They represent the node type and the edge type between nodes respectively.
[0048] Specifically, the abnormal traffic detector in the dynamic strategy generation module mines the traffic data set at different time intervals based on the time series graph mining algorithm to perform traffic detection, obtain the traffic time series graph, and represent the points and edges of the traffic time series graph.
[0049] The key to heterogeneous graph construction lies in how to represent internal network nodes and how to represent the relationship between nodes. Computers, users, processes, and files are the core elements of internal network communication, and all kinds of attackers' activities revolve around them. The relationship between computers includes network connection and user remote access. The relationship between computers and users includes login and use. The relationship between computers and users and processes is that users can create or terminate processes on computers, and files are the same as processes. In addition, the executed file is also a process and can also create files. Lateral movement activities mostly occur between computers or users. However, in the internal network, lateral movement from user to user must be mediated by computers. These primitive relationships are the rules and regulations for creating heterogeneous graphs, and they are all directed.
[0050] Here, a log entry is defined as a tuple <time,C src , U src , C dst , U dst ,T,A>, where time represents time, C represents computer, U represents user, and subscripts src and dst represent the source and destination of the event respectively. T represents the type of event, including login, logout, process creation, file creation, etc. A represents the attributes of the event, such as login type, authentication type, login result, etc. for login events; for network connections, including protocol, port, etc., C for some types of event logs src , U src Field can be empty.
[0051] Step S4: in the heterogeneous graph, constructing a metapath between nodes of different types based on the selected metapath2vec++ algorithm;
[0052] Specifically, in the graph network algorithm, there are node embedding algorithms and graph embedding algorithms. In recent years, many graph embedding algorithms have been proposed, but most of them can only be applied to isomorphic graphs. For path representation in heterogeneous graphs, the metapath2vec++ algorithm is selected. The metapath2vec++ algorithm is an improvement on the Random Walk algorithm. It restricts RandomWalk to bound metapaths, samples the sequence through Random Walk, and uses Skip-Gram to learn node representation. This method can not only retain the structural information in heterogeneous graphs, but also retain the semantic information.
[0053] In graph embedding, the nodes in the graph are mapped to a low-dimensional vector space so that the relationship between the nodes in this space can reflect their relationship in the original graph. This embedded representation can be used for various tasks, such as node classification, link prediction, etc.
[0054] Negative sampling is a commonly used technique for efficiently training embedding models, especially on large-scale datasets. The basic idea of negative sampling is:
[0055] Positive Samples: We select some actual edges from the graph as positive samples. These edges correspond to the real connection relationships in the graph.
[0056] Negative Samples: In order to make the model learn to distinguish between real connections and false connections, we randomly select some non-existent edges from the graph as negative samples.
[0057] During the training process, the model adjusts the embedding of nodes by optimizing an objective function so that the distance between node pairs of positive samples is as small as possible, while the distance between node pairs of negative samples is as large as possible.
[0058] metapath2vec++ plays an important role in Random Walk. Based on historical experience, some metapaths containing lateral movement semantics are set to obtain more needed information. The metapath scheme is defined as follows:
[0059]
[0060] Among them, V1, V2, ..., V l Refers to the node type, R1, R2, ..., R l-1 It refers to node transfer. Represents a composite operation of a relation, where l is an integer greater than 1.
[0061] The probability of node transfer is As shown in the following formula:
[0062]
[0063] Among them, p is the set of meta-paths, E is the link edge, represents the i-th node of the t-th type, v i represents the i-th node, Refers to the node V t-1 Type of neighboring nodes.
[0064] Step S5: performing a random walk on the meta-path to obtain a random walk path, obtaining a corresponding random walk node sequence based on the random walk path, and inputting the random walk node sequence into a Skip-Gram model to obtain an embedding vector of a node in the heterogeneous graph;
[0065] Specifically, the random walk node sequence is input into the Skip-Gram model to maximize the probability of the existence of the surrounding nodes of the node, and the probability maximization function is:
[0066]
[0067] Where V represents the node set, T V Represents a set of node types, N t (v) refers to the t-th type of node in the neighboring nodes of node v, θ is the parameter of the model, P(c t |v;θ) is the softmax function, specifically:
[0068]
[0069] Among them, X v represents the embedding vector of node v, Represents node C t The embedding vector of the meta-path around the node, Indicates the uth t The embedding vectors of the node types, It means traversing all nodes of the tth type, and the output of the Skip-Gram model is the embedding vector of the node in the heterogeneous graph.
[0070] Step S6, inputting the embedding vector of the node generated by the Skip-Gram model into the unsupervised autoencoder model; the unsupervised autoencoder model outputs the embedding vector of the reconstructed node; using a predetermined reconstruction error function to calculate the reconstruction error between the embedding vector of the reconstructed node and the embedding vector of the node generated by the Skip-Gram model, and identifying unknown lateral movement according to the reconstruction error;
[0071] Specifically, the embedding vector X of the node generated by the Skip-Gram model is P Input into the unsupervised autoencoder model;
[0072] The unsupervised autoencoder model outputs the embedding vector Y of the reconstructed node P ;
[0073] Calculate (X) using a predetermined reconstruction error function P , Y P ), and compare the reconstruction error value with a preset threshold. If the reconstruction error is greater than the preset threshold, it is determined that there is unknown lateral movement, wherein the predetermined reconstruction error function includes: any one of a mean square error function and a mean absolute error.
[0074] Among them, Mean Squared Error (MSE): in and Represents the value of the i-th dimension of the embedding vector of the starting and ending nodes respectively, and d is the dimension of the embedding vector. Mean Absolute Error (MAE): same, and Represents the value of the i-th dimension of the embedding vector of the starting and ending nodes respectively. The reconstruction error metric can be used to evaluate the quality of the path representation. The smaller the reconstruction error, the more similar the embedding vectors of the starting and ending nodes are, reflecting the close relationship between the nodes on the path.
[0075] Lateral movement path detection,First, the model is designed to be implemented in combination with the existing network structure and network access relations. Most of the data in the real world is not labeled, so in order to confirm this environment, the model is unsupervised. The heterogeneous graph is generated using the above-mentioned heterogeneous graph construction method, which relies on the data source within a specific time range. Depending on the availability of the data, the time range can be weeks, months, and years. However, different data scales mean that the scale of the constructed heterogeneous graph is different, which will lead to an increase in calculation and storage. The path representation algorithm is then applied to the constructed graph to generate a path representation vector for subsequent path detection. We set specific metapath rules as the basis for detection. Appendix Figure 3-4 In the previous section, other common lateral movement paths are listed, but this is not comprehensive. Detecting different paths may require different detection model parameters. For a given generated path P, obtain the path representation X P , and input into the unsupervised autoencoder model, the output is Y P , then calculate (X P ,Y P ), the reconstruction error of the image can be obtained by the selected threshold (0, 1), where 0 represents normal and 1 represents malicious. The choice of the threshold can be determined by the model effect of feedback regulation.
[0076] The supervised autoencoder model is used to learn the data features of unlabeled samples and reconstruct them with low loss. We use an Autoencoder containing a multi-layer neural network to distinguish between benign paths and abnormal lateral movement paths. The autoencoder consists of two parts: the encoder and the decoder. The encoding process from the input layer to the hidden layer and the decoding process from the hidden layer to the output layer are represented as follows:
[0077] h=S f (Wx+p)
[0078]
[0079] Among them, S f It is the activation function of the encoder. Common activation functions include Sigmoid, tanh and ReLu. g is the activation function of the decoder, W and is the weight matrix, p and q are offsets, h is the output of the input layer, and y is the output of the hidden layer. In the model, an Autoencoder with two encoding hidden layers and two decoding hidden layers is used, and the activation functions used are tanh and ReLu. Depending on the activation function, the Autoencoder uses different reconstruction error functions to find the optimal solution.
[0080] The selection of activation function mainly considers the value range of the data and the convergence characteristics of the model, while the selection of reconstruction error function is mainly determined by the error distribution characteristics of the data. MSE and MAE are more commonly used reconstruction error functions, which are suitable for different application scenarios and data characteristics.
[0081] Step S7: After the server identifies the unknown lateral movement behavior, it generates a network isolation policy and sends the network isolation policy to the administrator. The administrator decides whether to cut off the line and sends the final policy to the llot gateway device.
[0082] Specifically, the cloud service platform constructs a heterogeneous graph based on the relationship between communication nodes in the internal network, and uses the pre-set metapath to build the attacker's movement path in the internal network, thereby identifying unknown lateral movement across borders. After the cloud service platform identifies and detects lateral movement behavior, it generates a network isolation policy and sends the detection results to the administrator. The administrator decides whether to cut off the line and sends the final policy to the llot gateway device.
[0083] When the ILot gateway receives the isolation policy, it cuts off the line segment and ignores any request in the line segment, thereby protecting other ILot devices.
[0084] In summary, the heterogeneous graph traffic lateral movement attack detection method provided in this embodiment has the following advantages: by adopting a heterogeneous graph to build a path detection module, different paths are learned and feedback adjusted to better determine abnormal traffic, thereby achieving the purpose of dynamically generating micro-isolation strategies.
[0085] By adopting the management and control cloud platform, the policy manager module and the policy execution module can visualize and execute the micro-isolation policy, thereby realizing the management and control of the intranet traffic in the industrial Internet of Things, so as to achieve the purpose of timely discovering the lateral movement path and making judgments.
[0086] Based on the same inventive concept as the above-mentioned embodiment, the embodiment of the present invention further provides a heterogeneous graph traffic lateral movement attack detection system, including:
[0087] The communication traffic capture module obtains the communication traffic between micro-isolated security domains through the traffic capturer in the policy dynamic generation module;
[0088] A communication traffic storage module, wherein the traffic capturer stores the communication traffic in an asynchronous processing manner to obtain a communication traffic data set;
[0089] A heterogeneous graph construction module is used to construct a traffic scene heterogeneity G based on the traffic data set. <V,E,T V ,T E>, where V represents a node, E represents an edge between nodes, and T V , T E Respectively represent the node type and the edge type between nodes;
[0090] A meta-path construction module, in the heterogeneous graph, constructs a meta-path between nodes of different types based on the metapath2vec++ algorithm;
[0091] An embedding vector generation module performs a random walk on the meta-path to obtain a random walk path, obtains a corresponding random walk node sequence based on the random walk path, and inputs the random walk node sequence into a Skip-Gram model to obtain an embedding vector of a node in the heterogeneous graph;
[0092] The unknown lateral movement recognition module inputs the embedding vector of the node generated by the Skip-Gram model into the unsupervised autoencoder model; the unsupervised autoencoder model outputs the embedding vector of the reconstructed node; a predetermined reconstruction error function is used to calculate the reconstruction error between the embedding vector of the reconstructed node and the embedding vector of the node generated by the Skip-Gram model, and the unknown lateral movement is recognized according to the reconstruction error.
[0093] Manual judgment module: After the server identifies the unknown lateral movement behavior, it generates a network isolation policy and sends the network isolation policy to the administrator. The administrator decides whether to cut off the line and sends the final policy to the llot gateway device.
[0094] Based on the same inventive concept as the above embodiments, the embodiments of the present invention further provide an electronic device, such as Figure 5 As shown, the device includes: a processor 310 and a memory 311 storing a computer program; wherein, Figure 5 The processor 310 shown in the figure is not used to indicate that the number of the processor 310 is one, but is only used to indicate the positional relationship of the processor 310 relative to other devices. In actual applications, the number of the processor 310 may be one or more; similarly, Figure 5 The memory 311 shown in the figure has the same meaning, that is, it is only used to refer to the position relationship of the memory 311 relative to other devices. In practical applications, the number of memories 311 can be one or more. When the processor 310 runs the computer program, the fault diagnosis method of the engineering machinery control system is implemented.
[0095] The device may also include: at least one network interface 312. The various components in the device are coupled together via a bus system 313. It is understood that the bus system 313 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 313 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, Figure 5 Various buses are labeled as bus system 313.
[0096] The memory 311 may be a volatile memory or a nonvolatile memory, or may include both volatile and nonvolatile memories. The nonvolatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disk, or a compact disc read-only memory (CD-ROM); the magnetic surface memory may be a disk memory or a tape memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM, SyncLink Dynamic Random Access Memory), and direct RAM bus random access memory (DRRAM, Direct Rambus Random Access Memory).The memory 311 described in the embodiments of the present invention is intended to include but is not limited to these and any other suitable types of memories.
[0097] The memory 311 in the embodiment of the present invention is used to store various types of data to support the operation of the device. Examples of these data include: any computer program used to operate on the device, such as an operating system and an application; contact data; phone book data; messages; pictures; videos, etc. Among them, the operating system includes various system programs, such as a framework layer, a core library layer, a driver layer, etc., which are used to implement various basic services and process hardware-based tasks. The application program may include various applications, such as a media player (Media Player), a browser (Browser), etc., which are used to implement various application services. Here, the program that implements the method of the embodiment of the present invention may be included in the application program.
[0098] Based on the same inventive concept as the above-mentioned embodiment, this embodiment further provides a computer-readable storage medium, in which a computer program is stored. The computer-readable storage medium may be a ferromagnetic random access memory (FRAM), a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM) or the like; it may also be various devices including one or any combination of the above-mentioned memories, such as a mobile phone, a computer, a tablet device, a personal digital assistant, etc. When the computer program stored in the computer-readable storage medium is executed by the processor, the fault diagnosis method of the engineering machinery control system mentioned above is implemented. For the specific steps implemented when the computer program is executed by the processor, please refer to Figure 1 The description of the illustrated embodiment will not be repeated here.
[0099] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0100] In this document, the terms "comprises," "comprising," or any other variations thereof, are intended to cover a non-exclusive inclusion of elements other than those listed and may also include additional elements not expressly listed.
[0101] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A method for detecting traffic lateral movement attacks based on heterogeneous graphs, characterized in that: The method comprises: Step S1, obtaining the communication traffic between micro-isolation security domains through the traffic capturer in the policy dynamic generation module; Step S2, the traffic capturer stores the communication traffic in an asynchronous processing manner to obtain a communication traffic data set; Step S3: construct a traffic scenario heterogeneous graph G based on the communication traffic data set. <V,E,T V ,T E >, where V represents a node, E represents an edge between nodes, and T V , T E Respectively represent the node type and the edge type between nodes; Step S4: in the heterogeneous graph, constructing a metapath between nodes of different types based on the selected metapath2vec++ algorithm; Step S5: performing a random walk on the meta-path to obtain a random walk path, obtaining a corresponding random walk node sequence based on the random walk path, and inputting the random walk node sequence into a Skip-Gram model to obtain an embedding vector of a node in the heterogeneous graph; Step S6, inputting the embedding vector of the node generated by the Skip-Gram model into the unsupervised autoencoder model; the unsupervised autoencoder model outputs the embedding vector of the reconstructed node; using a predetermined reconstruction error function to calculate the reconstruction error between the embedding vector of the reconstructed node and the embedding vector of the node generated by the Skip-Gram model, and identifying unknown lateral movement attacks according to the reconstruction error; Step S7: After the server identifies the unknown lateral movement attack, it generates a network isolation policy and sends the network isolation policy to the administrator. The administrator decides whether to cut off the line and sends the final policy to the ILOt gateway device. The selection-based metapath2vec++ algorithm constructs metapaths between nodes of different types, including: The meta-path is defined as follows: Among them, V1, V2, ..., V l Refers to the node type, R1, R2, ..., R l-1 It refers to node transfer. Represents a composite operation of a relation, where l is an integer greater than 1; The step S6 comprises: The embedding vector of the node generated by the Skip-Gram model is input into the unsupervised autoencoder model; the unsupervised autoencoder model outputs the embedding vector of the reconstructed node; a predetermined reconstruction error function is used to calculate the reconstruction error between the embedding vector of the reconstructed node and the embedding vector of the node generated by the Skip-Gram model, and the reconstruction error is compared with a preset threshold. If the reconstruction error is greater than the preset threshold, it is determined that an unknown lateral movement attack exists, wherein the predetermined reconstruction error function includes: either a mean square error function or a mean absolute error function.
2. The method according to claim 1, characterized in that: The step S1 comprises: Use Python's third-party library Scapy to process network packets and obtain communication traffic between micro-isolation security domains; The traffic filtering conditions used in the process of obtaining communication traffic are set according to the computer, user, login, logout, process creation, file creation, event attributes, protocol, and port.
3. The method according to claim 2, characterized in that The traffic scenario heterogeneous graph G is constructed based on the traffic data set. <V,E,T V , T E >, including: The abnormal traffic detector in the policy dynamic generation module mines the traffic data sets at different time intervals for traffic detection and obtains the traffic time series graph; The points and edges in the traffic time series graph are represented to obtain a traffic scene heterogeneous graph G= <V,E,T V , T E >.
4. The method according to claim 1, characterized in that The probability of node transfer is As shown in the following formula: Among them, p is the set of meta-paths, E is the link edge, represents the i-th node of the t-th type, v i represents the i-th node, Refers to the node V t-1 The neighboring nodes of the type, i and t are both positive integers.
5. The method according to claim 1, characterized in that Inputting the random walk node sequence into the Skip-Gram model to obtain the embedding vector of the node in the heterogeneous graph includes: The random walk node sequence is input into the Skip-Gram model to maximize the probability of the existence of the surrounding nodes of the node. The probability maximization function is: Where V represents the node set, T V Represents a set of node types, N t (v) refers to the t-th type of node among the neighboring nodes of node v, P(c t |v; θ) is the softmax function, θ is the parameter of the model, specifically: Among them, X v represents the embedding vector of node v, Represents node c t The embedding vector of the meta-path around the node, Indicates the uth t The embedding vectors of the node types, It means traversing all nodes of the tth type, and the output of the Skip-Gram model is the embedding vector of the node in the heterogeneous graph.
6. A heterogeneous graph traffic lateral movement attack detection system, used to execute the method according to any one of claims 1 to 5, characterized in that: include: The communication traffic capture module obtains the communication traffic between micro-isolated security domains through the traffic capturer in the policy dynamic generation module; A communication traffic storage module, wherein the traffic capturer stores the communication traffic in an asynchronous processing manner to obtain a communication traffic data set; A heterogeneous graph construction module is used to construct a traffic scenario heterogeneous graph G based on the traffic data set. <V,E,T V , T E >, where V represents a node, E represents an edge between nodes, and T V , T E Respectively represent the node type and the edge type between nodes; A meta-path construction module, in the heterogeneous graph, constructs a meta-path between nodes of different types based on a selected metapath2vec++ algorithm; the meta-path construction between nodes of different types based on the selected metapath2vec++ algorithm includes: The meta-path is defined as follows: Among them, V1, V2, ..., V l Refers to the node type, R1, R2, ..., R l-1 It refers to node transfer. Represents a composite operation of a relation, where l is an integer greater than 1; An embedding vector generation module performs a random walk on the meta-path to obtain a random walk path, obtains a corresponding random walk node sequence based on the random walk path, and inputs the random walk node sequence into a Skip-Gram model to obtain an embedding vector of a node in the heterogeneous graph; An unknown lateral movement identification module is configured to input the embedding vector of the node generated by the Skip-Gram model into an unsupervised autoencoder model; the unsupervised autoencoder model outputs the embedding vector of the reconstructed node; a reconstruction error between the embedding vector of the reconstructed node and the embedding vector of the node generated by the Skip-Gram model is calculated using a predetermined reconstruction error function, and unknown lateral movement is identified according to the reconstruction error; Manual judgment module: After the server identifies the unknown lateral movement behavior, it generates a network isolation policy and sends the network isolation policy to the administrator. The administrator decides whether to cut off the line and sends the final policy to the llot gateway device.
7. An electronic device, characterized in that: It comprises a processor and a memory storing a computer program; when the processor executes the computer program, the method for detecting traffic lateral movement attacks based on a heterogeneous graph described in any one of claims 1 to 5 is implemented.
8. A computer-readable storage medium, characterized in that: A computer program is stored, and when the computer program is executed by a processor, the method for detecting traffic lateral movement attacks based on a heterogeneous graph according to any one of claims 1 to 5 is implemented.
