Malicious domain name detection method and system based on federated graph model under encrypted DNS protocol
By using federated graph model and graph neural network to detect malicious domain names under the encrypted DNS protocol, combined with federated learning framework, the problem of malicious domain name detection in encrypted DNS scenarios is solved, and the effect of malicious domain name detection under the encrypted DNS protocol is achieved.
Patent Information
- Application Number
- CN202211161856.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-23
- Publication Date
- 2024-11-01
- Estimated Expiration
- 2042-09-23
AI Technical Summary
While ensuring the security of cyberspace, the deployment of the encrypted DNS protocol has cut off the data sources of most existing malicious domain name detection systems, making malicious domain name detection an urgent research issue that needs to be paid attention to and solved in encrypted DNS scenarios.
Using a malicious domain name detection method based on the federated graph model, DNS query graph is constructed by obtaining the client's domain name query behavior, using the graph neural network model to process the domain name text character distribution and query relationship, obtain the representation vector of the domain name node, and through the federated learning framework, Implement collaborative training across clients without sharing local data to improve detection effect.
It realizes accurate and rapid detection of malicious domain names under the encrypted DNS protocol, improves the detection effect of various local detection engines, and solves the problem of malicious domain name detection in encrypted DNS scenarios.
Smart Images

Figure CN115567289B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of network security technology, and in particular to a method and system for detecting malicious domain names based on a federated graph model under an encrypted DNS protocol. Background Art
[0002] To protect user privacy and prevent man-in-the-middle attacks, the Internet Engineering Task Force has approved a variety of encrypted DNS protocols. Among them, protocols such as DNS-over-TLS (DoT, RFC 7585) and DNS-over-HTTPS (DoH, RFC 8484) have been widely deployed and applied in major operating systems, browsers, and large public DNS resolvers. In the encrypted DNS scenario, various third-party organizations, including attackers, network administrators, and security vendors, can no longer obtain client DNS traffic in plain text. Therefore, while alleviating the risks of DNS hijacking, data eavesdropping, and information tampering, the deployment of encrypted DNS protocols also cuts off the data source of most existing malicious domain name detection systems.
[0003] However, attackers have begun to abuse the encrypted DNS protocol to hide their command and control channel communications, data leakage and other malicious behaviors. In summary, the deployment of the encrypted DNS protocol has brought new challenges while ensuring the security of cyberspace. Malicious domain name detection in the encrypted DNS scenario has become a research problem that needs to be paid attention to and solved. At present, the relevant research work on the encrypted DNS scenario mainly focuses on the measurement of protocol deployment and service support, the analysis of protocol deployment cost and operation performance, the design of protocol deployment application strategy, and information leakage attacks against the encrypted DNS protocol. Summary of the invention
[0004] To address the above problems, a malicious domain name detection method and system based on the federated graph model under the encrypted DNS protocol was proposed.
[0005] The first aspect of the present application proposes a malicious domain name detection method based on a federated graph model under an encrypted DNS protocol, including:
[0006] Acquire the domain name query behavior of the client, and construct a DNS query graph according to the domain name query behavior of the client, wherein the DNS query graph includes domain name text character distribution, domain name query relationship and domain name node;
[0007] Processing the domain name text character distribution and the domain name query relationship according to the graph neural network model to obtain a representation vector of the domain name node;
[0008] The graph neural network model is trained, and the representation vector is processed according to the trained graph neural network model to determine the domain name node classification.
[0009] Optionally, the obtaining, according to processing the DNS query graph, a representation vector of a domain name node in the DNS query graph includes:
[0010] For a given DNS query graph G =<V,E,X> , for the node v∈V, the l-th layer graph neural network model is defined as:
[0011]
[0012]
[0013] in, represents the hidden state of node v in layer l, N(v) is the set of neighbor nodes of node v, MSG and AGG represent the message calculation function and aggregation function respectively.
[0014] Optionally, the training of the graph neural network model includes:
[0015] The graph neural network model GNN model is trained using the Adam optimizer through the cross entropy loss function.
[0016] The second aspect of the present application proposes a malicious domain name detection system based on a federated graph model under an encrypted DNS protocol, comprising at least one server and multiple clients, wherein the server and the client adopt a federated learning framework, wherein:
[0017] The client is used to receive and process the first global model and the first global graph representation information sent by the server, and send the local model and the local graph representation information to the server;
[0018] The server is used to receive and process the local model and the local graph representation information, and send the second global model and the second global graph representation information to the client.
[0019] Optionally, the client is further used for:
[0020] Acquire local graph representation information of the client according to the first global model and the local DNS query graph;
[0021] Determining global data similarity based on the local map representation information and the first global map representation information;
[0022] The local information is updated according to the global data similarity and the first global model to determine the local model.
[0023] Optionally, the server is further used for:
[0024] The local model and the local map representation information are processed according to an aggregation strategy, wherein the aggregation strategy introduces the label quantity and the ratio of positive and negative samples.
[0025] In a third aspect of the present application, a computer device is proposed, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method described in any one of the first aspects above is implemented.
[0026] In a fourth aspect of the present application, a non-temporary computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the method described in any one of the first aspects above is implemented.
[0027] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:
[0028] First, we use the graph neural network model to comprehensively analyze the domain character distribution and the query logic relationship between domain names, classify domain name nodes, and accurately and quickly complete malicious domain name detection.
[0029] Secondly, a federated learning framework is adopted to achieve cross-client model collaborative training without sharing the local data of each client, thereby improving the detection effect of each local detection engine.
[0030] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0032] Figure 1 It is a flowchart of a malicious domain name detection method based on a federated graph model under an encrypted DNS protocol according to an exemplary embodiment of the present application;
[0033] Figure 2 is a block diagram of a DNS query diagram shown in an exemplary embodiment of the present application;
[0034] Figure 3 It is a flow chart of a malicious domain name detection system based on a federated graph model under an encrypted DNS protocol shown in an embodiment of the present application;
[0035] Figure 4 It is a workflow diagram of a malicious domain name detection engine based on a federated graph model and a federated learning framework supporting collaborative training between clients implemented in this application;
[0036] Figure 5It is a block diagram of an electronic device. DETAILED DESCRIPTION
[0037] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.
[0038] Figure 1 is a flowchart of a malicious domain name detection method based on a federated graph model under an encrypted DNS protocol according to an exemplary embodiment of the present application, such as Figure 1 As shown, including:
[0039] Step 101, obtain the domain name query behavior of the client, and build a DNS query graph according to the domain name query behavior of the client, the DNS query graph includes domain name text character distribution, domain name query relationship and domain name node.
[0040] In the embodiment of the present application, the following is constructed based on the domain name query behavior of each client: Figure 2 The DNS query graph shown in the figure, the DNS query graph of client i can be formally defined as a directed graph model G i = <V i ,E i ,X i >, where the node set V i Contains all domain names queried by client i, edge e a,b ∈E i Indicates that after domain name a is queried, within time window T G In the query, domain name b is queried, that is, the domain name query relationship, node attribute x a ∈X i Describes the character distribution of domain name a.
[0041] Step 102, processing the domain name text character distribution and the domain name query relationship according to the graph neural network model to obtain the representation vector of the domain name node.
[0042] In the embodiment of the present application, a graph neural network model GNN layer mainly includes two steps, namely message calculation and aggregation. Given a graph G=<V,E,X> , for each node v∈V, each layer of GNN first collects and transforms information from its neighboring nodes, and then updates the node’s representation vector based on the aggregated information.
[0043] In a possible embodiment, an L-layer GNN is used to obtain a representation vector of a node according to its L-hop neighbor view. The l-th layer GNN can be defined as:
[0044]
[0045]
[0046] in, represents the hidden state of node v in layer l, N(v) is the set of neighbor nodes of node v, MSG and AGG represent message calculation function and aggregation function respectively, where the message calculation function is a linear layer, etc., and the aggregation function is operations such as summation, mean or maximum pooling.
[0047] Preferably, the expressive power of the graph neural network model is further improved by adding activation functions such as Sigmoid and ReLu in the message calculation and aggregation steps.
[0048] Step 103: train the graph neural network model, process the representation vector according to the trained graph neural network model GNN, and determine the domain name node classification.
[0049] In an embodiment of the present application, the Adam optimizer is used to train the graph neural network model through the cross entropy loss function. The graph neural network model selected in the present invention is a two-layer GraphSage model.
[0050] The embodiment of the present application uses a graph neural network model to comprehensively classify domain character distribution and query logical relationships between domain names, and accurately and quickly completes malicious domain name detection.
[0051] Figure 3 A malicious domain name detection system based on a federated graph model under an encrypted DNS protocol is shown according to an exemplary embodiment of the present application, comprising at least one server and multiple clients, wherein the server and the client adopt a federated learning framework, wherein:
[0052] The client is used to receive and process the first global model and the first global graph representation information sent by the server, and send the local model and the local graph representation information to the server;
[0053] The server is used to receive and process the local model and the local graph representation information, and send the second global model and the second global graph representation information to the client.
[0054] like Figure 3 and Figure 4 As shown, on the client side, according to the first global model and local DNS query graph G i Get local graph characterization information of the client Representing information based on this map With the first global graph representation Information determines the global data similarity β i ; According to the global data similarity β i With the first global model Update local information and determine the local model W i t+1 .
[0055] On the server side, the local model W is processed according to the aggregation strategy i t+1 Representation information with this map Among them, the aggregation strategy introduces the label quantity and the proportion of positive and negative samples α i .
[0056] Combine the client with the server. Specifically, in the t+1th iteration, the server will use the global model Distribute to the selected client set, then each client uses the local data set to train the model. Considering the communication efficiency, each client will go through multiple training periods in one iteration to update the local model. After that, the client will update the local model parameters W i t+1 Uploaded back to the server. Finally, the server updates the global model to During the process, considering the non-independent and identically distributed characteristics of each client data, this design scheme additionally transmits graph representation information To communicate the data distribution of each client, and in the client local engine model update phase, based on the similarity β between local data and global data i In addition, considering the impact of each client label on model training, the solution of the present invention introduces the label quantity and the positive and negative sample ratio α in the server-side model aggregation process. i In order to weigh the importance of each local detection engine, the local model of the client with more label information and more balanced labeled samples will play a more important role in the global model. The server-side model aggregation solution is formulated as follows:
[0057]
[0058] The embodiment of the present application uses a federated learning framework to achieve cross-client model collaborative training without sharing local data of each client, thereby improving the detection effect of each local detection engine.
[0059] Figure 5A schematic block diagram of an example electronic device 500 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0060] like Figure 5 As shown, the device 500 includes a computing unit 501, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 502 or a computer program loaded from a storage unit 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the device 500 can also be stored. The computing unit 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0061] A number of components in the device 500 are connected to the I / O interface 505, including: an input unit 506, such as a keyboard, a mouse, etc.; an output unit 507, such as various types of displays, speakers, etc.; a storage unit 508, such as a disk, an optical disk, etc.; and a communication unit 509, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 509 allows the device 500 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0062] The computing unit 501 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 501 performs the various methods and processes described above, such as the voice instruction response method. For example, in some embodiments, the voice instruction response method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 508. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 500 via ROM 502 and / or communication unit 509. When the computer program is loaded into RAM 503 and executed by the computing unit 501, one or more steps of the voice instruction response method described above may be performed. Alternatively, in other embodiments, the computing unit 501 may be configured to perform the voice instruction response method in any other appropriate manner (e.g., by means of firmware).
[0063] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0064] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0065] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0066] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0067] The systems and techniques described herein can be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), the Internet, and a blockchain network.
[0068] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server may also be a server of a distributed system, or a server combined with a blockchain.
[0069] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0070] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A malicious domain name detection method based on a federated graph model under an encrypted DNS protocol, characterized in that: include: The domain name query behavior of the client is obtained, and a DNS query graph is constructed according to the domain name query behavior of the client. The DNS query graph includes the domain name text character distribution, the domain name query relationship and the domain name node, wherein the order of the domain name query relationship is a,b Defined as G In the example, the client first queries domain name a, and then queries domain name b; Processing the domain name text character distribution and the domain name query relationship according to the graph neural network model to obtain a representation vector of the domain name node; The graph neural network model is trained, and the representation vector is processed according to the trained graph neural network model GNN to determine the domain name node classification.
2. The method according to claim 1, characterized in that The step of processing the DNS query graph according to the graph neural network model to obtain the representation vector of the domain name node in the DNS query graph includes: For a given DNS query graph G =<V,E,X> , for the node v∈V, the l-th layer graph neural network model is defined as: in, represents the hidden state of node v in layer l, N(v) is the set of neighbor nodes of node v, MSG and AGG represent the message calculation function and aggregation function respectively.
3. The method according to claim 1, characterized in that The training of the graph neural network model comprises: The graph neural network model is trained using the Adam optimizer through the cross entropy loss function.
4. A malicious domain name detection system based on a federated graph model under an encrypted DNS protocol, characterized in that: It includes at least one server and multiple clients, and the server and the client adopt a federated learning framework, wherein: The client is used to receive and process the first global model and the first global graph representation information sent by the server, and send the local model and the local graph representation information to the server; The server is used to receive and process the local model and the local graph representation information, and send the second global model and the second global graph representation information to the client; The client is also used for: Acquire local graph representation information of the client according to the first global model and the local DNS query graph; Determining global data similarity based on the local map representation information and the first global map representation information; Update local information according to the global data similarity and the first global model to determine the local model; The server is also used for: The local model and the local map representation information are processed according to an aggregation strategy, wherein the aggregation strategy introduces the label quantity and the ratio of positive and negative samples.
5. A computer device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method according to any one of claims 1 to 3 is implemented.
6. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 3 is implemented.
Citation Information
Patent Citations
Method for generating domain name detection model based on XGBoost algorithm
CN110147839A
Multi-feature DNS (Domain Name System) and HTTPS (Hyper Text Transfer Protocol Security) combined malicious encrypted traffic identification method
CN110493208A
Malicious domain name detection method and device based on deep learning
CN110798481A
Malicious domain name detection method and device based on heterogeneous graph representation learning
CN112910929A
Malicious domain name community mining method based on graph structure
CN113645240A
