A Scalable Network Attack Detection Method Based on Behavior Graph and Weisfeiler Lehman Algorithm

By constructing a host behavior graph and embedding the graph core using a method based on behavioral graphs and the WeisfeilerLehman algorithm, it solves the problem of failing to effectively capture structural information and timing information in the existing technology, and achieves efficient analysis and model training of complex graph data. The improvement in efficiency reduces the burden of redundant data processing.

CN114900362BActive Publication Date: 2024-10-15GUILIN UNIV OF ELECTRONIC TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210528503.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-16
Publication Date
2024-10-15
Estimated Expiration
2042-05-16

AI Technical Summary

Technical Problem

Existing network attack detection methods fail to effectively capture the structural information and timing information in the data, and the graph structure based on walks or paths is too simple to support the analysis of complex graph data, resulting in high model complexity and low training efficiency. Most studies fail to handle redundant data effectively.

Method used

Adopt a scalable network attack detection method based on behavioral graphs and WeisfeilerLehman algorithm. By constructing a host behavioral graph, reduce the number of graph cores and end-to-end graph embedding, calculate the graph similarity matrix, and combine with integrated learning methods to improve model training efficiency. and preserve schema integrity.

Benefits of technology

It achieves efficient analysis of complex graph data, reduces model complexity, improves training efficiency, and reduces redundant data processing through the data reduction method of the graph kernel, enhancing the model's interpretability and classification accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114900362B_ABST
    Figure CN114900362B_ABST
Patent Text Reader

Abstract

The invention discloses an extensible network attack detection method based on behavior graph and Weisfeiler Lehman algorithm. The method firstly adopts the graph representation form of host behavior, can use the network communication graph as the basic framework, and associate the connection records associated with each host with the communication relationship; secondly, data reduction is performed based on self-similarity. Due to the high redundancy of network data, data reduction is required to improve the training efficiency of the model, but data reduction of the connection record is likely to destroy the integrity of the host's behavior pattern; finally, the Weisfeiler Lehman graph kernel is used to perform graph embedding and similarity calculation end-to-end. The output is used as the input of the kernel method, combined with ensemble learning, and the model can be efficiently trained without introducing more errors.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of network attack anomaly detection, and in particular to an extensible network attack detection method based on behavior graph and Weisfeiler-Lehman algorithm. Background Art

[0002] In network traffic anomaly detection, connection records are usually extracted from pcap as samples. Each connection record contains information about a session connection, expressed as a five-tuple (source IP, source port, destination IP, destination port, protocol) and its extended attributes. The standardized connection record is used as a feature vector for model training. The commonly used KDD99, CICIDS17, and CTU-13 datasets all provide similar extracted connection records. Each connection record has a corresponding label, and the connection record is usually marked as normal business traffic, malicious traffic, or background traffic.

[0003] For supervised learning, during the model training phase, the order of the feature vectors is disrupted, and the feature vectors and labels are input into supervised models such as Naive Bayes, SVM, ANN, etc., and a classifier is obtained after training. For unsupervised learning, the vectors are input into unsupervised anomaly detection algorithms such as Isolation Forest, KNN, K-Means, OCSVM, and Autoencoder, and the density, distance, or reconstruction error between samples is used as the basis for judging whether the sample point is abnormal.

[0004] It can be seen that no matter supervised or unsupervised methods, most studies assume that samples are independent of each other, do not consider the relationship between samples, consider the feature vector of each sample separately, and fail to capture the structural and temporal information in the data. Although some studies have made improvements on feature engineering, they still do not consider the relationship between samples and use it as the input of the model.

