Abnormal traffic identification method, client and server
By decrypting and classifying the network traffic of client devices and establishing a traffic model, the problem of abnormal traffic identification within the local area network is solved, the recognition speed and accuracy are improved, network security analysis is simplified, and network security is enhanced.
Patent Information
- Application Number
- CN202210059656.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-19
- Publication Date
- 2024-11-29
- Estimated Expiration
- 2042-01-19
AI Technical Summary
The existing technology is difficult to identify abnormal traffic within the LAN in a timely manner, resulting in network security issues that cannot be effectively predicted and defended. Traditional firewalls and network leak prevention systems are complexly configured and difficult to identify scale-out attacks.
By decrypting the network traffic of the client device, obtaining the decrypted traffic and network connection information, sending it to the server for classification, establishing traffic models of different categories, using these models to determine whether there is abnormal traffic, and avoiding configuring complex detection strategies. Reduce network throughput and operator workload.
It improves the speed and accuracy of abnormal traffic recognition, simplifies network traffic analysis, reduces recognition difficulty, enhances network security, and avoids the complexity of setting up multiple defense systems.
Smart Images

Figure CN114422242B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data security, and in particular to an abnormal traffic identification method, a client and a server. Background Art
[0002] With the rapid development of computer technology and network technology, the application of computers and networks has penetrated into all walks of life. While people enjoy the convenience brought by computer and network technology, they also have to face the rampant spread of various Trojans, viruses, and malicious software.
[0003] In order to cope with the increasingly prominent network security issues, the existing technology has proposed various security defense technologies and methods, but there are still limitations in the prediction of attack behaviors, active defense and scalability, and it is impossible to identify abnormal traffic in the local area network in a timely manner. Summary of the invention
[0004] The embodiments of the present invention provide an abnormal traffic identification method, a client, and a server, which can improve the abnormal traffic identification speed and enhance the accuracy of abnormal traffic identification.
[0005] In a first aspect, an embodiment of the present invention provides a method for identifying abnormal traffic, which is applied to any client device in a local area network, and the method includes:
[0006] Obtaining network traffic of the client device and collecting network connection information of the network traffic;
[0007] Decrypting the network traffic to obtain decrypted traffic;
[0008] Sending the decrypted traffic and the network connection information to a server, so that the server classifies the network connection information to obtain multiple types of traffic information, and establishing a traffic model corresponding to each type of traffic information according to each type of traffic information;
[0009] Obtaining multiple traffic models sent by the server;
[0010] The multiple traffic models are used to determine whether the decrypted traffic contains abnormal traffic.
[0011] Optionally, decrypting the network traffic to obtain decrypted traffic includes:
[0012] Intercept the public key query request to the server and return the local public key;
[0013] The network traffic is decrypted using a private key corresponding to the local public key to obtain the decrypted traffic.
[0014] Optionally, intercepting a public key query request for the server and returning the local public key includes:
[0015] Using a preset proxy program to intercept the public key query request initiated by the application program to the server;
[0016] The using a private key corresponding to the local public key to decrypt the network traffic to obtain the decrypted traffic includes:
[0017] The proxy program uses a private key corresponding to the local public key to decrypt the network traffic to obtain the decrypted traffic.
[0018] Optionally, before adopting a preset proxy program to intercept the public key query request initiated by the application program to the server, the method further includes:
[0019] Register the agent's root certificate to the system root certificate list.
[0020] Optionally, the method further comprises:
[0021] Using the proxy program to obtain a session key corresponding to the local public key generated by the application;
[0022] The proxy program encrypts the decrypted traffic according to the local public key and the session key and returns the encrypted traffic to the server.
[0023] Optionally, the method further comprises:
[0024] If the decrypted traffic contains abnormal traffic, a log of the abnormal traffic is sent to the server, so that the server updates a corresponding traffic model in the multiple traffic models based on the log of the abnormal traffic.
[0025] In a second aspect, an embodiment of the present invention further provides a method for identifying abnormal traffic, which is applied to a server in a local area network, and the method includes:
[0026] Receiving decrypted traffic and corresponding network connection information sent by each client device in the local area network; the decrypted traffic is traffic obtained by each client device decrypting the acquired network traffic, and the network connection information is connection information of the network traffic collected by each client device;
[0027] Classifying the network connection information to obtain multiple types of traffic information;
[0028] According to each type of traffic information, a traffic model corresponding to each type of traffic information is established;
[0029] A plurality of traffic models are returned to each of the client devices, so that each of the client devices uses the plurality of traffic models to respectively determine whether the decrypted traffic contains abnormal traffic.
[0030] Optionally, the multiple types of traffic information include: traffic content, lateral traffic information, and longitudinal traffic information; correspondingly, the multiple types of traffic models include: traffic content model, lateral traffic model, and longitudinal traffic model; wherein the lateral traffic information is the traffic information between client devices in the local area network, and the longitudinal traffic information is the traffic information between client devices in the local area network and the external Internet;
[0031] The establishing, according to each type of traffic information, a traffic model corresponding to each type of traffic information includes:
[0032] Performing machine learning on the traffic content to obtain the traffic content model;
[0033] Performing machine learning on the lateral flow information to obtain the lateral flow model;
[0034] Machine learning is performed on the longitudinal flow information to obtain the longitudinal flow model.
[0035] In a third aspect, an embodiment of the present invention further provides a client device, comprising: a first receiver, a first processor, a first transmitter and a first bus, wherein the first receiver, the first processor and the first transmitter are connected via the first bus:
[0036] The first receiver is used to obtain the network traffic of the client device and collect network connection information of the network traffic;
[0037] The first processor is used to decrypt the network traffic to obtain decrypted traffic;
[0038] The first transmitter is used to send the decrypted traffic and the network connection information to the server, so that the server classifies the network connection information to obtain multiple types of traffic information, and establishes a traffic model corresponding to each type of traffic information according to each type of traffic information;
[0039] The first receiver is further used to obtain multiple traffic models sent by the server;
[0040] The first processor is further configured to use the multiple traffic models to respectively determine whether the decrypted traffic contains abnormal traffic.
[0041] In a fourth aspect, an embodiment of the present invention further provides a server, comprising: a second receiver, a second processor, a second transmitter, and a second bus, wherein the second receiver, the second processor, and the second transmitter are connected via the second bus:
[0042] The second receiver is used to receive the decrypted traffic and corresponding network connection information of each client device sent by each client device in the local area network; the decrypted traffic is the traffic obtained by each client device decrypting the acquired network traffic, and the network connection information is the connection information of the network traffic collected by each client device;
[0043] The second processor is used to classify the network connection information to obtain multiple types of traffic information; and establish a traffic model corresponding to each type of traffic information according to each type of traffic information;
[0044] The second transmitter is used to return multiple traffic models to each of the client devices, so that each of the client devices uses the multiple traffic models to determine whether the decrypted traffic contains abnormal traffic.
[0045] Compared with the prior art, the present invention provides an abnormal traffic identification method, a client and a server, which decrypt the acquired network traffic of the client device to obtain the decrypted traffic, send the decrypted traffic and network connection information to the server, classify the network connection information and the decrypted traffic to obtain different types of traffic models, and judge whether the decrypted traffic contains abnormal traffic through the traffic model, so that the network traffic can be directly decrypted and analyzed without configuring complex detection strategies, which alleviates the problem of decreased network throughput caused by network traffic analysis and reduces the workload of operators; and various traffic models can be used to judge various abnormal situations, avoiding the simultaneous setting of multiple defense systems to increase the difficulty of identification, and ensuring the accuracy of identification while increasing the efficiency of identifying abnormal traffic. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0047] Figure 1 A schematic diagram of a flow chart of an abnormal traffic identification method provided by the present invention;
[0048] Figure 2A schematic diagram of a flow chart of a network traffic decryption method provided by the present invention;
[0049] Figure 3 A schematic diagram of a flow chart of another network traffic decryption method provided by the present invention;
[0050] Figure 4 A schematic diagram of a flow chart of another network traffic decryption method provided by the present invention;
[0051] Figure 5 A flow chart of another abnormal traffic identification method provided by the present invention;
[0052] Figure 6 A schematic diagram of a flow chart for establishing a traffic model provided by the present invention;
[0053] Figure 7 A schematic diagram of an abnormal flow identification device provided by the present invention;
[0054] Figure 8 A schematic diagram of another abnormal flow identification device provided by the present invention;
[0055] Fig. 9 A schematic diagram of a client device provided by the present invention;
[0056] Fig.10 A schematic diagram of a server provided by the present invention.
[0057] Icon: 1000, first receiving module; 2000, first processing module; 3000, first sending module; 4000, second receiving module; 5000, second processing module; 6000, second sending module; 10, client device; 11, first receiver; 12, first processor; 13, first transmitter; 14, first bus; 20, server; 21, second receiver; 22, second processor; 23, second transmitter; 24, second bus. DETAILED DESCRIPTION
[0058] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0059] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0060] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0061] Before explaining the present invention in detail, the application scenario of the present invention is first introduced.
[0062] In the information society, the importance of computer networks is obvious. The storage and transmission of more and more information and important data resources rely on the network. The information carried on the network is becoming more and more important, but due to the openness of computer networks, the risks of unsafe behaviors and data leakage in the network environment are increasing. Some malicious programs can download advertisements and Trojan programs through the network and install and spread in the local area network. Advertisements and Trojan programs will constantly pop up ads to affect normal work, and there is a risk of remote control and data theft.
[0063] However, traditional network security protection measures such as deploying firewalls and network leakage prevention systems have certain defects. Firewall technology achieves the purpose of curbing attacks by limiting network connections, but it is difficult to discover and solve application-level security issues. In addition, firewall configuration is difficult, and the direction rules can easily be deceived by reverse connections, thereby bypassing the firewall; the network leakage prevention system relies on complex traffic characteristics and regular strategies for identification. Too many strategy configurations will cause traffic analysis to consume a lot of time and reduce network throughput. In addition, the network leakage prevention system cannot identify network attack characteristics and cannot detect horizontal expansion attacks within the LAN.
[0064] Based on this, the present invention provides an abnormal traffic identification method, client and server, which decrypts network traffic information and classifies traffic in combination with network connection information, and determines whether the decrypted traffic information contains abnormal traffic according to different traffic models composed of different types of traffic information, so that the determination of abnormal traffic is faster and more comprehensive. The abnormal traffic identification method provided in the following embodiments of the present invention can be executed by a client device or by a server, the client device can be a mobile communication device or a desktop computer device, and the server can be built by a mobile communication device or a desktop computer device, and the present invention does not limit this.
[0065] The following is an explanation through multiple embodiments in conjunction with the accompanying drawings. Figure 1The following is a flow chart of an abnormal traffic identification method provided by the present invention. Figure 1 As shown, a method for identifying abnormal traffic is applied to any client device in a local area network, comprising:
[0066] S101, obtaining network traffic of a client device and collecting network connection information of the network traffic.
[0067] The collection of network traffic is the basis for abnormal traffic detection and analysis. Before obtaining the network traffic of the client device and collecting the network connection information of the network traffic, you can first build WFP (Windows Filtering Platform) to collect and filter network data.
[0068] WFP is a set of system APIs (Application Programming Interface) and services that provide architectural support for network traffic filtering. Developers can filter, redirect, and modify network traffic in different layers of the WFP framework. The engine of the WFP architecture is roughly divided into application layer filtering modules and kernel layer filtering modules. The application layer filtering module provides callable APIs and RPC (Remote Procedure Call) interfaces to the upper layer, allowing users to use these interfaces to interact with user-mode filtering modules to achieve the purpose of controlling network data.
[0069] Specifically, by loading the WFP network data collection program and the application layer program, network traffic is captured and temporarily stored in the kernel layer space. The application layer continuously obtains the network traffic stored in the kernel state, and at the same time releases the storage space from the kernel to obtain network traffic, and associates the network traffic with the specific process. In this way, the purpose of collecting network traffic and network connection information is achieved.
[0070] The network traffic and network connection information obtained from the kernel is raw information. Before the application layer sends the network traffic and network connection information to the network driver, the raw information needs to be filtered and forwarded. These different raw information can be passed to the corresponding layer through the classification API of the kernel layer's filter module.
[0071] Among them, the filtering module of the kernel layer is the main body of the engine, which contains multiple layers inside, and each layer represents a specific network protocol layer. There are sublayers and filters in each layer. Another important data structure in the filtering engine in the kernel layer is the filter. Users can add their own filters to the WFP framework. The filter sets the filtering rules and processing actions of the network flow. When the filtering engine is working, the kernel layer module will verify whether the network data matches the rules of the existing filters, and if the rules are matched, the corresponding actions will be executed. In the actual development process, a layer can contain one or more filters and sublayers, and these sublayers and filters can each be configured with independent rules and actions.
[0072] Specifically, WFP is set up using a custom function, including: (1) using FwpmEngineOpen to open the WFP filtering engine; (2) using FwpmSubLayerAdd to register the filtering sublayer; (3) using FwpsCalloutRegister to register the callback function, which is used to execute the classification and forwarding logic; (4) using FwpmFilterAdd to insert the sublayer of (2) as a filtering layer into the system layer to filter the system layer.
[0073] The filter sublayers registered in step (2) and their specific descriptions are shown in the following table, which is a correspondence table between each filter layer registered by WFP and the execution action.
[0074] Table 1 Correspondence between each filter layer registered by WFP and the execution action
[0075]
[0076] Table 1 (Continued)
[0077]
[0078] By registering each filtering sublayer and adding filters in the WFP framework, the processing action of each sublayer is set in the filter. At the same time, each filter can be associated with an outbound interface. When data arrives, the user can further detect the network traffic in the outbound interface.
[0079] The WFP framework is used to obtain the network traffic of the client device on the Windows operating system and collect the network connection information of the network traffic. That is, WFP is used to obtain the UDP (User Data Protocol) and TCP (Transmission Control Protocol) stream data related to specific network activities, and these network traffic data and network connection information are further filtered and sorted, and then handed over to the server for analysis. Among them, the network connection information includes the source IP (Internet Protocol), destination IP, source port, destination port, protocol, content ID, user ID, application ID and other information of the traffic.
[0080] S102, decrypt the network traffic to obtain decrypted traffic.
[0081] In order to protect the security of network traffic transmission, the Internet usually uses HTTPS (Hyper Text Transfer Protocol over Secure Socket Layer) based on SSL (Secure Sockets Layer) to encrypt and transmit network traffic data. Therefore, before analyzing the network traffic, it is necessary to decrypt the network traffic, obtain the decrypted network traffic, and then send it to the server.
[0082] S103, sending the decrypted traffic and network connection information to the server, so that the server classifies the network connection information to obtain multiple types of traffic information, and establishes a traffic model corresponding to each type of traffic information according to each type of traffic information.
[0083] After decrypting the network traffic, the client sends the decrypted traffic and network connection information to the server. The server will first divide the network connection information into horizontal connection information and vertical connection information. It will then obtain three types of traffic information: horizontal connection information, vertical connection information, and decrypted network traffic content information, and establish a traffic model corresponding to each type of traffic information.
[0084] In this embodiment, after the client sends the decrypted traffic and network connection information to the server so that the server classifies the network connection information to obtain multiple types of traffic information and establishes a traffic model corresponding to each type of traffic information, the client will also decrypt the preset legal traffic content and send the corresponding preset legal network connection information and the decrypted legal traffic to the server. The server will classify the preset legal network connection information to obtain legal horizontal connection information and legal vertical connection information, and establish corresponding legal horizontal traffic models, legal vertical traffic models, and legal traffic content models based on the legal horizontal connection information, legal vertical connection information, and legal traffic content.
[0085] Specifically, the server uses the K-means algorithm to perform self-similarity analysis on the traffic content, horizontal connection information, and vertical connection information respectively; the K-means algorithm is an unsupervised learning algorithm used in machine learning to cluster network traffic and network connection information. By calculating the distance (self-similarity) between each data point in the network traffic set and the network connection information, the data points with close distances are focused in one cluster, and finally K clusters are formed. The goal of K-means clustering is to divide N network traffic information and network connection information into K clusters according to certain standards, and the data points are divided according to similarity. Each cluster has a centroid, which is the point obtained by averaging the positions of all data points in the cluster. Each data point belongs to the cluster represented by the centroid closest to it. The different clustering models obtained by clustering the network traffic set and network connection information through the K-means algorithm are the traffic models corresponding to each type of traffic information.
[0086] S104, obtaining multiple traffic models sent by the server.
[0087] When the server has established multiple traffic models, it needs to send them to the client device, and the client device obtains multiple traffic models sent by the server. Specifically, the client will obtain the established legal horizontal traffic model, legal vertical traffic model, and legal traffic content model sent by the server in the above steps, and the horizontal traffic model, vertical traffic model, and traffic content model established based on the traffic after this decryption.
[0088] S105, using multiple traffic models to determine whether the decrypted traffic contains abnormal traffic.
[0089] In this embodiment, the server will determine whether the decrypted traffic contains abnormal traffic based on the centroids between the legal lateral traffic model, legal longitudinal traffic model, legal traffic content model and the lateral traffic model, longitudinal traffic model, and traffic content model established by the traffic after this decryption. Specifically, if the change in the distance between the centroid of the model established by the traffic after this decryption and the centroid of the legal traffic model is less than a preset threshold, it is considered that the decrypted traffic does not contain abnormal traffic; if the distance between the centroid of the model established by the traffic after this decryption and the centroid of the legal traffic model exceeds the preset threshold, it is considered that the decrypted traffic contains abnormal traffic.
[0090] In one possible implementation, if the lateral traffic model of a certain IP is abnormal from the legal lateral traffic model, it can be considered that the IP may have a strong penetration attack on the computer in the local area network, and the lateral attack of the IP needs to be blocked; if the longitudinal traffic model of a certain IP is abnormal from the legal longitudinal traffic model, it can be considered that the IP may be attacked by an external computer, and the external IP or domain name needs to be blocked to protect the computer from being attacked; if the traffic content model of a certain IP is abnormal from the legal traffic content model, it can be considered that the IP may have the possibility of leaking confidential data, and the traffic here needs to be blocked.
[0091] In this embodiment, the network traffic of the acquired client device is decrypted to obtain the decrypted traffic, and the decrypted traffic and the network connection information are sent to the server. The server classifies the network connection information and the decrypted traffic to obtain different types of traffic models, and determines whether the decrypted traffic contains abnormal traffic through the traffic model. In this way, there is no need to configure complex detection strategies to directly decrypt and analyze the network traffic, which alleviates the problem of decreased network throughput caused by network traffic analysis and reduces the workload of operators. Various types of abnormal situations can be judged with the help of various traffic models to avoid setting up multiple defense systems at the same time to increase the difficulty of identification, thereby increasing the efficiency of identifying abnormal traffic and ensuring the accuracy of identification.
[0092] In the above Figure 1 On the basis of the provided abnormal traffic identification method, in order to explain the decryption of network traffic, the present invention also provides a flow chart of a network traffic decryption method. Figure 2 The figure is a flow chart of a network traffic decryption method provided by the present invention. Figure 2 As shown, in the above method, S102, decrypting the network traffic to obtain the decrypted traffic includes:
[0093] S201, intercepting the public key query request for the server and returning the local public key.
[0094] S202, using a private key corresponding to the local public key to decrypt the network traffic to obtain decrypted traffic.
[0095] An asymmetric key mechanism is used in the process of establishing SSL. The asymmetric key mechanism has two different keys: a public key and a private key, which separate the encryption function and the decryption function. The public key is open to the public and does not need to be kept confidential, while the private key needs to be kept secret. The asymmetric key encryption algorithm must have the characteristic that a public key is given and it is determined that the private key cannot be inferred from the public key. In this embodiment, in order to decrypt the network traffic of the server in the connection other than the connection with the local end, it is necessary to intercept when the non-local client sends a public key query request to the server, and return the local public key to the non-local client; then when the non-local client uses the local public key to send a request again, the local end can use the private key corresponding to the local public key to decrypt the requested network traffic and obtain the decrypted traffic.
[0096] In this embodiment, by decrypting the asymmetric key encryption system, the local end obtains the decrypted network traffic for analysis.
[0097] In the above Figure 2 Based on the provided network traffic decryption method, the present invention also provides a flow chart of another network traffic decryption method. Figure 3 The following is a flow chart of another network traffic decryption method provided by the present invention. Figure 3 As shown, in the above method, S201, responding to a public key query request for a server and obtaining a local public key includes:
[0098] S310: Using a preset proxy program to intercept a public key query request for a server initiated by an application.
[0099] In the above method, S202 uses a private key corresponding to the local public key to decrypt the network traffic to obtain the decrypted traffic, including:
[0100] S320, the proxy program uses the private key corresponding to the local public key to decrypt the network traffic to obtain the decrypted traffic.
[0101] Specifically, a preset proxy program can be used to proxy the local end. When the non-local client connected to the server is an application, it is a server to the application, and it is a client to the server. The preset proxy program is used to intercept the public key query request initiated by the application to the server, and return the local public key to the application. Then, when the non-local end uses the local public key to make a request again, the proxy program can use the private key corresponding to the local public key to decrypt the requested network traffic and obtain the decrypted traffic.
[0102] In this embodiment, the proxy server acts as a middleman between the application and the server, and can monitor and analyze the data between the application and the server while transmitting data, thereby achieving decryption of network traffic.
[0103] In the above Figure 3 Another network traffic decryption method provided is based on Figure 3 As shown, in S310 of the above method, before using a preset proxy program to intercept a public key query request initiated by an application program to a server, the method includes:
[0104] S301, registering the root certificate of the agent program into the system root certificate list.
[0105] In order to prevent the above decryption action from being blocked by the application warning, the root certificate of the agent program needs to be registered in advance to the root certificate list of the system where the application is located.
[0106] Specifically, first generate a private key pair for the root certificate, then generate the root certificate, and import the certificate into the list of trusted root certificate authorities.
[0107] In one possible implementation, the root certificate can be registered using an open source software library package based on the following steps: (1) Use RSA_generate_key to create an RSA private key, and use EVP_PKEY_assign_RSA to bind the generated RSA private key to the EVP_PKEY structure; (2) Use X509_new to create an X509 memory certificate; (3) Fill the X509 certificate, including using X509_set_pubkey to write the RSA public key in the EVP_PKEY structure in (1) to the root certificate. Import the X509 certificate, use X509_set_version to set the version number of the X509 certificate, use X509_get_serialNumber to set the serial number of the X509 certificate, use X509_gmtime_adj to set the validity period of the X509 certificate, use X509_set_issuer_name to set the issuer, and use X509_set_subject_name to set the subject to be the same as the issuer; (4) Use X509_sign to sign the above X509 certificate.
[0108] After registration is complete, use CertOpenStore to open the certificate storage control of the system where the application is located, and use CertAddEncodedCertificateToStore to import the above-generated X509 certificate into the list of trusted root certificate authorities.
[0109] In this embodiment, the root certificate of the proxy process is registered in the system root certificate list to ensure the legitimacy of the application and avoid the decryption action being warned by the application system.
[0110] In the above Figure 3 Based on another provided network traffic decryption method, the present invention also provides a network traffic decryption method. Figure 4 The following is a flow chart of another network traffic decryption method provided by the present invention. Figure 4 As shown, the above method includes:
[0111] S401, using an agent program to obtain a session key corresponding to a local public key generated by an application.
[0112] After using the preset proxy program to intercept the public key query request initiated by the application to the server, the proxy program returns the local public key to the application. When the application establishes a session with the server, it will use the session key encrypted based on the local public key. The proxy program is used to intercept and obtain the session key corresponding to the local public key generated by the application.
[0113] S402, the proxy program encrypts the decrypted traffic according to the local public key and the session key and returns it to the server.
[0114] In this embodiment, after intercepting the public key query request, the proxy program will also send a formal request to the server to obtain the server's public key and cache it in the proxy program.
[0115] After the proxy program obtains the session key corresponding to the local public key, it can use the private key corresponding to the local public key to decrypt the session key and obtain the decrypted traffic. It can then use the public key of the server cached in the proxy program to encrypt the decrypted traffic and return it to the server to complete the application's request without being perceived.
[0116] In this embodiment, the proxy program makes the decryption action more covert by replacing the public key, and obtains the decrypted traffic without being detected.
[0117] Based on the above embodiment, the method further includes:
[0118] S501, if the decrypted traffic contains abnormal traffic, a log of the abnormal traffic is sent to a server, so that the server updates a corresponding traffic model in a plurality of traffic models based on the log of the abnormal traffic.
[0119] After using multiple traffic models to determine whether the decrypted traffic contains abnormal traffic, if the decrypted traffic contains abnormal traffic, the client sends the abnormal traffic log to the server, so that the server updates the corresponding traffic model in the multiple traffic models based on the abnormal traffic log. Specifically, based on the log content of the abnormal traffic, the update of the multiple traffic models depends on the legal traffic content and legal traffic connection information collected in advance by the client, and the specific update process is consistent with the initial traffic modeling process.
[0120] In a possible implementation, an agent program can be used to block abnormal network connection information and traffic content. When there is abnormal network connection information and, the agent program can notify the WFP filter driver to return FWP_ACTION_BLOCK to the WFP engine, thereby blocking this connection.
[0121] In another possible implementation, the server also includes a blacklist. The blacklist is composed based on previous abnormal traffic logs, including source IP, destination IP, source port, and destination port. The server can send the blacklist to the client so that the client directly blocks some abnormal traffic and abnormal connection content according to the blacklist.
[0122] In this embodiment, corresponding traffic models in multiple traffic models are updated based on logs of abnormal traffic, so as to achieve more accurate identification of abnormal traffic and prevent network attacks.
[0123] Figure 5 FIG. 1 is a flow chart of another abnormal traffic identification method provided by the present invention. Figure 5 As shown, an abnormal traffic identification method is applied to a server in a local area network, comprising:
[0124] S610, receiving decrypted traffic and corresponding network connection information sent by each client device in the local area network.
[0125] When the client collects network traffic and network connection information and decrypts the network traffic, it sends the decrypted traffic to the server for analysis. The server receives the decrypted traffic and corresponding network connection information sent by each client device in the local area network.
[0126] S620: Classify the network connection information to obtain multiple types of traffic information.
[0127] The server will first divide the network connection information into horizontal connection information and vertical connection information, and then obtain three types of traffic information: horizontal connection information, vertical connection information, and decrypted network traffic content information.
[0128] S630: Establish a traffic model corresponding to each type of traffic information according to each type of traffic information.
[0129] The server obtains multiple types of traffic information, and establishes a traffic model corresponding to each type of traffic information according to each type of traffic information, that is, establishes a horizontal traffic model, a vertical traffic model, and a traffic content model.
[0130] S640, returning multiple traffic models to each client device, so that each client device uses multiple traffic models to determine whether the decrypted traffic contains abnormal traffic.
[0131] The server returns multiple traffic models to each client device through Websocket (a full-duplex communication protocol), so that each client device uses multiple traffic models to determine whether the decrypted traffic contains abnormal traffic.
[0132] In this embodiment, the server classifies the network connection information, models the network traffic content and the classified network connection information, and sends the model to the client to facilitate the client to determine whether there is abnormal traffic in the current network traffic content and the classified network connection information, thereby improving the efficiency of detecting abnormal traffic and ensuring network security.
[0133] In the above Figure 5 Based on another network traffic decryption method provided, the present invention also provides a method for establishing a traffic model. Figure 6 A flow chart of establishing a traffic model provided by the present invention. Figure 6 As shown, the above method includes:
[0134] S631, perform machine learning on the traffic content to obtain a traffic content model.
[0135] S632, performing machine learning on the lateral flow information to obtain a lateral flow model.
[0136] S633, performing machine learning on the longitudinal flow information to obtain a longitudinal flow model.
[0137] Among them, the multiple types of traffic information include: traffic content, horizontal traffic information, and vertical traffic information; correspondingly, the multiple types of traffic models include: traffic content model, horizontal traffic model and vertical traffic model; among them, the horizontal traffic information is the traffic information between each client device in the local area network, and the vertical traffic information is the traffic information between the client device in the local area network and the external Internet.
[0138] In this embodiment, the K-means algorithm is used for machine learning. Specifically, the server uses the K-means algorithm to perform self-similarity analysis on the traffic content, horizontal connection information, and vertical connection information respectively; the K-means algorithm is an unsupervised learning algorithm used in machine learning to cluster network traffic and network connection information. By calculating the distance (self-similarity) between each data point in the network traffic set and the network connection information, the data points with close distances are focused in one cluster, and finally K clusters are formed. The goal of K-means clustering is to divide N network traffic information and network connection information into K clusters according to certain standards, and the data points are divided according to similarity. Each cluster has a centroid, which is the point obtained by averaging the positions of all data points in the cluster. Each data point belongs to the cluster represented by the centroid closest to it. The different clustering models obtained by clustering the network traffic set and network connection information through the K-means algorithm are the traffic models corresponding to each type of traffic information. That is, the traffic content is subjected to machine learning based on the K-means algorithm to obtain the traffic content model; the horizontal traffic information is subjected to machine learning based on the K-means algorithm to obtain the horizontal traffic model; the vertical traffic information is subjected to machine learning based on the K-means algorithm to obtain the vertical traffic model.
[0139] In this embodiment, by using machine learning to build a traffic model, the judgment of abnormal traffic can be continuously improved through machine learning, thereby improving the efficiency of abnormal traffic identification.
[0140] Figure 7 A schematic diagram of an abnormal flow identification device provided by the present invention, such as Figure 7 As shown, the abnormal traffic identification device is applied to any client device in a local area network, and includes:
[0141] The first receiving module 1000 is used to obtain the network traffic of the client device and collect the network connection information of the network traffic;
[0142] The first processing module 2000 is used to decrypt the network traffic to obtain the decrypted traffic;
[0143] The first sending module 3000 is used to send the decrypted traffic and network connection information to the server, so that the server classifies the network connection information to obtain multiple types of traffic information, and establishes a traffic model corresponding to each type of traffic information according to each type of traffic information;
[0144] The first receiving module 1000 is also used to obtain multiple traffic models sent by the server;
[0145] The first processing module 2000 is further used to use multiple traffic models to respectively determine whether the decrypted traffic contains abnormal traffic.
[0146] Optionally, the first processing module 2000 is further specifically used to intercept a public key query request for the server and return the local public key; use a private key corresponding to the local public key to decrypt the network traffic to obtain the decrypted traffic.
[0147] Optionally, the first processing module 2000 is specifically used to use a preset proxy program to intercept a public key query request initiated by an application to a server; use a private key corresponding to the public key of the local end to decrypt the network traffic to obtain the decrypted traffic, including: the proxy program uses the private key corresponding to the public key of the local end to decrypt the network traffic to obtain the decrypted traffic.
[0148] Optionally, the first processing module 2000 is further configured to register the root certificate of the proxy process into a system root certificate list.
[0149] Optionally, the first processing module 2000 is further specifically used to use a proxy program to obtain a session key corresponding to a local public key generated by an application; the proxy program encrypts the decrypted traffic according to the local public key and the session key and returns the decrypted traffic.
[0150] Optionally, the first sending module 3000 is further used to send a log of the abnormal traffic to the server if the decrypted traffic contains abnormal traffic, so that the server updates a corresponding traffic model in multiple traffic models based on the log of the abnormal traffic.
[0151] Figure 8 A schematic diagram of another abnormal flow identification device provided by the present invention, such as Figure 8 As shown, the abnormal traffic identification device is applied to a server in a local area network, and includes:
[0152] The second receiving module 4000 is used to receive the decrypted traffic and corresponding network connection information of each client device sent by each client device in the local area network; the decrypted traffic is the traffic obtained by each client device decrypting the acquired network traffic, and the network connection information is the connection information of the network traffic collected by each client device;
[0153] The second processing module 5000 is used to classify the network connection information; and establish a traffic model corresponding to each type of traffic information according to each type of traffic information;
[0154] The second sending module 6000 is used to return multiple traffic models to each client device, so that each client device uses multiple traffic models to determine whether the decrypted traffic contains abnormal traffic.
[0155] Optionally, the second processing module 5000 is further used to perform machine learning on the traffic content to obtain a traffic content model; perform machine learning on the horizontal traffic information to obtain a horizontal traffic model; and perform machine learning on the vertical traffic information to obtain a vertical traffic model.
[0156] The above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASIC), or one or more digital signal processors (DSP), or one or more field programmable gate arrays (FPGA). For another example, when a module is implemented in the form of a processing element scheduling program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0157] Fig. 9 A schematic diagram of a client device provided by the present invention, wherein the client device may be a computing device or a server with computing and processing functions.
[0158] The client device 10 includes: a first receiver 11, a first processor 12, a first transmitter 13 and a first bus 14, wherein the first receiver 11, the first processor 12 and the first transmitter 13 are connected via the first bus 14;
[0159] A first receiver 11 is used to obtain network traffic of a client device and collect network connection information of the network traffic;
[0160] The first processor 12 is used to decrypt the network traffic and obtain the decrypted traffic;
[0161] The first transmitter 13 is used to send the decrypted traffic and network connection information to the server, so that the server classifies the network connection information to obtain multiple types of traffic information, and establishes a traffic model corresponding to each type of traffic information according to each type of traffic information.
[0162] The first receiver 11 is also used to obtain multiple traffic models sent by the server;
[0163] The first processor 12 is further configured to use a plurality of traffic models to respectively determine whether the decrypted traffic contains abnormal traffic.
[0164] Optionally, the first processor 12 is further configured to intercept a public key query request for the server, return a local public key, and decrypt network traffic using a private key corresponding to the local public key to obtain decrypted traffic.
[0165] Optionally, the first processor 12 is further specifically used to use a preset proxy program to intercept a public key query request initiated by an application to a server; use a private key corresponding to the public key of the local end to decrypt the network traffic to obtain the decrypted traffic, including: the proxy program uses the private key corresponding to the public key of the local end to decrypt the network traffic to obtain the decrypted traffic.
[0166] Optionally, the first processor 12 is further configured to register the root certificate of the proxy process into a system root certificate list.
[0167] Optionally, the first processor 12 is further configured to use a proxy program to obtain a session key corresponding to a local public key generated by an application; the proxy program encrypts the decrypted traffic according to the local public key and the session key and returns the decrypted traffic.
[0168] Optionally, the first transmitter 13 is further configured to send a log of the abnormal traffic to the server if the decrypted traffic contains abnormal traffic, so that the server updates a corresponding traffic model in the multiple traffic models based on the log of the abnormal traffic.
[0169] In a possible implementation, the client device 10 further includes a first storage medium on which program instructions executable by the first processor 12 are stored. When the client device 10 is running, the first processor 12 executes the program instructions to implement the above embodiment.
[0170] Fig.10 A schematic diagram of a server provided by the present invention, which may be a computing device or server with computing and processing functions.
[0171] The server 20 includes: a second receiver 21, a second processor 22, a second transmitter 23 and a second bus 24, and the second receiver 21, the second processor 22 and the second transmitter 23 are connected via the second bus 24;
[0172] The second receiver 21 is used to receive the decrypted traffic and corresponding network connection information of each client device sent by each client device in the local area network; the decrypted traffic is the traffic obtained by each client device decrypting the acquired network traffic, and the network connection information is the connection information of the network traffic collected by each client device;
[0173] The second processor 22 is used to classify the network connection information to obtain multiple types of traffic information; and establish a traffic model corresponding to each type of traffic information according to each type of traffic information;
[0174] The second transmitter 23 is used to return multiple traffic models to each client device, so that each client device uses multiple traffic models to determine whether the decrypted traffic contains abnormal traffic.
[0175] Optionally, the second processor 22 is further used to perform machine learning on the traffic content to obtain a traffic content model; perform machine learning on the horizontal traffic information to obtain a horizontal traffic model; and perform machine learning on the vertical traffic information to obtain a vertical traffic model.
[0176] In a possible implementation, the server 20 further includes a second storage medium on which program instructions executable by the second processor 22 are stored. When the server 20 is running, the second processor 22 executes the program instructions to implement the above embodiment.
[0177] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0178] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0179] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0180] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (English: Processor) to perform some steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (English: Read-Only Memory, abbreviated: ROM), random access memory (English: Random Access Memory, abbreviated: RAM), disk or optical disk and other media that can store program codes.
[0181] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention 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 identifying abnormal traffic, characterized in that: Applied to any client device in a local area network, the method comprises: Obtaining network traffic of the client device and collecting network connection information of the network traffic; Decrypting the network traffic to obtain decrypted traffic; Sending the decrypted traffic and the network connection information to a server, so that the server classifies the network connection information to obtain multiple types of traffic information, and establishing a traffic model corresponding to each type of traffic information according to each type of traffic information; the multiple types of traffic information include: traffic content, horizontal traffic information, and vertical traffic information; The traffic model corresponding to each type of traffic information is a different clustering model obtained by clustering the network traffic and the network connection information, each of the clustering models has a centroid, and the centroid is a point obtained by averaging the positions of all data points in the clustering model; Obtain multiple traffic models sent by the server; the multiple traffic models include: a legal lateral traffic model, a legal longitudinal traffic model, a legal traffic content model, a lateral traffic model established based on the traffic after the decryption, a longitudinal traffic model, and a traffic content model; Using the multiple traffic models, respectively determining whether the decrypted traffic contains abnormal traffic; The using the multiple traffic models to respectively determine whether the decrypted traffic contains abnormal traffic includes: Based on the legal lateral traffic model, the legal longitudinal traffic model, the legal traffic content model, the lateral traffic model, the longitudinal traffic model, and the centroid between the traffic content model, determine whether the decrypted traffic contains abnormal traffic.
2. The method according to claim 1, characterized in that Decrypting the network traffic to obtain decrypted traffic includes: Intercept the public key query request to the server and return the local public key; The network traffic is decrypted using a private key corresponding to the local public key to obtain the decrypted traffic.
3. The method according to claim 2, characterized in that The interception of the public key query request for the server and the return of the local public key include: Using a preset proxy program to intercept the public key query request initiated by the application program to the server; The using a private key corresponding to the local public key to decrypt the network traffic to obtain the decrypted traffic includes: The proxy program uses a private key corresponding to the local public key to decrypt the network traffic to obtain the decrypted traffic.
4. The method according to claim 3, characterized in that Before the preset proxy program is used to intercept the public key query request initiated by the application program to the server, the method further includes: Register the agent's root certificate to the system root certificate list.
5. The method according to claim 3, characterized in that: The method further comprises: Using the proxy program to obtain a session key corresponding to the local public key generated by the application; The proxy program encrypts the decrypted traffic according to the local public key and the session key and returns the encrypted traffic to the server.
6. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: If the decrypted traffic contains abnormal traffic, a log of the abnormal traffic is sent to the server, so that the server updates a corresponding traffic model in the multiple traffic models based on the log of the abnormal traffic.
7. A method for identifying abnormal traffic, characterized in that: Applied to a server in a local area network, the method comprises: Receiving decrypted traffic and corresponding network connection information sent by each client device in the local area network; the decrypted traffic is traffic obtained by each client device decrypting the acquired network traffic, and the network connection information is connection information of the network traffic collected by each client device; Classifying the network connection information to obtain multiple types of flow information; the multiple types of flow information include: flow content, horizontal flow information, and vertical flow information; According to each type of traffic information, a traffic model corresponding to each type of traffic information is established; The traffic model corresponding to each type of traffic information is a different clustering model obtained by clustering the network traffic and the network connection information, each of the clustering models has a centroid, and the centroid is a point obtained by averaging the positions of all data points in the clustering model; Return multiple traffic models to each client device so that each client device uses the multiple traffic models to determine whether the decrypted traffic contains abnormal traffic; the multiple traffic models include: a legal lateral traffic model, a legal longitudinal traffic model, a legal traffic content model, a lateral traffic model established based on the traffic after this decryption, a longitudinal traffic model, and a traffic content model; the multiple traffic models are used to enable the client device to determine whether the decrypted traffic contains abnormal traffic based on the legal lateral traffic model, the legal longitudinal traffic model, the legal traffic content model, the lateral traffic model, the longitudinal traffic model, and the traffic content model. The centroid.
8. The method according to claim 7, characterized in that The multiple types of traffic information include: traffic content, horizontal traffic information, and vertical traffic information; correspondingly, the multiple types of traffic models include: traffic content model, horizontal traffic model, and vertical traffic model; wherein the horizontal traffic information is the traffic information between the client devices in the local area network, and the vertical traffic information is the traffic information between the client devices in the local area network and the external Internet; The establishing, according to each type of traffic information, a traffic model corresponding to each type of traffic information includes: Performing machine learning on the traffic content to obtain the traffic content model; Performing machine learning on the lateral flow information to obtain the lateral flow model; Machine learning is performed on the longitudinal flow information to obtain the longitudinal flow model.
9. A client device, characterized in that: include: A first receiver, a first processor, a first transmitter and a first bus, wherein the first receiver, the first processor and the first transmitter are connected via the first bus: The first receiver is used to obtain the network traffic of the client device and collect network connection information of the network traffic; The first processor is used to decrypt the network traffic to obtain decrypted traffic; The first transmitter is used to send the decrypted traffic and the network connection information to the server, so that the server classifies the network connection information to obtain multiple types of traffic information, and establishes a traffic model corresponding to each type of traffic information according to each type of traffic information; The multiple types of flow information include: flow content, horizontal flow information, and vertical flow information; The traffic model corresponding to each type of traffic information is a different clustering model obtained by clustering the network traffic and the network connection information, each of the clustering models has a centroid, and the centroid is a point obtained by averaging the positions of all data points in the clustering model; The first receiver is further used to obtain multiple traffic models sent by the server; the multiple traffic models include: a legal lateral traffic model, a legal longitudinal traffic model, a legal traffic content model, a lateral traffic model established based on the traffic after the decryption, a longitudinal traffic model, and a traffic content model; The first processor is further configured to use the multiple traffic models to respectively determine whether the decrypted traffic contains abnormal traffic; The using the multiple traffic models to respectively determine whether the decrypted traffic contains abnormal traffic includes: Based on the legal lateral traffic model, the legal longitudinal traffic model, the legal traffic content model, the lateral traffic model, the longitudinal traffic model, and the centroid between the traffic content model, determine whether the decrypted traffic contains abnormal traffic.
10. A server, characterized in that: include: A second receiver, a second processor, a second transmitter and a second bus, wherein the second receiver, the second processor and the second transmitter are connected via the second bus: The second receiver is used to receive the decrypted traffic and corresponding network connection information of each client device sent by each client device in the local area network; The decrypted traffic is traffic obtained by decrypting the acquired network traffic by each client device, and the network connection information is connection information of the network traffic collected by each client device; The second processor is used to classify the network connection information to obtain multiple types of traffic information; The multiple types of traffic information include: traffic content, horizontal traffic information, and vertical traffic information; according to each type of traffic information, a traffic model corresponding to each type of traffic information is established; The traffic model corresponding to each type of traffic information is a different clustering model obtained by clustering the network traffic and the network connection information, each of the clustering models has a centroid, and the centroid is a point obtained by averaging the positions of all data points in the clustering model; The second transmitter is used to return multiple traffic models to each client device, so that each client device uses the multiple traffic models to respectively determine whether the decrypted traffic contains abnormal traffic; the multiple traffic models include: a legal horizontal traffic model, a legal vertical traffic model, a legal traffic content model, a horizontal traffic model established based on the traffic after this decryption, a vertical traffic model, and a traffic content model; the multiple traffic models are used to enable the client device to determine whether the decrypted traffic contains abnormal traffic based on the legal horizontal traffic model, the legal vertical traffic model, the legal traffic content model, the horizontal traffic model, the vertical traffic model, and the traffic content model. The centroid.
Citation Information
Patent Citations
USB (universal serial bus) Key based secure data transmission method and system
CN103546289A
Network connectivity checking method, device, computer device, and storage medium
CN109257254A
Abnormal flow detection method and device
CN109818976A
Method for calling computer external equipment across browsers based on local proxy service
CN110764846A
A system for cross-network traffic analysis
CN110912943A