[0005] Graph-based network attack detection is a solution to the above problems. Some studies have focused on detecting anomalies on graphs, and can detect anomalies after converting data sets into graphs. At present, there are literatures that build graph structures based on walks, use CNN and LSTM, use CNN to capture network structure information in communication, and use LSTM to capture timing information between network connections, and achieve high classification accuracy. However, deep learning is difficult to meet the needs of interpretability, and the combination of multiple models will also cause the problem of increased model complexity to a certain extent. Most of the graph structures in existing studies simply represent communication behaviors based on walks or paths, and each node is used to represent a host or IP. Although such walk-based and path-based graphs can clearly represent neighbor information, they can use a large number of traditional graph theory algorithms, such as using deepwalk, node2vec and other algorithms to embed random walk information, or use ordinary graph embedding methods to embed the centrality and density of the graph into the graph vector, and then perform outlier detection in the multi-dimensional feature space based on the vector. However, in the network attack detection scenario, the semantic information of this type of graph is too simple. It does not embed attributes such as communication duration, direction, number of packets sent, number of bytes, status, etc., and cannot support the analysis of object attributes.

[0006] When complex graphs are used instead of walk-based or path-based graphs, most existing graph algorithms or graph embedding algorithms are not applicable because they are walk-based or path-based algorithms with simpler semantics. For anomaly detection in complex graph structures, the abnormal substructure is usually pre-set, and then the graph is detected based on subgraph matching to see if anomalies occur. Obviously, this method based on subgraph matching or subgraph enumeration has a high time complexity. Alternatively, the number of each substructure is used as an element of the embedding vector. However, in addition to the high time complexity when enumerating substructures, there is also the problem of non-fixed or too large vector dimensions.

[0007] On the other hand, network security data is highly redundant. Most existing studies directly input all connection records into model training, which results in low training efficiency. Most of the time is spent on analyzing and processing redundant data. Therefore, it is necessary to study a data reduction method that can reduce data and improve model training efficiency while ensuring the integrity of the model used for subsequent training. Summary of the invention

[0008] The purpose of the present invention is to provide an extensible network attack detection method based on behavior graph and Weisfeiler-Lehman algorithm to address the deficiencies of the prior art.

[0009] The technical solution for achieving the purpose of the present invention is:

[0010] A scalable network attack detection method based on behavior graph and Weisfeiler Lehman algorithm comprises the following steps:

[0011] 1) Building a labeled training network and collecting its asset information: Building a labeled training network and collecting network asset information for the training network. The network asset information includes hosts, routers, switches, servers, and printers. Extract their device types, IP addresses, MAC addresses, systems, and services, build a network asset list, and store it in the database.

[0012] 2) For the training network obtained in step 1), generate the input of the model to be trained from data collection and cleaning, behavior unit extraction, data reduction, behavior graph embedding and similarity matrix calculation. The specific steps are as follows:

[0013] 2-1) Traffic capture and automatic sample labeling: Run the training network built in step 1), and capture and automatically label the network traffic in the training network; use TShark or WireShark tools to capture the normal business traffic, background traffic, and attack traffic of the security window respectively. The captured traffic is labeled, and each related host is labeled with a corresponding label. The host used to launch the attack is labeled as a positive sample, that is, a malicious host; the remaining hosts and devices are labeled as negative samples, that is, normal hosts; the labeling process is automated based on the pre-configured attack script;

[0014] 2-2) Connection record extraction: Extract connection records from the network traffic captured in step 2-1). First, convert the pcap file into a csv feature file through CICFlowMeter to extract the connection records of communication between network devices. The attributes of the connection records include source IP, destination IP, source port, destination port, communication direction, connection status, duration, number of packets sent in the connection, total number of bytes sent in the connection, and response ratio during the communication between the source and destination hosts.

[0015] 2-3) Data cleaning and attribute discretization: Data cleaning and discretization are performed on the connection records obtained in step 2-2):

[0016] 2-3-1) Data cleaning: Delete abnormal connection records generated during the operation of the connection record extraction tool, including abnormal attributes and types. Missing attributes are supplemented by linear interpolation or directly deleted;

[0017] 2-3-2) Attribute discretization: Map each attribute of the connection record to a non-overlapping integer interval, that is, attribute discretization corresponds to a mapping D. For attribute F i and F j , satisfying D(F i )→N i* , D(F j )→N j * , and N i * ∩ N j * =∅; the original record contains discrete attributes, including source / destination address, protocol, port, service, status, and communication direction. These attributes are converted into category attributes, that is, the source / destination address contains a large number of IP addresses. After classification, it becomes one of NORMAL_IP, RESERVE_IP, and ERROR_IP. The port becomes RESERVE_PORT, WELL_KONWN_PORT, and OTHER_PROT. The source / destination address is the SrcAddr and DstAddr fields in the connection record.

[0018] 2-4) Data fusion and generation of behavior units and behavior graphs: Based on the network asset information collected in step 1) and the connection records after cleaning and attribute discretization in step 2-3), data fusion is performed to generate behavior units and behavior graphs. The behavior unit is a graph representation of the connection record, which includes 9 nodes: SrcAddr-Type, DstAddr-Type, State, Dir, Conn_num, Proto, Duration, Totpkts, and SrcBytesRatio. Src and Dst represent the source IP and destination IP, the state indicates whether the connection is successful, Dir indicates the direction of communication, conn_num represents the number of connections established between two hosts in a certain time window, proto is the connection protocol, duration is the duration of the connection, Totpkts is the number of packets sent in the time window, and SrcBytesRatio is the ratio of the bytes sent by the source host to the destination host to the total number of bytes in the connection. After obtaining the host behavior unit, the relevant behavior units are associated through the SrcAddr and DstAddr nodes to generate the host behavior graph;

[0019] 2-5) Reduction based on the number of graph cores: Based on the self-similarity of the network behavior graph, first calculate the self-similarity of the behavior graph of each host obtained in step 2-4) to obtain a summary of the host behavior pattern, and then delete the same pattern. After data reduction, the obtained atlas is a valid atlas, and the valid atlas is used as the subsequent training sample;

[0020] 3) Model training: Based on the Weisfeiler Lehman algorithm, the valid graph set obtained in steps 2-5) is used as input, and graph embedding is performed end-to-end and similarity is calculated to obtain the graph similarity matrix of the behavior graphs of all hosts. The obtained similarity matrix and labels are used as the input of the ensemble learning method of the algorithm to train the base learners and obtain the ensemble classifier. During the training process, the nested cross-validation method is used to divide the data set. The training set and validation set are used for learner parameter learning, hyperparameter tuning, and base learner aggregation method learning. The test set is used to finally evaluate the effect of the model and finally obtain the ensemble classifier.

[0021] 4) Collect asset information of unlabeled real networks: Detect unlabeled real networks and collect network asset information. In a real network environment, the label of each device is uncertain. These devices may be normal devices or devices infected by malicious code.

[0022] 5) Collection and preprocessing of real samples: The traffic in the real network is preprocessed using the methods of step 2-2) to step 2-4), and the network asset information in step 4) is used for data fusion, and behavior units and behavior graphs are generated. The graph embedding and similarity matrix calculation are performed end-to-end based on the Weisfeiler Lehman graph algorithm. At this time, the similarity calculation is performed between the sample to be tested and each training sample;

[0023] 6) Input the similarity matrix obtained in step 5) into the integrated classifier obtained in step 3) to obtain the classification result of the host behavior module. If the host's behavior pattern is judged to be abnormal, the host corresponding to the behavior graph is a suspicious host, which may be an infected host. The classification result is notified to the security management and corresponding platform, and the security personnel further audit the host's behavior pattern;

[0024] 7) Response and model update: If the suspicious host is determined to be a malicious host by the security personnel, the security management and response platform will deal with the malicious host. If the security personnel determine it to be a safe host, the behavior pattern diagram of the host will be used as a new sample and re-sent to step 3) for retraining to update the model.

[0025] The present invention provides an extensible network attack detection method based on a behavior graph and a Weisfeiler Lehman algorithm. The method establishes a host behavior graph, which is compatible with the most common data set features and can be flexibly expanded. It can encode more information based on network communication as the infrastructure, and integrate data sources including traffic, IDS, host logs, etc. for analysis. End-to-end graph embedding and graph similarity calculation are performed based on a subtree-based graph core, thereby supporting subsequent analysis of the above-mentioned complex graph data representation. This method is more efficient than similarity calculation based on subgraph matching, while retaining interpretability. A data reduction method based on a graph core is proposed to improve the training efficiency of the model. It is proposed to reduce data based on the generated behavior graph, which can ensure that the integrity of the host behavior pattern used for training is not destroyed. The model based on ensemble learning can fully utilize the advantages of the selected base learner in small sample learning while improving the training efficiency, and can also reduce the error / bias of classification. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 It is a flowchart of a scalable network attack detection method based on behavior graph and Weisfeiler Lehman algorithm;

[0027] Figure 2 Schematic diagram of the behavioral unit. DETAILED DESCRIPTION

[0028] The present invention will be further described below in conjunction with the accompanying drawings and embodiments, but the present invention is not limited thereto.

[0029] Example:

[0030] like Figure 1 As shown, a scalable network attack detection method based on behavior graph and Weisfeiler Lehman algorithm includes the following steps:

[0031] Model training phase:

[0032] 1) Building a labeled training network and collecting its asset information: Building a labeled training network to train the classifier through simulated traffic and collect network asset information for the training network. The network asset information includes hosts, routers, switches, servers, and printers. Extract their device types, IP addresses, MAC addresses, systems, and services, build a network asset list, and store it in the database.

[0033] For special device configurations, such as mail services, web services, file services, DNS services, DHCP services, firewalls, etc., for ordinary user hosts, a normal working or living Internet environment is configured. Then, automated attack scripts and malware are randomly prepared on a portion of various types of network devices, and malicious codes are implanted in various devices. Subsequently, network attacks are launched on other devices in the training network through these hosts implanted with malicious codes. These network attacks are used to generate malicious traffic and behavior pattern diagrams. The network behavior of other devices that have not been implanted with malicious code is used to generate normal business traffic, background traffic and their corresponding network behavior diagrams.

[0034] 2) For the training network obtained in step 1), generate the input of the model to be trained from data collection and cleaning, behavior unit extraction, data reduction, behavior graph embedding and similarity matrix calculation. The specific steps are as follows:

[0035] 2-1) Traffic capture and automatic sample labeling: Run the training network built in step 1), and capture the network traffic in the training network and automatically label the samples; use TShark or WireShark tools to capture the normal business traffic of the security window (normal network services include file transfer, audio and video streaming, mail service, etc.) and background traffic (communication connection traffic, DNS resolution traffic, time synchronization traffic, host detection traffic), attack traffic (attack traffic built by attack scripts, automated penetration testing tools, zombie software, etc.). The captured traffic is labeled, and each related host is labeled with a corresponding label. The host used to launch the attack is labeled as a positive sample, that is, a malicious host; the remaining hosts and devices are labeled as negative samples, that is, normal hosts; the labeling process is automated based on the pre-configured attack script;

[0036] 2-2) Connection record extraction: Extract connection records from the network traffic captured in step 2-1). First, convert the pcap file into a csv feature file through TShark, WirieShark, and CICFlowMeter to extract the connection records of communication between network devices. The attributes of the connection records include source IP, destination IP, source port, destination port, communication direction, connection status, duration, number of packets sent in the connection, total number of bytes sent in the connection, and response ratio during the communication between the source and destination hosts.

[0037] 2-3) Data cleaning and attribute discretization: Data cleaning and discretization are performed on the connection records obtained in step 2-2). The discretized attributes include: Conn_num, Duration, Totpkts, SrcBytesRatio; other discretized attributes can also be further categorized, including SrcAddr, DstAddr, State, Dir, Proto. The details are as follows:

[0038] 2-3-1) Data cleaning: Delete abnormal connection records generated during the operation of the connection record extraction tool, including abnormal attributes and types. Missing attributes are supplemented by linear interpolation or directly deleted;

[0039] 2-3-2) Attribute discretization: Map each attribute of the connection record to a non-overlapping integer interval, that is, attribute discretization corresponds to a mapping D. For attribute F i and F j , satisfying D(F i )→N i * , D(F j )→N j * , and N i * ∩ N j * =∅; the original record contains discrete attributes, including source / destination address, protocol, port, service, status, and communication direction. These attributes are converted into category attributes, that is, the source / destination address contains a large number of IP addresses. After classification, it becomes one of NORMAL_IP, RESERVE_IP, and ERROR_IP. The port becomes RESERVE_PORT, WELL_KONWN_PORT, and OTHER_PROT. The source / destination address is the SrcAddr and DstAddr fields in the connection record.

[0040] 2-4) Data fusion and generation of behavior units and behavior graphs: Based on the network asset information collected in step 1) and the connection records after cleaning and attribute discretization in step 2-3), data fusion is performed to generate behavior units and behavior graphs, where the behavior unit is a graph representation of the connection record, which includes 9 nodes: SrcAddr-Type, DstAddr-Type, State, Dir, Conn_num, Proto, Duration, Totpkts, and SrcBytesRatio. Src and Dst represent the source IP and destination IP, the state indicates whether the connection is successful, Dir indicates the direction of communication, conn_num represents the number of connections established between the two hosts in a certain time window, proto is the connection protocol, duration is the duration of the connection, Totpkts is the number of packets sent in the time window, and SrcBytesRatio is the ratio of the bytes sent by the source host to the destination host to the total number of bytes in the connection. After obtaining the host behavior unit, the relevant behavior units are associated through the SrcAddr and DstAddr nodes to generate the host behavior graph; based on the network communication behavior as the basic architecture, in such Figure 2 On the basis of the behavior unit shown, data from other data sources are continuously embedded to extend the behavior unit;

[0041] For example, after associating the IP and device type of the device in the network activity, the SrcAddr and DstAddr nodes can be changed to SrcAddr-DeviceType and DstAddr-DeviceType, thereby associating the IP type of the device in the network traffic and the device type in the network asset information. 2) After obtaining the behavior unit, the host behavior graph can be further obtained. The steps are as follows: First, introduce a concept - the connection record related to a host refers to all connection records involved in multi-hop communication (ABC) and multi-host communication (AB, AC) initiated by the host, rather than just the connection record with the host as the source host / destination host. The first step in generating the host behavior graph is to filter out the connection records related to each host, and then divide them based on a 1-minute time window to obtain several groups. Each group represents all connection records related to a host within a 1-minute time window. For the convenience of description, these connection records are called connection record groups. At this point, the host behavior graph can be generated. After associating all relevant connection records together through the SrcAddr and DstAddr attributes, each attribute of the connection record is used as a node to generate the host behavior graph. Each host behavior graph corresponds to a connection record group.

[0042] 2-5) Reduction based on the number of graph cores: Based on the self-similarity of the network behavior graph, first calculate the self-similarity of the behavior graph of each host obtained in step 2-4) to obtain a summary of the host behavior pattern, and then delete the same pattern. After data reduction, the obtained atlas is a valid atlas, and the valid atlas is used as the subsequent training sample;

[0043] 3) Model training: Based on the Weisfeiler Lehman algorithm, the valid graph set obtained in steps 2-5) is used as input, and graph embedding is performed end-to-end and similarity is calculated to obtain the graph similarity matrix of the behavior graphs of all hosts. The obtained similarity matrix and labels are used as the input of the ensemble learning method of the algorithm to train the base learners and obtain the ensemble classifier. During the training process, the nested cross-validation method is used to divide the data set. The training set and validation set are used for learner parameter learning, hyperparameter tuning, and base learner aggregation method learning. The test set is used to finally evaluate the effect of the model and finally obtain the ensemble classifier.

[0044] During the training process, the training set is first divided into k groups. In each group, the following operations are performed in parallel: each group of m graphs is compared with the n graphs in the test set. Figure 1 And as the input of Weisfeiler Lehman graph kernel, the graph is embedded end-to-end and the graph similarity is calculated to obtain k similarity matrices, each of which is (m+n)*(m+n). Each similarity matrix is ​​used to train a base learner. The training of each base learner uses a 10-fold cross-validation method and is divided into a training set and a test set in a ratio of 9:1, namely Gs_train and Gs_test. When combining the outputs of each base learner, when it is judged that the base learner of a sample exceeds 10%, the sample is classified as a malicious host.

[0045] Model deployment phase:

[0046] First, the following nodes are set up in the network: several monitoring nodes and a security management platform. Each monitoring node is responsible for monitoring a part of the network, maintaining the asset information database of the local network, and classifying the equipment in the local network it is responsible for. The security management platform is responsible for sending the model parameters trained in the model training phase to the monitoring nodes in the real network, restoring the historical activities in the entire protected network, and receiving the results reported by the monitoring nodes.

[0047] 4) Collect asset information of unlabeled real networks: Detect unlabeled real networks and collect asset information in real networks, including device type, hardware information, etc. In real network environments, the label of each device is uncertain, and these devices may be normal devices or devices infected by malicious code.

[0048] 5) Collection and preprocessing of real samples: The traffic in the real network is preprocessed using the methods of step 2-2) to step 2-4), and the network asset information in step 4) is used for data fusion, and behavior units and behavior graphs are generated. The graph embedding and similarity matrix calculation are performed end-to-end based on the Weisfeiler Lehman graph algorithm. At this time, the similarity calculation is performed between the sample to be tested and each training sample;

[0049] Specifically:

[0050] The monitoring node is used to capture traffic data. It extracts the communication history of each host in a distributed manner, obtains the connection record, performs preprocessing such as data cleaning and discretization, and then sends the connection record used to build the behavior graph to the security management platform for reconstruction of network historical activities. On the other hand, the monitoring node regularly updates the asset information in the local network it is responsible for. The security management platform extracts the behavior graph of the host in the entire protected network from the connection record uploaded by the monitoring node, and reproduces the host activities in the entire protected network. The obtained host behavior graph pattern is then serialized and compressed and encoded, and retransmitted to the corresponding monitoring nodes. The monitoring node receives the behavior graph of the relevant host in the local network it is responsible for, decodes and deserializes it, and combines it with the network asset information obtained in step 4), uses the host behavior graph as the infrastructure, and integrates the network traffic information, network asset information, and host log information to generate a fused behavior graph.

[0051] 6) Input the similarity matrix obtained in step 5), i.e. the behavior graph, into the integrated classifier obtained in step 3) to obtain the classification result of the host behavior module. When a suspicious host is found, it is reported to the security management platform. After the platform's security personnel audit the host's behavior pattern, if it is confirmed to be a malicious host, the result is fed back to the monitoring node for response. If it is confirmed to be a normal host, the result is fed back to the model training network for updating the model;

[0052] 7) Response and model update: After the monitoring node receives the feedback, it responds to the malicious host's behavior. After the model training network receives the feedback, it uses the feedback to update the model. The generated new model is also distributed to each monitoring node through the security management platform again. Then repeat the steps of the above model deployment phase.

Claims

1. A scalable network attack detection method based on behavior graph and Weisfeiler Lehman algorithm, characterized in that: The steps include: 1) Building a labeled training network and collecting its asset information: Building a labeled training network and collecting network asset information for the training network. The network asset information includes hosts, routers, switches, servers, and printers. Extract their device types, IP addresses, MAC addresses, systems, and services, build a network asset list, and store it in the database. 2) For the training network obtained in step 1), generate the input of the model to be trained from data collection and cleaning, behavior unit extraction, data reduction, behavior graph embedding and similarity matrix calculation. The specific steps are as follows: 2-1) Traffic capture and automatic sample labeling: Run the training network built in step 1), and capture the network traffic in the training network and automatically label the samples; use TShark or WireShark tools to capture the normal business traffic, background traffic, and attack traffic of the security window respectively. The captured traffic is labeled, and each related host is labeled with the corresponding label. The host used to launch the attack is labeled as a positive sample, that is, a malicious host; The remaining hosts and devices are marked as negative samples, i.e. normal hosts. The marking process is automated based on pre-configured attack scripts. 2-2) Connection record extraction: Extract connection records from the network traffic captured in step 2-1). First, convert the pcap file into a csv feature file through CICFlowMeter to extract the connection records of communication between network devices. The attributes of the connection records include source IP, destination IP, source port, destination port, communication direction, connection status, duration, number of packets sent in the connection, total number of bytes sent in the connection, and response ratio during the communication between the source and destination hosts. 2-3) Data cleaning and attribute discretization: Data cleaning and discretization are performed on the connection records obtained in step 2-2): 2-3-1) Data cleaning: Delete abnormal connection records generated during the operation of the connection record extraction tool, including missing attributes and abnormal types. Missing attributes are supplemented by linear interpolation or directly deleted; 2-3-2) Attribute discretization: Map each attribute of the connection record to a non-overlapping integer interval, that is, attribute discretization corresponds to a mapping D. For attribute F i and F j , satisfying D(F i )→N i * , D(F j )→N j * , and N i * ∩ N j * =∅; the original record contains discrete attributes, including source / destination address, protocol, port, service, status, and communication direction. These attributes are converted into category attributes, that is, the source / destination address contains a large number of IP addresses. After classification, it becomes one of NORMAL_IP, RESERVE_IP, and ERROR_IP. The port becomes RESERVE_PORT, WELL_KONWN_PORT, and OTHER_PROT. The source / destination address is the SrcAddr and DstAddr fields in the connection record. 2-4) Data fusion and generation of behavior units and behavior graphs: Based on the network asset information collected in step 1) and the connection records after cleaning and attribute discretization in step 2-3), data fusion is performed to generate behavior units and behavior graphs. The behavior unit is a graph representation of the connection record, which includes 9 nodes: SrcAddr-Type, DstAddr-Type, State, Dir, Conn_num, Proto, Duration, Totpkts, and SrcBytesRatio. Src and Dst represent the source IP and destination IP, State indicates whether the connection is successful, Dir indicates the direction of communication, Conn_num represents the number of connections established between two hosts in a certain time window, Proto is the connection protocol, Duration is the duration of the connection, Totpkts is the number of packets sent in the time window, and SrcBytesRatio is the ratio of the bytes sent by the source host to the destination host to the total number of bytes in the connection. After obtaining the host behavior unit, the relevant behavior units are associated through the SrcAddr and DstAddr nodes to generate the host behavior graph; 2-5) Reduction based on the number of graph cores: Based on the self-similarity of the network behavior graph, first calculate the self-similarity of the behavior graph of each host obtained in step 2-4) to obtain a summary of the host behavior pattern, and then delete the same pattern. After data reduction, the obtained atlas is a valid atlas, and the valid atlas is used as the subsequent training sample; 3) Model training: Based on the Weisfeiler Lehman algorithm, the valid graph set obtained in steps 2-5) is used as input, and graph embedding is performed end-to-end and similarity is calculated to obtain the graph similarity matrix of the behavior graphs of all hosts. The obtained similarity matrix and labels are used as the input of the ensemble learning method of the algorithm to train the base learners and obtain the ensemble classifier. During the training process, the nested cross-validation method is used to divide the data set. The training set and validation set are used for learner parameter learning, hyperparameter tuning, and base learner aggregation method learning. The test set is used to finally evaluate the effect of the model and finally obtain the ensemble classifier. 4) Collect asset information of unlabeled real networks: Detect unlabeled real networks and collect network asset information. In a real network environment, the label of each device is uncertain. These devices may be normal devices or devices infected by malicious code. 5) Collection and preprocessing of real samples: The traffic in the real network is preprocessed using the method of step 2-2) to step 2-4), and the network asset information in step 4) is used for data fusion, and behavior units and behavior graphs are generated. The graph embedding and similarity matrix calculation are performed end-to-end based on the Weisfeiler Lehman algorithm. At this time, the similarity calculation is performed between the sample to be tested and each training sample; 6) Input the similarity matrix obtained in step 5) into the integrated classifier obtained in step 3) to obtain the classification result of the host behavior module. If the host's behavior pattern is judged to be abnormal, the host corresponding to the behavior graph is a suspicious host, that is, it may be an infected host. The classification result is notified to the security management and corresponding platform, and the security personnel further audit the behavior pattern of the suspicious host; 7) Response and model update: If the suspicious host is determined to be a malicious host by the security personnel, the security management and response platform will deal with the malicious host. If the security personnel determine it to be a safe host, the behavior pattern diagram of the host will be used as a new sample and re-sent to step 3) for retraining to update the model.