[go: up one dir, main page]

WO2022104738A1 - Trojan detection method and apparatus, and device - Google Patents

Trojan detection method and apparatus, and device Download PDF

Info

Publication number
WO2022104738A1
WO2022104738A1 PCT/CN2020/130593 CN2020130593W WO2022104738A1 WO 2022104738 A1 WO2022104738 A1 WO 2022104738A1 CN 2020130593 W CN2020130593 W CN 2020130593W WO 2022104738 A1 WO2022104738 A1 WO 2022104738A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
packet
dns
address
query
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2020/130593
Other languages
French (fr)
Chinese (zh)
Inventor
那键
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to PCT/CN2020/130593 priority Critical patent/WO2022104738A1/en
Priority to CN202080004649.4A priority patent/CN112640392B/en
Publication of WO2022104738A1 publication Critical patent/WO2022104738A1/en
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/02Network architectures or network communication protocols for network security for separating internal from external traffic, e.g. firewalls
    • H04L63/0227Filtering policies
    • H04L63/0236Filtering by address, protocol, port number or service, e.g. IP-address or URL
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/45Network directories; Name-to-address mapping
    • H04L61/4505Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols
    • H04L61/4511Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols using domain name system [DNS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/14Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic
    • H04L63/1408Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic by monitoring network traffic
    • H04L63/1425Traffic logging, e.g. anomaly detection
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/14Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic
    • H04L63/1441Countermeasures against malicious traffic
    • H04L63/145Countermeasures against malicious traffic the attack involving the propagation of malware through the network, e.g. viruses, trojans or worms

Definitions

  • the present application relates to the field of communications, and in particular, to a Trojan horse detection method, device and device.
  • Tunneling technology is an important method to improve the stability and security of network protocol (Internet Protocol, IP) data transmission.
  • IP Internet Protocol
  • Commonly used tunneling transmission protocols in tunneling technology include: Internet Protocol Security (IPsec), general routing encapsulation (Generic Routing Encapsulation, GRE), Point to Point Tunneling Protocol (Point to Point Tunneling Protocol, PPTP), etc.
  • IPsec Internet Protocol Security
  • GRE General Routing Encapsulation
  • GRE General Routing Encapsulation
  • Point to Point Tunneling Protocol Point to Point Tunneling Protocol
  • PPTP Point to Point Tunneling Protocol
  • a network Trojan is a piece of malicious code hidden in a network system. It has the functions of destroying and deleting files, sending passwords, keylogging and other functions. It is a backdoor program with special hacking functions. Its English name is Trojan (Troy), which means a success in the battle of Troy in ancient Greece. Tactics, attackers can use network Trojans to lurk in the attacked system for a long time and continuously obtain sensitive information of users. Due to its
  • the present application provides a Trojan horse detection method, device and equipment for solving the above-mentioned technical problems, specifically, the following technical solutions are disclosed:
  • the present application provides a Trojan horse detection method, the method includes: receiving a first query packet from a source end, where the first query packet includes the IP address of the source end, when the first query packet conforms to the DNS protocol specification, obtain the first response packet corresponding to the first query packet; parse the first response packet to obtain at least one destination IP address; if there is no difference between the source IP address and the at least one destination IP address If there is a data packet, it is determined that there is a DNS tunnel Trojan horse between the source end and the destination end.
  • the first response packet is sent by the DNS server, and the at least one destination IP address belongs to the destination terminal.
  • the method can detect whether there is a DNS tunnel Trojan hidden in the data stream conforming to the DNS protocol specification, and solves the problem that the intrusion detection system based on general rules cannot find the DNS tunnel Trojan with high concealment.
  • this method can avoid the detection method based on machine learning, which requires a large number of samples to be learned, and at the same time, there are inevitably the problems of false negatives and false positives, and the function of the DNS protocol itself does not need to be combined in the detection process. It will not affect the detection effect.
  • the above method further includes: if there is a data packet between the source IP address and each of the at least one destination IP address, Then it is determined that there is no DNS tunnel Trojan horse between the source end and the destination end.
  • the method before acquiring the first response packet corresponding to the first query packet, the method further includes: acquiring the first data packet collected in the first detection period Set, the first data packet set includes at least the data packets of the DNS protocol type;
  • the receiving the first inquiry packet from the source includes: filtering out all DNS data packets from the first data packet set through the target port, where the DNS data packets include inquiry packets and response packets;
  • the first query packet is filtered out of the packet.
  • the target port is port 53 of UDP.
  • This implementation can filter out all DNS data packets through the target port, thereby providing a basis for detecting whether there are DNS data packets in the tunnel in the subsequent transmission of DNS data packets.
  • the first query packet conforms to the data packet of the DNS protocol specification, including: a length indication field carried in the first query packet and a data packet located in the The actual data length after the length indication field is consistent.
  • the above method further includes: if the length indication field carried in the first query packet is inconsistent with the actual data length after the length indication field, determining that the first query packet does not conform to the DNS protocol specification.
  • This implementation uses the content of the pcap file in the parsed data packet to obtain the data structure and content, thereby judging whether the parsed data structure and content conform to the DNS protocol specification, and then screen out all the data packets conforming to the DNS protocol specification.
  • the method when it is determined that the first query packet does not conform to the DNS protocol specification, the method further includes: acquiring the source IP address The requested domain name, the domain name is represented by a preset character string; it is judged whether there are characters other than ASCII codes in the domain name represented by the preset character string; There is a DNS tunneling Trojan.
  • the above method further includes: if there are no characters other than the ASCII code, acquiring a first response packet corresponding to the first query packet Analyzing the first response packet to obtain the first data, comprising data type and length in the first data, and judging whether the data type and length included in the first data all meet the DNS protocol specification; If all meet, then Make sure there is no DNS tunneling Trojan.
  • the above method further includes: if at least one of the data type and length contained in the first data does not conform to the DNS protocol specification, determining that there is a DNS tunneling Trojan horse.
  • the method realizes the detection of the DNS tunnel Trojan horse in the data stream that does not conform to the DNS protocol specification, and can accurately find the hidden tunnel Trojan horse in the case of network abnormality or DNS server error, and there is no false positive or false negative. Under the premise of normal network communication, as long as abnormal data packets or packets that do not meet the DNS requirements are found, it can quickly detect whether there is a DNS tunnel Trojan in the tunnel.
  • the data packets are all data packets in the first detection period, or, from the time after the first response packet is detected to the first detection period. All packets collected at the end of a detection period.
  • all the data packets in the first detection period are also called the first data packet set, which are all the data packets collected from the first response packet detected to the end of the first detection period, also called the first data packet set.
  • Two-packet set are all the data packets collected from the first response packet detected to the end of the first detection period.
  • the present application also provides a Trojan horse detection device, the device includes: a collection unit, an analysis unit, a determination unit, and the like,
  • the collecting unit is configured to receive a first query packet from the source end, where the first query packet includes the IP address of the source end, and the parsing unit is configured to obtain and obtain the corresponding information when the first query packet conforms to the DNS protocol specification of the Domain Name System.
  • the first response packet corresponding to the first query packet, the first response packet is sent by the DNS server; the determining unit is used for there is no data between the source IP address and the at least one destination IP address. In the case of the packet, it is determined that there is a DNS tunnel Trojan horse between the source end and the destination end.
  • the determining unit is further configured to have data between the source IP address and each of the at least one destination IP address. In the case of the packet, it is determined that there is no DNS tunnel Trojan horse between the source end and the destination end.
  • the collection unit is further configured to acquire a first set of data packets collected in the first detection period, where at least one of the first set of data packets is Including data packets of the DNS protocol type; the parsing unit is further configured to filter out all DNS data packets from the first data packet set through the target port, and select the first query packet from all DNS data packets,
  • the DNS data packets include query packets and response packets.
  • the parsing unit is specifically configured to, when the length indication field carried in the first query packet and the actual data located after the length indication field When the lengths are the same, it is determined that the first query packet conforms to the DNS protocol specification.
  • the parsing unit is further configured to, when the length indication field carried in the first query packet and the length indication field located after the length indication field When the actual data lengths are inconsistent, it is determined that the first query packet does not conform to the DNS protocol specification.
  • the parsing unit is further configured to obtain the source end when it is determined that the first query packet does not conform to the DNS protocol specification
  • the domain name requested by the IP address, the domain name is represented by a preset character string; it is judged whether there are characters other than ASCII codes in the domain name represented by the preset character string, and if so, determine the source end to the destination There is a DNS tunneling Trojan between the endpoints.
  • the parsing unit is further configured to obtain a query packet corresponding to the first query packet in the absence of characters other than the ASCII code.
  • the first response packet which parses the first response packet to obtain first data, where the first data includes a data type and a length; the determining unit is further configured to determine whether the data type and length in the first data are equal.
  • the determining unit is further configured to when at least one of the data type and length in the first data does not conform to the DNS protocol specification , it is determined that there is a DNS tunneling Trojan.
  • the data packets are all data packets in the first detection period, or, after the detection of the first response packet All data packets collected from the beginning to the end of the first detection period.
  • the present application provides a detection device, the device includes a processor and a memory, and the processor is coupled to the memory, specifically, the memory is used to store computer program instructions; the processor is used to execute the instructions stored in the memory. , so that the detection device executes the aforementioned first aspect and the methods in various implementations of the first aspect.
  • each unit module in the second aspect above such as the collection unit, the analysis unit, and the determination unit, may be implemented by the processor and the memory.
  • the detection device is a processing chip or a chip system.
  • the detection device is a network device, or a functional module deployed in the network device.
  • the apparatus may also include at least one communication interface, transceiver, sensor and other components.
  • the present application also provides a computer-readable storage medium, in which instructions are stored, so that when the instructions are executed on a computer or a processor, the instructions can be used to execute the foregoing first aspect and each of the first aspects. method in an implementation.
  • the present application also provides a computer program product, the computer program product includes computer instructions, when the instructions are executed by a computer or a processor, the aforementioned first aspect or the method in various implementation manners of the first aspect can be implemented .
  • beneficial effects corresponding to the technical solutions of the various implementation manners of the second aspect to the fourth aspect are the same as the beneficial effects of the foregoing first aspect and various implementation manners of the first aspect.
  • beneficial effects please refer to the foregoing first aspect. Aspects and descriptions of beneficial effects in various implementation manners of the first aspect will not be repeated.
  • FIG. 1 is a schematic diagram of establishing a communication connection between a client and a server according to an embodiment of the present application
  • FIG. 2 is another schematic diagram of establishing a communication connection between a client and a server according to an embodiment of the present application
  • FIG. 3 is a schematic diagram of data content obtained after parsing a pcap file provided by an embodiment of the present application
  • FIG. 4 is a flowchart of a Trojan horse detection method provided by an embodiment of the present application.
  • FIG. 5 is a flowchart of another Trojan horse detection method provided by an embodiment of the present application.
  • FIG. 6 is a schematic diagram of obtaining data content after parsing a DNS data packet according to an embodiment of the present application
  • FIG. 7 is a schematic diagram of obtaining data content by parsing according to an embodiment of the present application.
  • FIG. 9 is another schematic diagram of obtaining data content by parsing provided by an embodiment of the present application.
  • FIG. 10 is another schematic diagram of obtaining data content by parsing provided by an embodiment of the present application.
  • FIG. 11 is a schematic structural diagram of a Trojan horse detection device provided by an embodiment of the application.
  • FIG. 12 is a schematic structural diagram of a detection device provided by an embodiment of the present application.
  • the technical solution of the present application can be applied to a network system, such as an intelligent networked vehicle system.
  • a network system such as an intelligent networked vehicle system.
  • FIG. 1 in the scenario of an intelligent networked vehicle system, it includes at least one client (client) and at least one server (server),
  • other network devices may also be included, such as a gateway (gateway, GW), and a telematics processor (Telematics BOX, T-box).
  • GW gateway
  • Telematics BOX Telematics BOX, T-box
  • the method provided in this embodiment may be applied to a detection apparatus, and the detection apparatus may be deployed in a network system as an independent network device, or may also be deployed in a vehicle gateway GW, T-box, or DNS server.
  • the T-box exists in the local area network where DNS data is required, and does not require full traffic analysis.
  • DNS is literally translated into Domain Name System, which is a network service that maps domain names and IP addresses. In general application scenarios, it is deployed in a client/server network connection. For example, using a network terminal as a client (client), a recognized server (server) with domain name resolution function can be specified. For example, the address of the server mapped by a free DNS domain name of Google is 8.8.8.8.
  • Domain Name is the name of a computer or computer group on the Internet consisting of a string of names separated by dots, which is used to locate and identify computers (sometimes also refer to geographic locations) during data transmission. Because IP addresses are inconvenient to remember and cannot display the name and nature of the address organization, people have designed domain names and mapped the domain names and IP addresses to each other through DNS, so that users can access the Internet more easily and avoid remembering A string of IP addresses that can be directly read by a machine.
  • the process of establishing a communication connection between the client and the server can be seen in Figure 1.
  • the DNS server DNS server
  • the request message contains the domain name.
  • the request message can be used to ask for the IP address of www.example.com.
  • the DNS server finds out the IP address associated with the domain name www.example.com according to the mapping relationship between the domain name and the IP address stored in its own database, and marks the IP address as IP_DST, indicating the destination IP address.
  • the DNS server feeds back the IP_DST to the client through the response data.
  • IP_SRC IP address
  • SRC is the abbreviation of Source, which means “source”
  • DST is the abbreviation of Destination, which means “destination”.
  • a GW can be designated as the server side, and the GW can be used to forward the domain name request messages of each client in the local area network, and then the external DNS server returns according to each domain name request message.
  • the IP_DST address is forwarded to the corresponding client.
  • the principle is shown in FIG. 2 .
  • FIG. 2 For the specific implementation process, refer to the interaction process in FIG. 1 , which is not repeated in this embodiment.
  • the purpose of this application is to detect whether there is a DNS tunnel Trojan horse in the network transmission channel.
  • HTTP protocol Hypertext Transfer Protocol, Hypertext Transfer Protocol
  • HTTP application protocol running on top of the TCP/IP protocol suite, which can make browsers more efficient and reduce network transmissions.
  • HTTPs protocol Hyper Text Transfer Protocol over SecureSocket Layer
  • HTTP plus TLS/SSL protocol that can perform encrypted transmission and identity authentication, mainly through digital certificates, encryption algorithms, asymmetric encryption Encryption of Internet data transmission and security protection of Internet transmission through technologies such as encryption keys.
  • SSL Secure Sockets Layer
  • TLS Transport Layer Security
  • RFC Request for Comments
  • RFC Requests for Comments
  • IAB Internet Architecture Board
  • pcap is a commonly used data packet storage format, which can be understood as a file format.
  • the data in it is stored in a specific format, so if you want to parse the data in it, you must follow a certain format.
  • professional tools such as opening the pcap file with Notepad++ with the HEX-Editor plugin installed, can display the format of the hexadecimal data, and then use the packet capture tool such as wireshark to open the file normally and view the network datagram inside. , and wireshark can also generate files in this format.
  • other tools can also be used to view pcap files.
  • a pcap file includes two parts, the pcap header (Pcap Header) and the data area.
  • the data area is divided into multiple data packets, and each packet includes two parts: the data packet header (Packet Header) and the data (Packet Data).
  • the structure is shown in Table 1 below:
  • the Pcap header is the file header, and each pcap file has only one file header, occupying a total of 24 (B) bytes.
  • Timestamp(4B) The high bit of the timestamp, accurate to seconds (seconds), which is the timestamp of the Unix operating system. Can be used to log when packets were captured. Timestamp (4B): low-order timestamp, accurate to milliseconds (microseconds).
  • Caplen(4B) The length of the current data area, that is, the length of the captured data frame, from which the position of the next data frame can be obtained.
  • Len(4B) Offline data length, the length of the actual data frame in the network, generally not greater than Caplen, in most cases the same as the Caplen value.
  • Packet is the data frame of the link layer, and the length is the Caplen value defined in the Packet Header, so each Packet Header is followed by Packet Data of Caplen length. That is to say, the pcap file does not specify any interval strings between captured data frames.
  • the format of the packet data frame part is the standard network protocol format. Referring to Figure 3, it is a schematic diagram of the data content obtained after parsing the pcap file.
  • the string in the first line "0000" represents the Pcap Header, and the strings in the second line "0010" and the third line “0020" represent the Packet Header. In this example, the string in the Packet Header is omitted.
  • the detection device In order to detect DNS tunnel Trojans targeting intelligent network-connected devices from traffic analysis, the detection device provided in this application needs to have the function of filtering and parsing DNS protocol from IP traffic data, and the server IP address given from the DNS response message. The function of correlation search in the data communicated between the address and the source.
  • the present application provides a flow chart of a Trojan horse detection method.
  • the method can be applied to a detection device, and the detection device can be located on the GW, or can also be used as an independent network device, located in the GW and the client. (clients) anywhere between. Alternatively, it may also be located at another location in the network, which is not limited in this embodiment.
  • the method includes:
  • the source is a client, and the destination is a network device that the source requests to perform service transmission.
  • the first query packet is a DNS data packet sent by the source end to the DNS server.
  • the address corresponding to the source end is the IP address of the source end
  • the IP address of the source end can be obtained by parsing the first query packet, or obtained from a DNS server, and the obtaining method is not limited in this embodiment .
  • the first response packet is a response packet found by the DNS server according to the first query packet, the response packet includes a destination IP address, and the first response packet is also a DNS packet.
  • the first query packet may be the first DNS data packet in the detection period, or may also be a certain DNS data packet in the middle.
  • Complying with the DNS protocol specification means that the data content obtained after parsing the first query packet, the data structure conforms to the DNS protocol specification, for example, the DNS protocol contains the Caplen value and the Caplen value and indicates the length of the Packet Data, etc.
  • the at least one destination IP address belongs to the destination end. Since one destination end may include multiple service addresses, one or more destination IP addresses will be obtained by parsing the first response packet. In addition, there is a communication link between one source IP address and one resolved destination IP address. If N destination IP addresses are resolved, there are N communication links between the source IP address and the N destination IP addresses. Then, the data packet transmission situation on the N communication links is judged.
  • the above method further includes: if there is a data packet between the source IP address and each of the at least one destination IP address, determining that there is no DNS tunnel Trojan horse between the source and the destination.
  • the method can detect whether there is a DNS tunnel Trojan hidden in a data stream that fully complies with the DNS protocol specification, and solves the problem that the intrusion detection system based on general rules cannot find the DNS tunnel Trojan with high concealment.
  • the detection method provided by this embodiment includes:
  • the first data packet set is all the data packets collected by the detection device in the first detection period, which are collectively referred to as the first data packet set, referred to as "Data 1".
  • the first data packet set includes different types of data packets, for example, including but not limited to DNS data packets, HTTP data packets, TCP data packets, TLS data packets, and the like.
  • the detection device periodically detects data between each client and the destination. For example, in the first detection cycle, the data between the client 1 (client 1) and the destination end 1 (DST 1) is detected, and all data packets in the first detection cycle are obtained. For example, assuming that the number of target detection data packets in the first detection period is 2000, the count starts when the first DNS data packet is detected, and until the 2000th data packet, all the contained data packets constitute the first data packet gather. As shown in Figure 6, if the number (No.) corresponding to the first DNS packet is 13219 and the number of the 2000th packet is 15219, then the set of packets numbered from the 13219th to the 15219th is the A collection of packets.
  • the detection device acquires all the data packets in a certain period of time before, for example, within nearly 10 minutes before the current moment, and acquires all the data packets transmitted between the source end and the destination end as the first data packet set.
  • the DNS data packet numbered 13219 is a kind of query packet. After the query packet is sent by client 1, a first response packet is detected in the number 13385 packet, and the first response packet corresponds to the first query packet. DNS packets.
  • the first data packet after the No. 13385 (excluding), that is, all the data packets from the No. 13386 data packet to the No. 15219, is called the second data packet set, In this embodiment, the second data packet set is referred to as "Data 2" for short.
  • the second data packet set at least includes: DNS, HTTP, TCP, TLS and other types of data packets.
  • the detection device obtains and filters out all DNS data packets from the first data packet set.
  • the port number (Dst Port) of the destination port is 53, and in the first data packet set, all the data packets output through port 53 are DNS data packets.
  • These DNS data packets form a third data packet set, which is abbreviated as "Data 3" in this embodiment.
  • the third data packet set includes only DNS type data packets.
  • Data 3 screened out in the first data packet set includes two DNS data packets, which are the DNS data packets numbered 13219 and 13385 respectively, and these two DNS data packets are One of them is an inquiry packet and the other is a response packet.
  • the detection device parses all the filtered DNS packets, and the information available after parsing each DNS packet is shown in Table 2, including: packet number (No.), reception time (Time), source address (Source), destination address (Destination), protocol type (Protocol), length (Length) and remarks (Info), etc.
  • the "remarks” information includes indicating whether the data packet is a query packet (standard query), or a response packet (standard query response) corresponding to a query packet, and also includes a domain name, such as cn.xxx.com and other information. "*" represents a hidden character, which can be any value from 0 to 9.
  • the first data packet among them may be selected as the first query packet, or a certain one of them may be selected as the first query packet. This embodiment does not limit the specific selection process.
  • an implementation method is to parse the data segment by segment according to the relevant provisions on DNS in the "RFC document", and determine whether the values of each field are within the specified range. If the value of each field is within the specified range If the values are all within the specified range, it is judged that the first query packet conforms to the DNS protocol specification.
  • the specific requirements are listed in the DNS specification in great detail, and will not be repeated here.
  • the program can be judged according to the specification, or the application programming interface (Application Programming Interface, API) of the pcap reading and parsing software can be called to make judgment. See Figure 7 for a combination of open source pcap to read and analyze the software to obtain The parsing result is output after parsing the DNS query packet by the parsing software.
  • API Application Programming Interface
  • the lines “0030" and “0040" in Figure 7 are the key parts of the stander query data packet, and the indication field in each circle is the Caplen value (or the Caplen length). Indication field), in bytes, to indicate the length of the data that follows it. For example, “02" indicates that the data length of the following segment (Packet Data in the Caplen value) is two bytes, "04” indicates that the data length of the following segment is 4 bytes, and “03” indicates that the data length of the following segment is 3 Bytes, "00” indicates that the data length of the following segment is 0 bytes.
  • judging whether the DNS protocol specification is complied with can be specifically understood as: judging whether the length indication field is consistent with the actual data length of the following segment. If there is one or more length indication fields that are inconsistent with the actual length of the data (box) located behind the fields, it is determined that the first query packet does not conform to the DNS protocol specification.
  • the source IP address is obtained according to the information shown in Table 2 above, and the IP address of the source device can represent is IP_SRC.
  • the detection device first determines the destination IP address of the currently detected query packet, that is, the IP address of the DST, according to the parsed information in Table 2, and then determines the destination IP address according to the destination IP address.
  • the IP address of the source end i.e. IP_SRC.
  • step 206 Continue to step 205, and determine a first response packet corresponding to the first query packet according to the parsed content of the first query packet. It is the same as step 102 in the previous embodiment.
  • each inquiry packet corresponds to a response packet.
  • Step 207 Parse the first response packet, and obtain an IP address set of the destination terminal from the first response packet, where the IP address set of the destination terminal includes at least one destination IP address. It is the same as step 103 in the previous embodiment.
  • An implementation manner is to programmatically parse the first response packet according to the DNS protocol specification in the "RFC document", or to use pcap to read and parse the parsing API to obtain the parsing result.
  • the parsing result includes two destination addresses IP_DST parsed by the DNS server in the first response data packet, and marks the two destination IP addresses as: IP_DST1 is 202.**.**.**0, IP_DST2 is 202.**.**.**1. It is further obtained that the destination IP address set includes IP_DST1 and IP_DST2.
  • the data packet can be the above-mentioned first data packet set, namely "Data 1"; or, it can also be the above-mentioned second data packet set, namely "Data 2".
  • the detection device filters the traffic of Data 2 according to the source address IP_SRC, and searches for the communication data of IP_SRC and IP_DST_i, (i ⁇ 1 and is a positive integer); Based on the IP_DST_i given in the IP_SRC and DNS response data packets, the technology of pairwise filtering in IP traffic is also known as the associated data search technology. Through the associated data search technology, it is possible to know whether there is any transmission on each communication link. data pack.
  • the first communication link is between IP_SRC and IP_DST1
  • the second communication link is between IP_SRC and IP_DST2
  • only one transmission link between the first communication link and the second communication link has data packets on it, Then it is determined that there is no DNS tunnel Trojan horse between the source end and the destination end.
  • the client asks the domain name server for the IP address of the server that provides a certain network service.
  • This network service can be HTTP, HTTPs, and instant messaging. That is to say, in the normal communication process without the existence of tunnel Trojans, if the IP address corresponding to the requested domain name is also resolved by the DNS server to IP_DST, the client IP address IP_SRC must exist behind the DNS data communication, and the transmission between IP_DST and IP_SRC must exist. data pack.
  • the detection device collects IP data and only parses the DNS protocol data, and the DNS response packet (or response message) has given IP_DST, in the other protocol data collected after the DNS data, it must be There is data traffic communicating between IP_SRC and IP_DST; on the contrary, if the DNS response packet gives the IP_DST address, but no data packets exist for communication between IP_SRC and IP_DST, it can be determined that there is a DNS tunnel Trojan between the source and destination. .
  • the method provided by this embodiment can detect whether there is a DNS tunnel Trojan hidden in the data traffic that fully complies with the DNS protocol specification, which solves the problem that the intrusion detection system based on general rules cannot find the DNS tunnel Trojan with high concealment.
  • this method can avoid the detection method based on machine learning, which requires learning a large number of samples, and at the same time, there are inevitably the problems of false negatives and false positives, and the detection process does not need to combine the functions of the DNS protocol itself, so It will not affect the detection effect.
  • step 204 it also includes: if no, that is, when the currently detected first query packet does not conform to the DNS protocol specification, that is, there are one or more length indication fields and the actual length of the data behind the field Inconsistent, for example, the Caplen length indication value is "04", but the actual length of the subsequent data is not 4 bytes, then execute the following method steps. Specifically, as shown in Figure 8, the method includes:
  • the data packet is parsed according to the specification of the stander query in the DNS protocol, and the stander query packet is sent by the IP_SRC to the DNS server, that is, the data packet numbered 13219 in Figure 6.
  • the remark information in the data packet includes the domain name requested by the IP_SRC.
  • the domain name requested by the IP_SRC is "cn.xxxx.com”.
  • the domain name requested by the IP_SRC is represented by ASCII code
  • ASCII code American Standard Code for Information Interchange, American Standard Code for Information Interchange
  • ASCII code is a set of computer coding systems based on Latin letters, mainly used to display modern English and other Western European languages . It is the most common information exchange standard and is equivalent to the international standard ISO/IEC 646. ASCII was first published as a canonical standard type in 1967, last updated in 1986, and has so far defined a total of 128 characters.
  • the so-called invisible characters are characters outside the range of ASCII codes (128 characters).
  • step 214 If the invisible character does not exist, that is, the characters in the domain name requested by the IP_SRC are all characters in ASCII code, determine the first response packet corresponding to the first query packet. For the specific process, reference may be made to the foregoing step 205, which will not be repeated here.
  • the first data is parsed according to the specification of the response data in the DNS protocol, wherein the response data is the data sent by the DNS server to the source address IP_SRC, according to the requirements of the DNS protocol specification, including the following situation: when the destination IP address IP_DST is For IPv4, the length of the IP address in the standerd query response packet should be 4; when the destination IP address IP_DST is IPv6, the length of the IP address in the standerd query response packet should be 16.
  • the "data type and length" detection method specifically includes:
  • One implementation method is to obtain the IP_DST data length indication field in the load part of the first query packet (standerd query response), which is currently 4 or 6, and the indication field occupies 1 byte, if the value of the byte is 0x04, IP_DST is IPv4; if the value of this byte is 0x06, IP_DST is IPv6.
  • IP_DST length is consistent with the length parsed in the previous step 216-1, it is detected that there is no DNS tunnel Trojan.
  • the parsed IP_DST length is inconsistent with the parsed length indication in combination with the previous step 216-1. For example, when the data type of the IP address is IPv4, the length of the IP address in the response packet is not 4; When the data type is IPv6, and the length of the IP address in the response packet is not 16, the judgment result is that there is a DNS tunnel Trojan.
  • Fig. 9 shows the normal DNS protocol standard query response parsing result of the number 13385 data packet parsing in Fig. 6, the data type of the parsing destination IP address IP_DST is IPv4, and the address length satisfies the first preset value 4, then conforms to the DNS protocol specification, which in turn determines that there is no DNS tunneling Trojan.
  • Figure 10 shows the abnormal parsing result of the parsing of the data packet numbered 13385 in Figure 6.
  • the data type of the IP address IP_DST of the parsing destination is IPv4, but the actual address data length after the indication field "04" is 3, instead of The first preset value of 4, that is, does not conform to the DNS protocol specification, it is determined that there is a DNS tunnel Trojan.
  • the method realizes the detection of the DNS tunnel Trojan horse in the data traffic that does not conform to the DNS protocol specification, and can accurately find the hidden tunnel Trojan horse in the case of network abnormality or DNS server error, and there are no false positives or false negatives. Under the premise of normal network communication, as long as abnormal data packets or packets that do not meet the DNS requirements are found, it can quickly detect whether there is a DNS tunnel Trojan in the DNS tunnel.
  • FIG. 11 is a schematic structural diagram of a Trojan horse detection device provided by an embodiment of the present application.
  • the apparatus may be a network device, or a component located in the network device, such as a chip circuit. And the device can implement the DNS Trojan detection method in the foregoing embodiment.
  • the apparatus may include: a collection unit 1101 , an analysis unit 1102 and a determination unit 1103 .
  • the parsing unit 1102 may also be referred to as a DNS protocol parsing unit
  • the determining unit 1103 may also be referred to as a Trojan horse identification unit.
  • the apparatus may further include other units or modules such as a storage unit, which are not limited in this embodiment.
  • the collection unit 1101 is configured to receive a first query packet from the source end, where the first query packet includes the IP address of the source end.
  • the parsing unit 1102 is configured to obtain a first response packet corresponding to the first query packet when the first query packet conforms to the DNS protocol specification, and parse the first response packet to obtain at least one destination IP address.
  • the determining unit 1103 is configured to determine that a DNS tunnel Trojan exists between the source end and the destination end when there is no data packet between the source end IP address and the at least one destination IP address.
  • the first response packet is sent by the DNS server, and the at least one destination IP address belongs to the destination end.
  • the determining unit 1103 is further configured to determine the source IP address in the case that there is a data packet between the source IP address and each of the at least one destination IP address. There is no DNS tunneling Trojan horse between the endpoint and the destination endpoint.
  • the data packets are all the data packets in the first detection period, or are all the data packets collected from after the detection of the first response packet to the end of the first detection period.
  • the data packet is obtained after being collected by the collection unit 1101 .
  • the acquisition unit 1101 is further configured to acquire the first response packet collected in the first detection period before acquiring the first response packet corresponding to the first query packet A data packet set, where the first data packet set at least includes data packets of the DNS protocol type.
  • the parsing unit 1102 is further configured to filter out all DNS data packets from the first data packet set through the target port, and select the first query packet from all DNS data packets, where the DNS data packet includes a query packet and a response Bag.
  • the target port is port 53 of UDP.
  • the parsing unit 1102 is specifically configured to poll each data packet in all the DNS data packets, and determine whether the length indication field carried in the currently detected data packet is the same as the length in the data packet. Indicates whether the actual data lengths after the indication field are consistent; if they are consistent, it is determined that the currently detected data packet conforms to the DNS protocol specification; and all data packets conforming to the DNS protocol specification are counted.
  • the parsing unit 1102 is specifically configured to determine that the first query packet does not contain a length indication field carried in the first query packet and the actual data length after the length indication field is inconsistent. Complies with the DNS protocol specification.
  • the parsing unit 1102 is further configured to detect that the length indication field carried in the first query packet is inconsistent with the actual data length after the length indication field, and determine that the first query packet does not conform to the DNS protocol specification.
  • the parsing unit 1102 is further configured to obtain the domain name requested by the source IP address when it is determined that the first query packet does not conform to the DNS protocol specification,
  • the domain name is represented by a string.
  • the determining unit 1103 is further configured to determine whether there are characters other than ASCII codes in the domain name represented by the character string, and if so, determine that there is a DNS tunnel Trojan horse between the source end and the destination end.
  • the determining unit 1103 is further configured to, when there are no characters other than the ASCII code, the parsing unit 1102 to obtain the first response packet corresponding to the first query packet; and to parse the first response packet to obtain the first data, Described first data includes data type and length, and determining unit 1103 is also used to judge whether the data type and length parsed in the first data all meet the DNS protocol specification, if all meet, then determine that there is no DNS tunnel Trojan horse .
  • the determining unit 1103 is further configured to determine that there is a DNS tunnel Trojan horse when at least one of the data type and length in the first data does not conform to the DNS protocol specification.
  • FIG. 12 shows a schematic structural diagram of a detection device, and the detection device may be a network device.
  • the detection device includes: a processor 110 , a memory 120 , and at least one communication interface 130 .
  • the processor 110, the memory 120 and the at least one communication interface 130 may be coupled through a communication bus.
  • the processor 110 is the control center of the detection device, and can be used for communication between devices, for example, including information transmission with at least one client and other devices such as the server DST.
  • the processor 110 may be composed of an integrated circuit (Integrated Circuit, IC), for example, may be composed of a single packaged IC, or may be composed of a plurality of packaged ICs connected with the same function or different functions.
  • the processor 110 may include a central processing unit (Central Processing Unit, CPU) or a digital signal processor (Digital Signal Processor, DSP) or the like.
  • CPU Central Processing Unit
  • DSP Digital Signal Processor
  • the processor 110 may further include a hardware chip, and the hardware chip may be an application specific integrated circuit (ASIC), a programmable logic device (PLD) or a combination thereof.
  • ASIC application specific integrated circuit
  • PLD programmable logic device
  • the above-mentioned PLD can be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a general-purpose array logic (generic array logic, GAL) or any combination thereof.
  • the hardware chip is a chip system or a chip circuit.
  • the memory 120 is used for storing and exchanging various types of data or software, including storing the first data packet set, the second data packet set, the third data packet set, the query packet and the response packet, and the like.
  • computer programs and codes may be stored in the memory 120 .
  • the memory 120 may include volatile memory (volatile memory), such as random access memory (Random Access Memory, RAM); may also include non-volatile memory (non-volatile memory), such as flash memory (flash memory) memory), a hard disk (Hard Sisk Drive, HDD) or a solid-state drive (Solid-State Drive, SSD), the memory 120 may also include a combination of the above-mentioned types of memory.
  • volatile memory such as random access memory (Random Access Memory, RAM)
  • non-volatile memory such as flash memory (flash memory) memory
  • HDD Hard Sisk Drive, HDD
  • SSD solid-state drive
  • Communication interface 130 using any transceiver-like device, for communicating with other devices or communication networks, such as Ethernet, Radio Access Network (RAN), Wireless Local Area Network (WLAN), Virtual Extensible Local Area Network (VXLAN), etc.
  • RAN Radio Access Network
  • WLAN Wireless Local Area Network
  • VXLAN Virtual Extensible Local Area Network
  • the above detection device may also include other more or less components, and the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the detection device. And the components shown in FIG. 12 can be implemented in hardware, software, firmware or any combination thereof.
  • the acquisition unit 1101 in the detection device shown in FIG. 11 can be implemented through the communication interface 130, the functions of the analysis unit 1102 and the determination unit 1103 can be implemented by the processor 110, and the function of the storage unit can be implemented by the processor 110.
  • the processor 110 Implemented by memory 120 .
  • the detection device uses at least one communication interface 130 to receive a first query packet from the source end, where the first query packet includes the IP address of the source end, and when the processor 110 determines that the first query packet conforms to the DNS protocol specification, Obtain a first response packet corresponding to the first query packet, and parse the first response packet to obtain at least one destination IP address; and, detect when there is no difference between the source IP address and the at least one destination IP address When there is a data packet, it is determined that there is a DNS tunnel Trojan horse between the source end and the destination end.
  • the processor 110 executes the method shown in FIG. 4 , FIG. 5 or FIG. 8 in the foregoing embodiment by calling the program code in the memory 120 .
  • the detection device also includes a mobile communication module, a wireless communication module, and the like.
  • the mobile communication module includes modules with wireless communication functions such as 2G/3G/4G/5G.
  • filters, switches, power amplifiers, low noise amplifiers (LNAs), etc. may also be included.
  • the wireless communication module can provide wireless communication solutions including WLAN, bluetooth (bluetooth), global navigation satellite system (GNSS), frequency modulation (frequency modulation, FM), etc. applied to the detection equipment.
  • an embodiment of the present application also provides a network system, and the network system structure may be the network architecture shown in the aforementioned FIG. 1 or FIG. 2 , including at least one client, at least one server, a DNS server, and a communication device such as a gateway. .
  • the structure of each of the above devices may be the detection device shown in FIG. 12 , which is used to implement the detection method in the foregoing embodiment.
  • This embodiment can detect whether there is a DNS tunnel Trojan hidden in a data packet that fully complies with the DNS protocol specification, and solves the problem that a general rule-based intrusion detection system cannot find a DNS tunnel Trojan with high concealment.
  • the hidden tunnel Trojan horses can be accurately discovered in the case of network abnormalities or DNS server errors, and there are no false positives or false negatives. Under the premise of normal network communication, as long as abnormal data packets or packets that do not meet the DNS requirements are found, it can quickly detect whether there is a DNS tunnel Trojan in the DNS tunnel.
  • Embodiments of the present application also provide a computer program product, where the computer program product includes one or more computer program instructions.
  • the computer program product includes one or more computer program instructions.
  • the computer may be a general purpose computer, special purpose computer, computer network, or other programmable device.
  • the computer program instructions may be stored in or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions may be transmitted from a communication device, computer, server or data
  • the center transmits to another communication device by wire or wireless.
  • the computer program product and the computer program instructions may be located in the memory of the aforementioned detection device, so as to implement the Trojan horse detection method described in the embodiments of the present application.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • General Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Computing Systems (AREA)
  • Computer Hardware Design (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Medical Informatics (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Virology (AREA)
  • Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • General Health & Medical Sciences (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

A Trojan detection method and apparatus, and a device. The method comprises: receiving a first query packet from a source end, the first query packet comprising an IP address of the source end (101); if the first query packet conforms to domain name system (DNS) protocol specifications, acquiring a first response packet corresponding to the first query packet, the first response packet being sent by a destination end (102); analyzing the first response packet so as to obtain at least IP address of the destination end (103); and if there is no data packet between the IP address of the source end and the at least one IP address of the destination end, determining that a DNS tunneling Trojan is present between the source end and the destination end (104). The method is used to detect whether a DNS tunneling Trojan is hidden in a data packet conforming to DNS protocol specifications, and solves the problem in which intrusion detection systems based on general rules cannot detect high-concealment DNS tunneling Trojans.

Description

一种木马检测方法、装置和设备A Trojan detection method, device and equipment 技术领域technical field

本申请涉及通信领域,尤其是涉及一种木马检测方法、装置和设备。The present application relates to the field of communications, and in particular, to a Trojan horse detection method, device and device.

背景技术Background technique

隧道技术,是提高网络协议(Internet Protocol,IP)数据传输稳定性、安全性的一个重要方法,在隧道技术中常用的隧道传输协议包括:互联网安全协议(Internet Protocol Security,IPsec)、通用路由封装(Generic Routing Encapsulation,GRE)、点对点隧道协议(Point to Point Tunneling Protocol,PPTP)等。网络木马,是指隐藏在网络系统中的一段恶意代码。它具备破坏和删除文件、发送口令、键盘记录等功能,是具备特殊黑客功能的一种后门程序,其英文名称为Trojan(特洛伊),含义取自古希腊时期的特洛伊之战中的一种成功战术,攻击者可以利用网络木马在被攻击系统长期潜伏,持续获取用户的敏感信息。由于隐蔽性好且危害性大,网络控制类木马自诞生以来被黑客广泛使用,危害遍及网络系统的各行各业,网络安全、工业生产安全、金融安全等传统产业安全都受到极大的威胁。Tunneling technology is an important method to improve the stability and security of network protocol (Internet Protocol, IP) data transmission. Commonly used tunneling transmission protocols in tunneling technology include: Internet Protocol Security (IPsec), general routing encapsulation (Generic Routing Encapsulation, GRE), Point to Point Tunneling Protocol (Point to Point Tunneling Protocol, PPTP), etc. A network Trojan is a piece of malicious code hidden in a network system. It has the functions of destroying and deleting files, sending passwords, keylogging and other functions. It is a backdoor program with special hacking functions. Its English name is Trojan (Troy), which means a success in the battle of Troy in ancient Greece. Tactics, attackers can use network Trojans to lurk in the attacked system for a long time and continuously obtain sensitive information of users. Due to its good invisibility and great harm, network control Trojans have been widely used by hackers since its birth, endangering all walks of life in the network system, and traditional industry security such as network security, industrial production security, and financial security are all under great threat.

为降低木马对于正常网络连接的威胁,安全人员对搜集到的大量木马样本进行特征分析,发现一般的网络木马在传输时往往采用私有专用传输协议。基于这样的研究结果,研究人员提出多种方法来发现私有专用传输协议,从而可以查找出网络木马,提升终端设备抵抗网络木马攻击的能力,这样也迫使设计者将网络木马设计的逐渐转向隐蔽自身传输协议特征的路线发展,逐渐出现了基于合法通信协议的新型木马。In order to reduce the threat of Trojans to normal network connections, security personnel analyzed the characteristics of a large number of Trojan samples collected, and found that common network Trojans often use private and dedicated transmission protocols during transmission. Based on such research results, researchers have proposed a variety of methods to discover private dedicated transmission protocols, so as to find network Trojans and improve the ability of terminal devices to resist network Trojan attacks, which also forces designers to gradually shift the design of network Trojans to conceal themselves. With the development of the transmission protocol characteristics, new types of Trojan horses based on legal communication protocols have gradually emerged.

近年来,伪装成域名系统(Domain Name System,DNS)、互联网控制消息协议(Internet Control Message Protocol,ICMP)等合法协议的网络木马技术大量出现,对政府、公司、个人用户构成极大威胁。例如据报道,某高级可持续攻击(Advanced Persistant Attack,APT)组织接连对宝马、丰田等知名车企进行网络攻击,该组织的攻击工具中就包含有伪装成DNS协议进行数据传输的木马。在攻击过程中,DNS协议成为该木马进行数据传输的通道,这种以DNS协议为传输通道进行数据传输的木马又称为DNS隧道木马。因此,如何在网络传输通道中检测出DNS隧道木马是本领域技术人员亟待解决的技术问题。In recent years, a large number of network Trojan horse technologies disguised as legitimate protocols such as Domain Name System (DNS) and Internet Control Message Protocol (ICMP) have appeared, posing a great threat to governments, companies, and individual users. For example, it is reported that an Advanced Persistant Attack (APT) organization has successively carried out network attacks on well-known car companies such as BMW and Toyota. The organization's attack tools include a Trojan horse disguised as DNS protocol for data transmission. During the attack, the DNS protocol becomes the channel for the Trojan to transmit data. This Trojan that uses the DNS protocol as the transmission channel for data transmission is also called DNS tunneling Trojan. Therefore, how to detect the DNS tunnel Trojan in the network transmission channel is a technical problem to be solved urgently by those skilled in the art.

发明内容SUMMARY OF THE INVENTION

本申请提供一种木马检测方法、装置和设备,用于解决上述技术问题,具体地,公开了以下技术方案:The present application provides a Trojan horse detection method, device and equipment for solving the above-mentioned technical problems, specifically, the following technical solutions are disclosed:

第一方面,本申请提供了一种木马检测方法,该方法包括:接收来自源端的第一询问包,所述第一询问包中包括源端的IP地址,当所述第一询问包符合DNS协议规范,获取与所述第一询问包对应的第一响应包;解析所述第一响应包得到至少一个目的IP地址;如果所述源端IP地址和所述至少一个目的IP地址之间均不存在数据包,则确定所述源端和目的端之间存在DNS隧道木马。其中,第一响应包为DNS服务器发送,所述至少一个目的IP地址归属于所述目的端。In a first aspect, the present application provides a Trojan horse detection method, the method includes: receiving a first query packet from a source end, where the first query packet includes the IP address of the source end, when the first query packet conforms to the DNS protocol specification, obtain the first response packet corresponding to the first query packet; parse the first response packet to obtain at least one destination IP address; if there is no difference between the source IP address and the at least one destination IP address If there is a data packet, it is determined that there is a DNS tunnel Trojan horse between the source end and the destination end. The first response packet is sent by the DNS server, and the at least one destination IP address belongs to the destination terminal.

本方法能够检测出符合DNS协议规范的数据流中是否隐藏有DNS隧道木马,解决了 基于一般规则的入侵检测系统无法发现高隐蔽性DNS隧道木马的问题。The method can detect whether there is a DNS tunnel Trojan hidden in the data stream conforming to the DNS protocol specification, and solves the problem that the intrusion detection system based on general rules cannot find the DNS tunnel Trojan with high concealment.

另外,本方法又可以避免采用基于机器学习的检测方法,需要对大量样本进行学习,同时又不可避免的存在漏报、误报的问题,并且检测过程中也无需结合DNS协议本身的功能,因此不会影响检测的效果。In addition, this method can avoid the detection method based on machine learning, which requires a large number of samples to be learned, and at the same time, there are inevitably the problems of false negatives and false positives, and the function of the DNS protocol itself does not need to be combined in the detection process. It will not affect the detection effect.

可选的,结合第一方面,在第一方面的一种可能的实现中,上述方法还包括:如果所述源端IP地址和每个所述至少一个目的IP地址之间均存在数据包,则确定所述源端和所述目的端之间不存在DNS隧道木马。Optionally, in combination with the first aspect, in a possible implementation of the first aspect, the above method further includes: if there is a data packet between the source IP address and each of the at least one destination IP address, Then it is determined that there is no DNS tunnel Trojan horse between the source end and the destination end.

结合第一方面,在第一方面的另一种可能的实现中,获取与所述第一询问包对应的第一响应包之前,还包括:获取在第一检测周期内采集的第一数据包集合,所述第一数据包集合中至少包括DNS协议类型的数据包;With reference to the first aspect, in another possible implementation of the first aspect, before acquiring the first response packet corresponding to the first query packet, the method further includes: acquiring the first data packet collected in the first detection period Set, the first data packet set includes at least the data packets of the DNS protocol type;

所述接收来自源端的第一询问包,包括:通过目标端口从所述第一数据包集合中过滤出所有DNS数据包,所述DNS数据包包括询问包和响应包;从所述所有DNS数据包中筛选出所述第一询问包。其中,所述目标端口为UDP的53号端口。The receiving the first inquiry packet from the source includes: filtering out all DNS data packets from the first data packet set through the target port, where the DNS data packets include inquiry packets and response packets; The first query packet is filtered out of the packet. Wherein, the target port is port 53 of UDP.

本实现方式通过目标端口可以过滤出所有DNS数据包,从而为后续在传输DNS数据包中检测隧道中是否存在DNS数据包提供依据。This implementation can filter out all DNS data packets through the target port, thereby providing a basis for detecting whether there are DNS data packets in the tunnel in the subsequent transmission of DNS data packets.

结合第一方面,在第一方面的又一种可能的实现中,所述第一询问包符合所述DNS协议规范的数据包,包括:所述第一询问包中携带的长度指示字段与位于所述长度指示字段之后的实际数据长度一致。With reference to the first aspect, in yet another possible implementation of the first aspect, the first query packet conforms to the data packet of the DNS protocol specification, including: a length indication field carried in the first query packet and a data packet located in the The actual data length after the length indication field is consistent.

另外,上述方法还包括:如果所述第一询问包中携带的长度指示字段与位于所述长度指示字段之后的实际数据长度不一致,则确定所述第一询问包不符合所述DNS协议规范。In addition, the above method further includes: if the length indication field carried in the first query packet is inconsistent with the actual data length after the length indication field, determining that the first query packet does not conform to the DNS protocol specification.

本实现方式利用解析数据包中pcap文件的内容,得到数据结构和内容,从而判断解析的数据结构和内容是否符合DNS协议规范,进而筛选出所有符合DNS协议规范的数据包。This implementation uses the content of the pcap file in the parsed data packet to obtain the data structure and content, thereby judging whether the parsed data structure and content conform to the DNS protocol specification, and then screen out all the data packets conforming to the DNS protocol specification.

结合第一方面,在第一方面的又一种可能的实现中,在确定所述第一询问包不符合所述DNS协议规范的情况下,所述方法还包括:获取所述源端IP地址请求的域名,所述域名通过预设字符串表示;判断通过所述预设字符串表示的域名中是否存在ASCII码之外的字符;如果存在,则确定所述源端到所述目的端之间存在DNS隧道木马。With reference to the first aspect, in yet another possible implementation of the first aspect, when it is determined that the first query packet does not conform to the DNS protocol specification, the method further includes: acquiring the source IP address The requested domain name, the domain name is represented by a preset character string; it is judged whether there are characters other than ASCII codes in the domain name represented by the preset character string; There is a DNS tunneling Trojan.

结合第一方面,在第一方面的又一种可能的实现中,上述方法还包括:如果不存在所述ASCII码之外的字符,则获取与所述第一询问包对应的第一响应包;解析所述第一响应包得到第一数据,所述第一数据中包含数据类型和长度,判断所述第一数据中包含的数据类型和长度是否均符合DNS协议规范;如果均符合,则确定不存在DNS隧道木马。With reference to the first aspect, in yet another possible implementation of the first aspect, the above method further includes: if there are no characters other than the ASCII code, acquiring a first response packet corresponding to the first query packet Analyzing the first response packet to obtain the first data, comprising data type and length in the first data, and judging whether the data type and length included in the first data all meet the DNS protocol specification; If all meet, then Make sure there is no DNS tunneling Trojan.

可选的,上述方法还包括:如果所述第一数据中包含数据类型和长度的至少一个不符合所述DNS协议规范,则确定存在DNS隧道木马。Optionally, the above method further includes: if at least one of the data type and length contained in the first data does not conform to the DNS protocol specification, determining that there is a DNS tunneling Trojan horse.

本方法实现了对于不符合DNS协议规范的数据流中DNS隧道木马检测,能够在网络异常或者DNS服务器出错的情况下,准确地发现隐藏的隧道木马,并且不存在误报、漏报的情况。在网络通信正常的前提下,只要发现不符DNS合规范要求的异常数据包或报文,就可以迅速地检测出隧道中是否存在DNS隧道木马。The method realizes the detection of the DNS tunnel Trojan horse in the data stream that does not conform to the DNS protocol specification, and can accurately find the hidden tunnel Trojan horse in the case of network abnormality or DNS server error, and there is no false positive or false negative. Under the premise of normal network communication, as long as abnormal data packets or packets that do not meet the DNS requirements are found, it can quickly detect whether there is a DNS tunnel Trojan in the tunnel.

可选的,在第一方面的又一种可能的实现中,所述数据包为第一检测周期内的所有数据包,或者,为从检测到的第一个响应包之后开始到所述第一检测周期结束时采集的所有数据包。Optionally, in another possible implementation of the first aspect, the data packets are all data packets in the first detection period, or, from the time after the first response packet is detected to the first detection period. All packets collected at the end of a detection period.

其中,第一检测周期内的所有数据包又称为第一数据包集合,为从检测到的第一个响应包之后开始到所述第一检测周期结束时采集的所有数据包又称为第二数据包集合。本实现方式,当获取并检测第二数据包集合时,由于该第二数据包集合是前述第一数据包集合中的子集,所以相比于检测第一数据包集合的传输数据包,本方法仅检测第二数据包集合,检测包的数量减少,检测效率提高。Among them, all the data packets in the first detection period are also called the first data packet set, which are all the data packets collected from the first response packet detected to the end of the first detection period, also called the first data packet set. Two-packet set. In this implementation manner, when the second data packet set is acquired and detected, since the second data packet set is a subset of the aforementioned first data packet set, compared with detecting the transmission data packets of the first data packet set, this implementation The method only detects the second data packet set, the number of detection packets is reduced, and the detection efficiency is improved.

第二方面,本申请还提供了一种木马检测装置,所述装置包括:采集单元、解析单元、和确定单元等,In a second aspect, the present application also provides a Trojan horse detection device, the device includes: a collection unit, an analysis unit, a determination unit, and the like,

其中,采集单元,用于接收来自源端的第一询问包,所述第一询问包中包括源端的IP地址,解析单元,用于在所述第一询问包符合域名系统DNS协议规范,获取与所述第一询问包对应的第一响应包,所述第一响应包为DNS服务器发送;确定单元,用于在所述源端IP地址和所述至少一个目的IP地址之间均不存在数据包的情况下,确定所述源端到目的端之间存在DNS隧道木马。The collecting unit is configured to receive a first query packet from the source end, where the first query packet includes the IP address of the source end, and the parsing unit is configured to obtain and obtain the corresponding information when the first query packet conforms to the DNS protocol specification of the Domain Name System. The first response packet corresponding to the first query packet, the first response packet is sent by the DNS server; the determining unit is used for there is no data between the source IP address and the at least one destination IP address. In the case of the packet, it is determined that there is a DNS tunnel Trojan horse between the source end and the destination end.

可选的,结合第二方面,在第二方面的一种可能实现中,所述确定单元,还用于在所述源端IP地址和每个所述至少一个目的IP地址之间均存在数据包的情况下,确定所述源端和所述目的端之间不存在DNS隧道木马。Optionally, in combination with the second aspect, in a possible implementation of the second aspect, the determining unit is further configured to have data between the source IP address and each of the at least one destination IP address. In the case of the packet, it is determined that there is no DNS tunnel Trojan horse between the source end and the destination end.

结合第二方面,在第二方面的另一种可能的实现中,所述采集单元,还用于获取在第一检测周期内采集的第一数据包集合,所述第一数据包集合中至少包括DNS协议类型的数据包;所述解析单元,还用于通过目标端口从所述第一数据包集合中过滤出所有DNS数据包,以及从所有DNS数据包中选择所述第一询问包,所述DNS数据包包括询问包和响应包。With reference to the second aspect, in another possible implementation of the second aspect, the collection unit is further configured to acquire a first set of data packets collected in the first detection period, where at least one of the first set of data packets is Including data packets of the DNS protocol type; the parsing unit is further configured to filter out all DNS data packets from the first data packet set through the target port, and select the first query packet from all DNS data packets, The DNS data packets include query packets and response packets.

结合第二方面,在第二方面的又一种可能的实现中,所述解析单元,具体用于当所述第一询问包中携带的长度指示字段与位于所述长度指示字段之后的实际数据长度一致时,确定所述第一询问包符合所述DNS协议规范。With reference to the second aspect, in yet another possible implementation of the second aspect, the parsing unit is specifically configured to, when the length indication field carried in the first query packet and the actual data located after the length indication field When the lengths are the same, it is determined that the first query packet conforms to the DNS protocol specification.

结合第二方面,在第二方面的又一种可能的实现中,所述解析单元,还用于当所述第一询问包中携带的所述长度指示字段与位于所述长度指示字段之后的实际数据长度不一致时,确定所述第一询问包不符合所述DNS协议规范。With reference to the second aspect, in yet another possible implementation of the second aspect, the parsing unit is further configured to, when the length indication field carried in the first query packet and the length indication field located after the length indication field When the actual data lengths are inconsistent, it is determined that the first query packet does not conform to the DNS protocol specification.

结合第二方面,在第二方面的又一种可能的实现中,所述解析单元,还用于在确定所述第一询问包不符合所述DNS协议规范的情况下,获取所述源端IP地址请求的域名,所述域名通过预设字符串表示;判断通过所述预设字符串表示的域名中是否存在ASCII码之外的字符,如果存在,则确定所述源端到所述目的端之间存在DNS隧道木马。With reference to the second aspect, in yet another possible implementation of the second aspect, the parsing unit is further configured to obtain the source end when it is determined that the first query packet does not conform to the DNS protocol specification The domain name requested by the IP address, the domain name is represented by a preset character string; it is judged whether there are characters other than ASCII codes in the domain name represented by the preset character string, and if so, determine the source end to the destination There is a DNS tunneling Trojan between the endpoints.

结合第二方面,在第二方面的又一种可能的实现中,所述解析单元,还用于不存在所述ASCII码之外的字符的情况下,获取与所述第一询问包对应的第一响应包,解析所述第一响应包得到第一数据,所述第一数据中包含数据类型和长度;所述确定单元,还用于在所述第一数据中的数据类型和长度均符合DNS协议规范时,确定不存在DNS隧道木马。With reference to the second aspect, in yet another possible implementation of the second aspect, the parsing unit is further configured to obtain a query packet corresponding to the first query packet in the absence of characters other than the ASCII code. The first response packet, which parses the first response packet to obtain first data, where the first data includes a data type and a length; the determining unit is further configured to determine whether the data type and length in the first data are equal. When the DNS protocol specification is complied with, it is determined that there is no DNS tunneling Trojan.

结合第二方面,在第二方面的又一种可能的实现中,所述确定单元,还用于当所述第一数据中的数据类型和长度的至少之一不符合所述DNS协议规范时,确定存在DNS隧道木马。With reference to the second aspect, in yet another possible implementation of the second aspect, the determining unit is further configured to when at least one of the data type and length in the first data does not conform to the DNS protocol specification , it is determined that there is a DNS tunneling Trojan.

可选的,结合第二方面,在第二方面的上述各种可能的实现中,所述数据包为第一检测周期内的所有数据包,或者,为从检测到的第一个响应包之后开始到所述第一检测 周期结束时采集的所有数据包。Optionally, in combination with the second aspect, in various possible implementations of the second aspect, the data packets are all data packets in the first detection period, or, after the detection of the first response packet All data packets collected from the beginning to the end of the first detection period.

第三方面,本申请提供了一种检测设备,该设备包括处理器和存储器,且处理器与存储器耦合,具体地,存储器用于存储计算机程序指令;处理器用于执行存储器中存储的所述指令,以使得所述检测设备执行前述第一方面及第一方面各种实现方式中的方法。In a third aspect, the present application provides a detection device, the device includes a processor and a memory, and the processor is coupled to the memory, specifically, the memory is used to store computer program instructions; the processor is used to execute the instructions stored in the memory. , so that the detection device executes the aforementioned first aspect and the methods in various implementations of the first aspect.

具体地,上述第二方面中各个单元模块,比如采集单元、解析单元和确定单元等的功能可通过所述处理器和所述存储器来实现。Specifically, the functions of each unit module in the second aspect above, such as the collection unit, the analysis unit, and the determination unit, may be implemented by the processor and the memory.

可选的,所述检测设备为一种处理芯片,或芯片系统。Optionally, the detection device is a processing chip or a chip system.

可选的,所述检测设备为一种网络设备,或部署在网络设备中的功能模块。Optionally, the detection device is a network device, or a functional module deployed in the network device.

此外,所述装置还可以包括至少一个通信接口,收发器、传感器等部件。In addition, the apparatus may also include at least one communication interface, transceiver, sensor and other components.

第四方面,本申请还提供了一种计算机可读存储介质,该存储介质中存储有指令,使得当指令在计算机或处理器上运行时,可以用于执行前述第一方面以及第一方面各种实现方式中的方法。In a fourth aspect, the present application also provides a computer-readable storage medium, in which instructions are stored, so that when the instructions are executed on a computer or a processor, the instructions can be used to execute the foregoing first aspect and each of the first aspects. method in an implementation.

另外,本申请还提供了一种计算机程序产品,该计算机程序产品包括计算机指令,当该指令被计算机或处理器执行时,可实现前述第一方面或第一方面的各种实现方式中的方法。In addition, the present application also provides a computer program product, the computer program product includes computer instructions, when the instructions are executed by a computer or a processor, the aforementioned first aspect or the method in various implementation manners of the first aspect can be implemented .

需要说明的是,上述第二方面至第四方面的各种实现方式的技术方案所对应的有益效果与前述第一方面以及第一方面的各种实现方式的有益效果相同,具体参见上述第一方面以及第一方面的各种实现方式中的有益效果描述,不再赘述。It should be noted that the beneficial effects corresponding to the technical solutions of the various implementation manners of the second aspect to the fourth aspect are the same as the beneficial effects of the foregoing first aspect and various implementation manners of the first aspect. For details, please refer to the foregoing first aspect. Aspects and descriptions of beneficial effects in various implementation manners of the first aspect will not be repeated.

附图说明Description of drawings

图1为本申请实施例提供的一种建立客户端与服务器之间通信连接的示意图;1 is a schematic diagram of establishing a communication connection between a client and a server according to an embodiment of the present application;

图2为本申请实施例提供的另一种建立客户端与服务器之间通信连接的示意图;2 is another schematic diagram of establishing a communication connection between a client and a server according to an embodiment of the present application;

图3为本申请实施例提供的一种对pcap文件解析后得到的数据内容的示意图;3 is a schematic diagram of data content obtained after parsing a pcap file provided by an embodiment of the present application;

图4为本申请实施例提供的一种木马检测方法的流程图;4 is a flowchart of a Trojan horse detection method provided by an embodiment of the present application;

图5为本申请实施例提供的另一种木马检测方法的流程图;5 is a flowchart of another Trojan horse detection method provided by an embodiment of the present application;

图6为本申请实施例提供的一种解析DNS数据包后得到数据内容的示意图;6 is a schematic diagram of obtaining data content after parsing a DNS data packet according to an embodiment of the present application;

图7为本申请实施例提供的一种解析得到数据内容的示意图;7 is a schematic diagram of obtaining data content by parsing according to an embodiment of the present application;

图8为本申请实施例提供的又一种木马检测方法的流程图;8 is a flowchart of another Trojan horse detection method provided by an embodiment of the present application;

图9为本申请实施例提供的另一种解析得到数据内容的示意图;9 is another schematic diagram of obtaining data content by parsing provided by an embodiment of the present application;

图10为本申请实施例提供的又一种解析得到数据内容的示意图;FIG. 10 is another schematic diagram of obtaining data content by parsing provided by an embodiment of the present application;

图11为本申请实施例提供的一种木马检测装置的结构示意图;11 is a schematic structural diagram of a Trojan horse detection device provided by an embodiment of the application;

图12为本申请实施例提供的一种检测设备的结构示意图。FIG. 12 is a schematic structural diagram of a detection device provided by an embodiment of the present application.

具体实施方式Detailed ways

为了使本技术领域的人员更好地理解本申请实施例中的技术方案,并使本申请实施例的上述目的、特征和优点能够更加明显易懂,下面结合附图对本申请实施例中的技术方案作进一步详细的说明。In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present application, and to make the above-mentioned purposes, features and advantages of the embodiments of the present application more clearly understood, the following describes the technical solutions in the embodiments of the present application with reference to the accompanying drawings. The program is described in further detail.

在对本申请实施例的技术方案说明之前,首先结合附图对本申请实施例的应用场景和相关技术术语进行介绍。Before describing the technical solutions of the embodiments of the present application, the application scenarios and related technical terms of the embodiments of the present application are first introduced with reference to the accompanying drawings.

本申请的技术方案可应用于一种网络系统,比如智能网联汽车系统,如图1所示 在智能网络汽车系统场景下,包含至少一个客户端(client)和至少一个服务端(server),另外还可以包括其他网络设备,比如网关(gate way,GW)、远程信息处理器(Telematics BOX,T-box)。其中,客户端与服务端,以及GW之间的通信传输遵循DNS协议。The technical solution of the present application can be applied to a network system, such as an intelligent networked vehicle system. As shown in FIG. 1 , in the scenario of an intelligent networked vehicle system, it includes at least one client (client) and at least one server (server), In addition, other network devices may also be included, such as a gateway (gateway, GW), and a telematics processor (Telematics BOX, T-box). Among them, the communication transmission between the client, the server, and the GW follows the DNS protocol.

本实施例提供的方法可应用于一种检测装置,该检测装置可作为一个独立的网络设备部署在网络系统中,或者还可以被部署在车辆网关GW,T-box、或者DNS服务器中。并且,所述T-box存在DNS数据需求的局域网内,不需要全流量解析。The method provided in this embodiment may be applied to a detection apparatus, and the detection apparatus may be deployed in a network system as an independent network device, or may also be deployed in a vehicle gateway GW, T-box, or DNS server. In addition, the T-box exists in the local area network where DNS data is required, and does not require full traffic analysis.

首先,对DNS协议和DNS协议中的相关概念做简要介绍。First, a brief introduction to the DNS protocol and related concepts in the DNS protocol is given.

DNS直译为域名系统,是将域名和IP地址进行映射的一个网络服务,在一般应用场景下,采用client/server网络连接方式的进行部署。例如将一个网络终端作为client(客户端),可以指定一个公认的具备域名解析功能的server(服务端),比如Google公司的一个免费DNS域名所映射的server的地址为8.8.8.8。DNS is literally translated into Domain Name System, which is a network service that maps domain names and IP addresses. In general application scenarios, it is deployed in a client/server network connection. For example, using a network terminal as a client (client), a recognized server (server) with domain name resolution function can be specified. For example, the address of the server mapped by a free DNS domain name of Google is 8.8.8.8.

域名(Domain Name)是由一串用点分隔的名字组成的Internet上某一台计算机或计算机组的名称,用于在数据传输时对计算机的定位标识(有时也指地理位置)。由于IP地址具有不方便记忆并且不能显示地址组织的名称和性质等缺点,因此人们设计出了域名,并通过DNS来将域名和IP地址相互映射,从而使用户更方便地访问互联网,避免去记住能够被机器直接读取的IP地址数串。Domain Name is the name of a computer or computer group on the Internet consisting of a string of names separated by dots, which is used to locate and identify computers (sometimes also refer to geographic locations) during data transmission. Because IP addresses are inconvenient to remember and cannot display the name and nature of the address organization, people have designed domain names and mapped the domain names and IP addresses to each other through DNS, so that users can access the Internet more easily and avoid remembering A string of IP addresses that can be directly read by a machine.

具体地,建立client与server之间通信连接的过程可参见图1所示,当client需要完成某个网络业务时,会向DNS服务器(DNS server)端发送一个请求消息,该请求消息中包含域名,比如www.example.com,该请求消息可用于询问www.example.com的IP地址。DNS server端接收后根据自身数据库当中存储的域名与IP地址的映射关系,查找出与域名www.example.com关联的IP地址,并将该IP地址标记为IP_DST,表示目的端IP地址。DNS server端将该IP_DST通过响应数据反馈给client,client收到响应数据后,解析出IP_DST,随后client的IP地址IP_SRC与IP_DST建立新的网络连接,实现特定的网络业务。其中SRC为Source的缩写,表示“源端”,DST为Destination的缩写,表示“目的端”。Specifically, the process of establishing a communication connection between the client and the server can be seen in Figure 1. When the client needs to complete a certain network service, it will send a request message to the DNS server (DNS server), and the request message contains the domain name. , such as www.example.com, the request message can be used to ask for the IP address of www.example.com. After receiving it, the DNS server finds out the IP address associated with the domain name www.example.com according to the mapping relationship between the domain name and the IP address stored in its own database, and marks the IP address as IP_DST, indicating the destination IP address. The DNS server feeds back the IP_DST to the client through the response data. After the client receives the response data, it resolves the IP_DST, and then the client's IP address IP_SRC establishes a new network connection with IP_DST to implement specific network services. SRC is the abbreviation of Source, which means "source", and DST is the abbreviation of Destination, which means "destination".

另外,在包含GW的场景下,比如在某一局域网场景,可指定一个GW为server端,利用该GW转发局域网内各个client的域名请求消息,然后再将外部DNS server根据各个域名请求消息所返回的IP_DST地址转发给对应的client,其原理如图2所示,具体的实现过程可参考图1的交互过程,本实施例对此不再赘述。In addition, in a scenario involving a GW, such as in a local area network scenario, a GW can be designated as the server side, and the GW can be used to forward the domain name request messages of each client in the local area network, and then the external DNS server returns according to each domain name request message. The IP_DST address is forwarded to the corresponding client. The principle is shown in FIG. 2 . For the specific implementation process, refer to the interaction process in FIG. 1 , which is not repeated in this embodiment.

在上述各个client与DNS server,或者client与交换机之间传输数据时,通过DNS隧道传输的流量可能存在DNS隧道木马,因此本申请目的是检测网络传输通道中是否被存在DNS隧道木马。When data is transmitted between the above clients and the DNS server, or between the client and the switch, there may be a DNS tunnel Trojan horse in the traffic transmitted through the DNS tunnel. Therefore, the purpose of this application is to detect whether there is a DNS tunnel Trojan horse in the network transmission channel.

下面对本申请的技术方案中涉及的其他术语概念进行介绍。The following introduces other terminology concepts involved in the technical solutions of the present application.

(1)HTTP协议和HTTPs协议(1) HTTP protocol and HTTPs protocol

HTTP协议(Hypertext Transfer Protocol,超文本传输协议)是用来在Internet上传送超文本的传送协议。它是运行在TCP/IP协议族之上的HTTP应用协议,它可以使浏览器更加高效,使网络传输减少。The HTTP protocol (Hypertext Transfer Protocol, Hypertext Transfer Protocol) is a transmission protocol used to transmit hypertext on the Internet. It is an HTTP application protocol running on top of the TCP/IP protocol suite, which can make browsers more efficient and reduce network transmissions.

HTTPs协议(Hyper Text Transfer Protocol over SecureSocket Layer,超文本传输安全协议)是由HTTP加上TLS/SSL协议构建的可进行加密传输、身份认证的网络协 议,主要通过数字证书、加密算法、非对称密钥等技术完成互联网数据传输加密,实现互联网传输安全保护。HTTPs protocol (Hyper Text Transfer Protocol over SecureSocket Layer) is a network protocol constructed by HTTP plus TLS/SSL protocol that can perform encrypted transmission and identity authentication, mainly through digital certificates, encryption algorithms, asymmetric encryption Encryption of Internet data transmission and security protection of Internet transmission through technologies such as encryption keys.

安全套接字协议(Secure Sockets Layer,SSL),及其继任者传输层安全(Transport Layer Security,TLS)是为网络通信提供安全及数据完整性的一种安全协议。TLS与SSL在传输层与应用层之间对网络连接进行加密。Secure Sockets Layer (SSL), and its successor, Transport Layer Security (TLS), are a security protocol that provides security and data integrity for network communications. TLS and SSL encrypt network connections between the transport layer and the application layer.

(2)RFC文档(2) RFC document

RFC文档也称请求注解文档(Requests for Comments,RFC),这是用于发布Internet标准和Internet其他正式出版物的一种网络文件或工作报告。RFC文档初创于1969年,RFC出版物由RFC编辑(RFC Editor)直接负责,并接受体系结构委员会(Internet Architecture Board,IAB)的一般性指导。现在已经有3000多个RFC系列文件,并且这个数目还在不断增加,内容和Internet(开始叫做为ARPANET)相关。草案讨论了计算机通讯的方方面面,重点在网络协议,过程,程序,以及一些会议注解,意见,风格方面的概念。An RFC document is also called a Request for Comments document (Requests for Comments, RFC), which is a network document or work report used to publish Internet standards and other official publications on the Internet. The RFC document was created in 1969, and the RFC publication is directly responsible for the RFC Editor (RFC Editor), and accepts the general guidance of the Internet Architecture Board (IAB). There are now more than 3000 RFC series documents, and this number is still increasing, and the content is related to the Internet (originally called ARPANET). The draft discusses all aspects of computer communication, with emphasis on network protocols, processes, procedures, and some notions of conference notes, opinions, and style.

(3)pcap文件(3) pcap file

pcap是常用的数据包存储格式,可以理解为就是一种文件格式,里面的数据是按照特定格式存储的,所以如果想要解析里面的数据,就必须按照一定的格式。利用专业工具,比如用安装了HEX-Editor插件的Notepad++打开pcap文件,能够显示16进制数据的格式,再用wireshark这种抓包工具就可以正常打开这种文件,查看里面的网络数据报了,同时wireshark也可以生成这种格式的文件。当然还可以使用其它工具来查看pcap文件。pcap is a commonly used data packet storage format, which can be understood as a file format. The data in it is stored in a specific format, so if you want to parse the data in it, you must follow a certain format. Using professional tools, such as opening the pcap file with Notepad++ with the HEX-Editor plugin installed, can display the format of the hexadecimal data, and then use the packet capture tool such as wireshark to open the file normally and view the network datagram inside. , and wireshark can also generate files in this format. Of course, other tools can also be used to view pcap files.

一个pcap文件包括pcap报头(Pcap Header)和数据区两个部分,其中,数据区又分成多个数据包,每个包中包括数据包头(Packet Header)和数据(Packet Data)两个部分,总体结构如下表1所示:A pcap file includes two parts, the pcap header (Pcap Header) and the data area. The data area is divided into multiple data packets, and each packet includes two parts: the data packet header (Packet Header) and the data (Packet Data). The structure is shown in Table 1 below:

表1Table 1

Figure PCTCN2020130593-appb-000001
Figure PCTCN2020130593-appb-000001

其中,Pcap报头是文件头,每一个pcap文件只有一个文件头,总共占24(B)字节。数据包头可以有多个,每个数据包头后面都跟着真正的数据包。以下是Packet Header的4个字段含义;Among them, the Pcap header is the file header, and each pcap file has only one file header, occupying a total of 24 (B) bytes. There can be multiple headers, and each header is followed by the actual packet. The following are the meanings of the four fields of the Packet Header;

Timestamp(4B):时间戳高位,精确到秒(seconds),这是Unix操作系统时间戳。可用于记录捕获数据包的时间。Timestamp(4B):时间戳低位,能够精确到毫秒(microseconds)。Caplen(4B):当前数据区的长度,即抓取到的数据帧长度,由此可以得到下一个数据帧的位置。Len(4B):离线数据长度,网路中实际数据帧的长度,一般不大于Caplen,多数情况下和Caplen值一样。Timestamp(4B): The high bit of the timestamp, accurate to seconds (seconds), which is the timestamp of the Unix operating system. Can be used to log when packets were captured. Timestamp (4B): low-order timestamp, accurate to milliseconds (microseconds). Caplen(4B): The length of the current data area, that is, the length of the captured data frame, from which the position of the next data frame can be obtained. Len(4B): Offline data length, the length of the actual data frame in the network, generally not greater than Caplen, in most cases the same as the Caplen value.

Packet Data中,Packet是链路层的数据帧,长度就是Packet Header中定义的Caplen值,所以每个Packet Header后面都跟着Caplen长度的Packet Data。也就是说pcap文件并没有规定捕获的数据帧之间有什么间隔字符串。Packet数据帧部分的格式为标准的网络协议格式。参见图3所示,为对pcap文件解析后得到的数据内容示意图。第一 行“0000”中的字符串表示Pcap Header,第二行“0010”和第三行“0020”部分字符串表示的是Packet Header,本示例中省略Packet Header中的字符串。重点关注第四行“0030”中包含Caplen值和位于每个Caplen值后面的数据(Packet Data),该数据通过一系列的字符串表示。比如当Caplen值为“02”时,表示后面的字符串1的长度为两个字节;当Caplen值为“04”时,表示后面的字符串2的长度为4个字节;Caplen值为“03”时,表示后面的字符串3的长度为3个字节,以此类推。In Packet Data, Packet is the data frame of the link layer, and the length is the Caplen value defined in the Packet Header, so each Packet Header is followed by Packet Data of Caplen length. That is to say, the pcap file does not specify any interval strings between captured data frames. The format of the packet data frame part is the standard network protocol format. Referring to Figure 3, it is a schematic diagram of the data content obtained after parsing the pcap file. The string in the first line "0000" represents the Pcap Header, and the strings in the second line "0010" and the third line "0020" represent the Packet Header. In this example, the string in the Packet Header is omitted. Focus on the fourth line "0030" that contains Caplen values and the data (Packet Data) behind each Caplen value, which is represented by a series of strings. For example, when the Caplen value is "02", it means that the length of the following string 1 is two bytes; when the Caplen value is "04", it means that the length of the following string 2 is 4 bytes; the Caplen value is When "03", it means that the length of the following string 3 is 3 bytes, and so on.

下面对本申请的技术方案进行说明。The technical solution of the present application will be described below.

本申请为了从流量分析中检测出针对智能网联设备的DNS隧道木马,提供的检测装置需要具备从IP流量数据中过滤并解析DNS协议的功能,以及具备从DNS响应报文给出的服务器IP地址与源端之间通信的数据中关联搜索的功能。In order to detect DNS tunnel Trojans targeting intelligent network-connected devices from traffic analysis, the detection device provided in this application needs to have the function of filtering and parsing DNS protocol from IP traffic data, and the server IP address given from the DNS response message. The function of correlation search in the data communicated between the address and the source.

参见图4,为本申请提供了一种木马检测方法的流程图,该方法可应用于一种检测装置,该检测装置可以位于GW上,或者还可以作为一个独立的网络设备,位于GW和client(客户端)之间任意位置。或者还可以位于网络中的其他位置,本实施例对此不予限制。该方法包括:Referring to FIG. 4, the present application provides a flow chart of a Trojan horse detection method. The method can be applied to a detection device, and the detection device can be located on the GW, or can also be used as an independent network device, located in the GW and the client. (clients) anywhere between. Alternatively, it may also be located at another location in the network, which is not limited in this embodiment. The method includes:

101:接收来自源端的第一询问包,所述第一询问包中包括源端的IP地址。101: Receive a first query packet from the source end, where the first query packet includes the IP address of the source end.

所述源端为某一客户端,所述目的端为源端请求进行业务传输的网络设备。所述第一询问包是所述源端向DNS服务器发送的DNS数据包。The source is a client, and the destination is a network device that the source requests to perform service transmission. The first query packet is a DNS data packet sent by the source end to the DNS server.

此外,所述源端所对应的地址为源端IP地址,所述源端的IP地址可通过解析所述第一询问包获得,或者,从DNS服务器中获得,本实施例对获得方式不予限制。In addition, the address corresponding to the source end is the IP address of the source end, and the IP address of the source end can be obtained by parsing the first query packet, or obtained from a DNS server, and the obtaining method is not limited in this embodiment .

102:当所述第一询问包符合域名系统DNS协议规范,获取与所述第一询问包对应的第一响应包,所述第一响应包为DNS服务器发送。102: When the first query packet conforms to the DNS protocol specification of the domain name system, obtain a first response packet corresponding to the first query packet, where the first response packet is sent by the DNS server.

所述第一响应包是所述DNS服务器根据第一询问包查找到的响应数据包,该响应数据包中包括目的IP地址,且所述第一响应包也为DNS数据包。所述第一询问包可以是检测周期内的第一个DNS数据包,或者也可以是中间某一个DNS数据包。The first response packet is a response packet found by the DNS server according to the first query packet, the response packet includes a destination IP address, and the first response packet is also a DNS packet. The first query packet may be the first DNS data packet in the detection period, or may also be a certain DNS data packet in the middle.

所述符合DNS协议规范是指,对第一询问包解析后得到的数据内容,数据结构符合DNS协议规范,比如DNS协议中包含Caplen值与该Caplen值后指示Packet Data长度等。Complying with the DNS protocol specification means that the data content obtained after parsing the first query packet, the data structure conforms to the DNS protocol specification, for example, the DNS protocol contains the Caplen value and the Caplen value and indicates the length of the Packet Data, etc.

103:解析所述第一响应包得到至少一个目的IP地址。103: Parse the first response packet to obtain at least one destination IP address.

所述至少一个目的IP地址归属于所述目的端,由于一个目的端可能包含多个服务地址,所以解析第一响应包会获得一个或多个目的IP地址。并且,一个源端IP地址与解析的一个目的IP地址之间存在一条通信链路,如果解析有N个目的IP地址,则源端IP地址与N个目的IP地址间存在N条通信链路。然后判断N条通信链路上的数据包传输情况。The at least one destination IP address belongs to the destination end. Since one destination end may include multiple service addresses, one or more destination IP addresses will be obtained by parsing the first response packet. In addition, there is a communication link between one source IP address and one resolved destination IP address. If N destination IP addresses are resolved, there are N communication links between the source IP address and the N destination IP addresses. Then, the data packet transmission situation on the N communication links is judged.

判断所述源端IP地址和所述至少一个目的IP地址之间是否均存在数据包。It is judged whether there is a data packet between the source IP address and the at least one destination IP address.

104:如果所述源端IP地址和所述至少一个目的IP地址之间均不存在数据包,则确定所述源端到所述目的端之间存在DNS隧道木马。104: If there is no data packet between the source IP address and the at least one destination IP address, determine that a DNS tunnel Trojan exists between the source and the destination.

另外,上述方法还包括:如果所述源端IP地址和每个所述至少一个目的IP地址之间均存在数据包,则确定所述源端到所述目的端之间不存在DNS隧道木马。In addition, the above method further includes: if there is a data packet between the source IP address and each of the at least one destination IP address, determining that there is no DNS tunnel Trojan horse between the source and the destination.

因为在正常的(或不存在)DNS隧道木马的通信过程当中,当请求域名对应的IP地址被DNS服务器解析出目的IP地址时,DNS数据通信中必然存在源端与目的端之间的通信数据包,产生通信流量。如果检测装置采集的数据过程中,没有采集到源端和目的端之间的数据包传输,则确定存在DNS隧道木马;反之,如果有一条或者一条以上的通信链路检测到数据包传输,则确定源端和目的端之间不存在DNS隧道木马。Because in the normal (or non-existent) communication process of the DNS tunnel Trojan, when the IP address corresponding to the requested domain name is resolved by the DNS server to the destination IP address, there must be communication data between the source and the destination in the DNS data communication. packets, which generate communication traffic. If the data packet transmission between the source end and the destination end is not collected during the data collection by the detection device, it is determined that there is a DNS tunnel Trojan; on the contrary, if one or more than one communication link detects data packet transmission, then Make sure that there is no DNS tunneling Trojan between the source and destination.

本方法能够检测出完全符合DNS协议规范的数据流中,是否隐藏有DNS隧道木马,解决了基于一般规则的入侵检测系统无法发现高隐蔽性DNS隧道木马的问题。The method can detect whether there is a DNS tunnel Trojan hidden in a data stream that fully complies with the DNS protocol specification, and solves the problem that the intrusion detection system based on general rules cannot find the DNS tunnel Trojan with high concealment.

下面对上述步骤101至104的检测过程进行详细说明。参见图5,本实施例提供的检测方法包括:The detection process of the above steps 101 to 104 will be described in detail below. Referring to Figure 5, the detection method provided by this embodiment includes:

201:启动检测装置,获取在第一检测周期内采集的第一数据包集合。201 : Start the detection apparatus to acquire a first data packet set collected in a first detection period.

其中,第一数据包集合为检测装置在第一检测周期内采集的所有数据包,统称为第一数据包集合,简称“Data 1”。其中该第一数据包集合中包括不同类型的数据包,比如包括但不限于DNS数据包、HTTP数据包、TCP数据包、TLS数据包等。Wherein, the first data packet set is all the data packets collected by the detection device in the first detection period, which are collectively referred to as the first data packet set, referred to as "Data 1". The first data packet set includes different types of data packets, for example, including but not limited to DNS data packets, HTTP data packets, TCP data packets, TLS data packets, and the like.

具体地,检测装置周期性地检测各个客户端与目的端之间的数据。比如在第一检测周期对客户端1(client 1)与目的端1(DST 1)之间的数据进行检测,获得第一检测周期内的所有数据包。例如,假设第一检测周期内目标检测数据包的数量为2000个,当检测到第一个DNS数据包时开始计数,到第2000个数据包为止,所包含的所有数据包组成第一数据包集合。如图6所示,如果第1个DNS数据包所对应的编号(No.)是13219,第2000个数据包的编号为15219,则编号从第13219至第15219的数据包集合为所述第一数据包集合。Specifically, the detection device periodically detects data between each client and the destination. For example, in the first detection cycle, the data between the client 1 (client 1) and the destination end 1 (DST 1) is detected, and all data packets in the first detection cycle are obtained. For example, assuming that the number of target detection data packets in the first detection period is 2000, the count starts when the first DNS data packet is detected, and until the 2000th data packet, all the contained data packets constitute the first data packet gather. As shown in Figure 6, if the number (No.) corresponding to the first DNS packet is 13219 and the number of the 2000th packet is 15219, then the set of packets numbered from the 13219th to the 15219th is the A collection of packets.

或者,检测装置获取之前某一时间段内的所有数据包,比如在当前时刻之前的近10min之内,获取源端和目的端之间传输的所有数据包,作为所述第一数据包集合。Alternatively, the detection device acquires all the data packets in a certain period of time before, for example, within nearly 10 minutes before the current moment, and acquires all the data packets transmitted between the source end and the destination end as the first data packet set.

此外,编号为13219的DNS数据包为一种询问包,该询问包被client 1发出之后,在编号第13385个包中检测到第一响应包,该第一响应包与第一询问包对应的DNS数据包。本实施例中,将从编号第13385(不含)之后的第一个数据包,即从编号第13386的数据包开始至编号第15219之间的所有数据包,称为第二数据包集合,本实施例将所述第二数据包集合简称为“Data 2”。且所述第二数据包集合中至少包括:DNS、HTTP、TCP、TLS等类型的数据包。In addition, the DNS data packet numbered 13219 is a kind of query packet. After the query packet is sent by client 1, a first response packet is detected in the number 13385 packet, and the first response packet corresponds to the first query packet. DNS packets. In this embodiment, the first data packet after the No. 13385 (excluding), that is, all the data packets from the No. 13386 data packet to the No. 15219, is called the second data packet set, In this embodiment, the second data packet set is referred to as "Data 2" for short. And the second data packet set at least includes: DNS, HTTP, TCP, TLS and other types of data packets.

需要说明的是,本实施例对上述Data 1和Data 2进行研究,对在编号第13219个包之前的数据包不予关心。It should be noted that, in this embodiment, the above-mentioned Data 1 and Data 2 are studied, and the data packets before the numbered 13219th packet are not concerned.

202:通过目标端口过滤出所述第一检测周期内的所有DNS数据包。202: Filter out all DNS data packets in the first detection period through the target port.

检测装置从所述第一数据包集合中获得筛选出所有DNS数据包。例如采用用户数据报协议(User Datagram Protocol,UDP)协议,目的端口的端口号(Dst Port)为53,在所述第一数据包集合中所有经过53号端口输出的数据包为DNS数据包。这些DNS数据包组成第三数据包集合,本实施例将该第三数据包集合简称为“Data 3”。所述第三数据包集合中仅包括DNS类型的数据包。The detection device obtains and filters out all DNS data packets from the first data packet set. For example, adopting the User Datagram Protocol (User Datagram Protocol, UDP) protocol, the port number (Dst Port) of the destination port is 53, and in the first data packet set, all the data packets output through port 53 are DNS data packets. These DNS data packets form a third data packet set, which is abbreviated as "Data 3" in this embodiment. The third data packet set includes only DNS type data packets.

如图6所示,本实施例中在第一数据包集合中筛选出的Data 3里包含两个DNS数据包,分别是编号第13219和第13385的DNS数据包,且这两个DNS数据包中一个是询问包,一个是响应包。As shown in FIG. 6 , in this embodiment, Data 3 screened out in the first data packet set includes two DNS data packets, which are the DNS data packets numbered 13219 and 13385 respectively, and these two DNS data packets are One of them is an inquiry packet and the other is a response packet.

203:从所有DNS数据包(Data 3)中选择第一询问包。203: Select the first query packet from all DNS data packets (Data 3).

检测装置对筛选出的所有DNS数据包做解析,对于每个DNS数据包解析后可得的信息如表2所示,包括:数据包编号(No.)、接收时间(Time)、源端地址(Source)、目的端地址(Destination)、协议类型(Protocol)、长度(Length)和备注(Info)等。The detection device parses all the filtered DNS packets, and the information available after parsing each DNS packet is shown in Table 2, including: packet number (No.), reception time (Time), source address (Source), destination address (Destination), protocol type (Protocol), length (Length) and remarks (Info), etc.

表2Table 2

Figure PCTCN2020130593-appb-000002
Figure PCTCN2020130593-appb-000002

其中,在“备注”信息中包含指示该数据包是否为询问包(standard query),或者是与某一询问包对应的响应包(standard query response),另外还包括域名,比如cn.xxx.com等信息。“*”表示隐藏字符,可以是0至9中的任意数值。Among them, the "remarks" information includes indicating whether the data packet is a query packet (standard query), or a response packet (standard query response) corresponding to a query packet, and also includes a domain name, such as cn.xxx.com and other information. "*" represents a hidden character, which can be any value from 0 to 9.

如果所述DNS数据包中有多个询问包,则可以选择其中的第一个数据包为所述第一询问包,或者选择其中的某一个为所述第一询问包。本实施例对具体的选择过程不做限制。If there are multiple query packets in the DNS data packet, the first data packet among them may be selected as the first query packet, or a certain one of them may be selected as the first query packet. This embodiment does not limit the specific selection process.

204:判断第一询问包是否符合DNS协议规范。204: Determine whether the first query packet conforms to the DNS protocol specification.

具体地,一种实现方式是,按照“RFC文档”中关于DNS的相关规定,对数据按照字段进行逐段解析,判断各个字段的取值是否均在规定的范围内,如果每个字段的取值都在规定的范围之内,则判断该第一询问包为符合DNS协议规范,具体的要求DNS规范当中列举的极为详细,这里不做赘述。Specifically, an implementation method is to parse the data segment by segment according to the relevant provisions on DNS in the "RFC document", and determine whether the values of each field are within the specified range. If the value of each field is within the specified range If the values are all within the specified range, it is judged that the first query packet conforms to the DNS protocol specification. The specific requirements are listed in the DNS specification in great detail, and will not be repeated here.

实际操作过程当中可以按照规范编写程序进行判断,或者也可以调用pcap读取解析软件应用程序编程接口(Application Programming Interface,API)进行判断,参见图7为一种结合开源pcap来读取解析软件得到的解析结果,该解析结果是解析软件对DNS询问包解析后输出的。In the actual operation process, the program can be judged according to the specification, or the application programming interface (Application Programming Interface, API) of the pcap reading and parsing software can be called to make judgment. See Figure 7 for a combination of open source pcap to read and analyze the software to obtain The parsing result is output after parsing the DNS query packet by the parsing software.

比如,以解析第一询问包为例,图7中的“0030”行和“0040”行是stander query数据包中较为关键的部分,每个圆圈中的指示字段为Caplen值(或称Caplen长度指示字段),单位为字节,用于指示位于其后的数据长度。比如“02”指示后面段(位于Caplen值的Packet Data)的数据长度为两个字节,“04”指示后面段的数据长度为4个字节,“03”指示后面段的数据长度为3个字节,“00”指示后面段的数据长度为0的字节。在步骤204中判断是否符合DNS协议规范,可具体地理解为:判断长度指示字段与后面段的实际数据长度是否一致。如果存在一个或一个以上长度指示字段与位于该字段后的数据(方框)的实际长度不一致,则判断该第一询问包不符合DNS协议规范。For example, taking the parsing of the first query packet as an example, the lines "0030" and "0040" in Figure 7 are the key parts of the stander query data packet, and the indication field in each circle is the Caplen value (or the Caplen length). Indication field), in bytes, to indicate the length of the data that follows it. For example, "02" indicates that the data length of the following segment (Packet Data in the Caplen value) is two bytes, "04" indicates that the data length of the following segment is 4 bytes, and "03" indicates that the data length of the following segment is 3 Bytes, "00" indicates that the data length of the following segment is 0 bytes. In step 204, judging whether the DNS protocol specification is complied with can be specifically understood as: judging whether the length indication field is consistent with the actual data length of the following segment. If there is one or more length indication fields that are inconsistent with the actual length of the data (box) located behind the fields, it is determined that the first query packet does not conform to the DNS protocol specification.

205:如果是,则从该第一询问包中获得源端SRC的IP地址。205: If yes, obtain the IP address of the source SRC from the first query packet.

如果是,即判断第一询问包中解析的所有长度指示字段与后面段的实际数据长度都一致,则根据上述表2所示的信息获得源端IP地址,该源端设备的IP地址可表示为IP_SRC。具体地,一种可能的实施方式是,检测装置先根据解析的表2中的信息确定当前被检测的询问包的目的端IP地址,即DST的IP地址,然后根据该目的端IP地址确定所述源端的IP地址,即IP_SRC。If yes, that is, it is judged that all length indication fields parsed in the first query packet are consistent with the actual data lengths of the following segments, then the source IP address is obtained according to the information shown in Table 2 above, and the IP address of the source device can represent is IP_SRC. Specifically, a possible implementation is that the detection device first determines the destination IP address of the currently detected query packet, that is, the IP address of the DST, according to the parsed information in Table 2, and then determines the destination IP address according to the destination IP address. The IP address of the source end, i.e. IP_SRC.

206:接上述步骤205,根据第一询问包的解析内容确定与所述第一询问包对应的第一响应包。与前述实施例的步骤102相同。206: Continue to step 205, and determine a first response packet corresponding to the first query packet according to the parsed content of the first query packet. It is the same as step 102 in the previous embodiment.

具体地,在上述Data 3中查找与第一询问包的源端IP地址和目的端IP地址分别对应的DNS数据包,比如在第一询问包中的源端IP地址“192.168.*.**”是另一个DNS数据包的目的端地址,而第一询问包中的目的端地址“192.168.*.*”是该另一个数据包的源端地址,且该另一个数据包在“备注”信息中是standard query response包,则确定该另一个DNS数据包与第一询问包对应的第一响应包。Specifically, look up the DNS data packets corresponding to the source IP address and destination IP address of the first query packet in the above-mentioned Data 3, such as the source IP address "192.168.*.** in the first query packet. ” is the destination address of another DNS packet, and the destination address “192.168.*.*” in the first query packet is the source address of the other packet, and the other packet is in “Remarks” If the information is a standard query response packet, then determine the first response packet corresponding to the other DNS data packet and the first query packet.

本实施例中,每一个询问包对应一个响应包。In this embodiment, each inquiry packet corresponds to a response packet.

207:解析第一响应包,从该第一响应包中得到目的端的IP地址集合,所述目的端的IP地址集合中包括至少一个目的IP地址。与前述实施例的步骤103相同。207: Parse the first response packet, and obtain an IP address set of the destination terminal from the first response packet, where the IP address set of the destination terminal includes at least one destination IP address. It is the same as step 103 in the previous embodiment.

一种实现方式是,按照“RFC文档”中DNS协议规范,对第一响应包进行编程解析,或者利用pcap读取解析API解析得到解析结果。例如,该解析结果中包括DNS服务器在第一响应数据包中解析出的两个目的地址IP_DST,并标记这两个目的IP地址分别为:IP_DST1为202.**.**.**0,IP_DST2为202.**.**.**1。进而得到所述目的端IP地址集合中包括IP_DST1和IP_DST2。An implementation manner is to programmatically parse the first response packet according to the DNS protocol specification in the "RFC document", or to use pcap to read and parse the parsing API to obtain the parsing result. For example, the parsing result includes two destination addresses IP_DST parsed by the DNS server in the first response data packet, and marks the two destination IP addresses as: IP_DST1 is 202.**.**.**0, IP_DST2 is 202.**.**.**1. It is further obtained that the destination IP address set includes IP_DST1 and IP_DST2.

208:判断源端IP地址和至少一个目的IP地址之间是否均存在数据包。208: Determine whether there is a data packet between the source IP address and at least one destination IP address.

即判断源端IP地址与每个目的IP地址之间是否都有传输的数据包存在。所述数据包可以是上述的第一数据包集合,即“Data 1”;或者,也可以是上述的第二数据包集合,即“Data 2”。That is, it is determined whether there are data packets transmitted between the source IP address and each destination IP address. The data packet can be the above-mentioned first data packet set, namely "Data 1"; or, it can also be the above-mentioned second data packet set, namely "Data 2".

本实施例中,以检测上述Data 2的流量传输为例,检测装置按照源端地址IP_SRC过滤Data 2的流量,分别搜索IP_SRC与IP_DST_i,(i≥1且为正整数)的通信数据;这种基于IP_SRC与DNS响应数据包中给出的IP_DST_i,在IP流量中进行成对过滤的技术,又称为关联数据搜索技术,通过该关联数据搜索技术可获知每条通信链路上是否有传输的数据包。In this embodiment, taking the detection of the traffic transmission of the above-mentioned Data 2 as an example, the detection device filters the traffic of Data 2 according to the source address IP_SRC, and searches for the communication data of IP_SRC and IP_DST_i, (i≥1 and is a positive integer); Based on the IP_DST_i given in the IP_SRC and DNS response data packets, the technology of pairwise filtering in IP traffic is also known as the associated data search technology. Through the associated data search technology, it is possible to know whether there is any transmission on each communication link. data pack.

209:如果是,则确定源端到目的端之间不存在DNS隧道木马。209: If yes, it is determined that there is no DNS tunnel Trojan horse between the source end and the destination end.

即均存在数据包,则确定从源端client 1到目的端DST 1之间没有DNS隧道木马。比如,IP_SRC与IP_DST1之间为第一通信链路,IP_SRC与IP_DST2之间为第二通信链路,且第一通信链路和第二通信链路中只要有一条传输链路上有数据包,则确定源端到目的端之间不存在DNS隧道木马。That is, if there are data packets, it is determined that there is no DNS tunnel Trojan from the source client 1 to the destination DST 1. For example, the first communication link is between IP_SRC and IP_DST1, the second communication link is between IP_SRC and IP_DST2, and only one transmission link between the first communication link and the second communication link has data packets on it, Then it is determined that there is no DNS tunnel Trojan horse between the source end and the destination end.

210:如果否,则确定源端到目的端之间存在DNS隧道木马。210: If not, it is determined that there is a DNS tunnel Trojan horse between the source end and the destination end.

即如果所有所述通信链路中都没有检测到Data 2数据包,则确定源端client 1到目的端DST 1之间存在DNS隧道木马。比如,上述第一通信链路和第二通信链路上都没有检测到Data 2数据包,即IP_SRC与IP_DST1和IP_DST2中两条通信链路上都没数据包传输,则确定源端到目的端之间存在DNS隧道木马。That is, if the Data 2 packets are not detected in all the communication links, it is determined that there is a DNS tunnel Trojan horse between the source client 1 and the destination DST 1. For example, if no Data 2 data packets are detected on the above-mentioned first communication link and the second communication link, that is, no data packets are transmitted on the two communication links of IP_SRC, IP_DST1 and IP_DST2, it is determined that the source end to the destination end There is a DNS tunneling Trojan in between.

因为从DNS协议的基本功能出发,DNS的本意是客户端向域名服务器,询问提供某种网络业务的服务器IP地址,这个网络业务可以是HTTP、HTTPs、以及即时通信等等。也就是说,在正常的、不存在隧道木马的通信过程当中,如果请求域名对应的IP地址也被DNS服务器解析出来IP_DST,DNS数据通信后面必然存在client端IP地址IP_SRC,与IP_DST之间的传输数据包。Because starting from the basic functions of the DNS protocol, the original intention of DNS is that the client asks the domain name server for the IP address of the server that provides a certain network service. This network service can be HTTP, HTTPs, and instant messaging. That is to say, in the normal communication process without the existence of tunnel Trojans, if the IP address corresponding to the requested domain name is also resolved by the DNS server to IP_DST, the client IP address IP_SRC must exist behind the DNS data communication, and the transmission between IP_DST and IP_SRC must exist. data pack.

本实施例中,如果检测装置采集IP数据,仅仅解析其中的DNS协议数据,且DNS响应包(或响应报文)当中已经给出IP_DST,在DNS数据后的采集到的其它协议数据中,必然存在IP_SRC与IP_DST之间通信的数据流量;反之,DNS响应包给出IP_DST地址,但没有采集到存在IP_SRC与IP_DST之间通信的数据包,则可以确定源端和目的端之间存在DNS隧道木马。In this embodiment, if the detection device collects IP data and only parses the DNS protocol data, and the DNS response packet (or response message) has given IP_DST, in the other protocol data collected after the DNS data, it must be There is data traffic communicating between IP_SRC and IP_DST; on the contrary, if the DNS response packet gives the IP_DST address, but no data packets exist for communication between IP_SRC and IP_DST, it can be determined that there is a DNS tunnel Trojan between the source and destination. .

本实施例提供的方法能够检测出完全符合DNS协议规范的数据流量中,是否隐藏有DNS隧道木马,解决了基于一般规则的入侵检测系统无法发现高隐蔽性DNS隧道木马的问题。The method provided by this embodiment can detect whether there is a DNS tunnel Trojan hidden in the data traffic that fully complies with the DNS protocol specification, which solves the problem that the intrusion detection system based on general rules cannot find the DNS tunnel Trojan with high concealment.

另外,本方法又可以避免采用基于机器学习的检测方法,需要对大量样本进行学习,同时又不可避免的存在漏报、误报的问题,并且检测过程中也无需结合DNS协议本身的功能,因此不会影响检测的效果。In addition, this method can avoid the detection method based on machine learning, which requires learning a large number of samples, and at the same time, there are inevitably the problems of false negatives and false positives, and the detection process does not need to combine the functions of the DNS protocol itself, so It will not affect the detection effect.

此外,在上述步骤204的判断中,还包括:如果否,即当前检测的第一询问包不符合DNS协议规范时,即存在一个或一个以上长度指示字段与位于该字段后的数据的实际长度不一致,比如Caplen长度指示值为“04”,但其后的数据实际长度不是4个字节,则执行以下方法步骤。具体地,如图8所示,方法包括:In addition, in the judgment of the above step 204, it also includes: if no, that is, when the currently detected first query packet does not conform to the DNS protocol specification, that is, there are one or more length indication fields and the actual length of the data behind the field Inconsistent, for example, the Caplen length indication value is "04", but the actual length of the subsequent data is not 4 bytes, then execute the following method steps. Specifically, as shown in Figure 8, the method includes:

211:获取第一询问包对应的源端地址IP_SRC请求的域名。211: Obtain the domain name requested by the source end address IP_SRC corresponding to the first query packet.

一种可能的实现方式是,在上述步骤203中,按照DNS协议中stander query的规范解析数据包,所述stander query包是IP_SRC向DNS server发出的,即图6中编号第13219的数据包。该数据包中备注信息中包含所述IP_SRC请求的域名,本实施例中,所述IP_SRC请求的域名为“cn.xxxx.com”。A possible implementation is that, in the above-mentioned step 203, the data packet is parsed according to the specification of the stander query in the DNS protocol, and the stander query packet is sent by the IP_SRC to the DNS server, that is, the data packet numbered 13219 in Figure 6. The remark information in the data packet includes the domain name requested by the IP_SRC. In this embodiment, the domain name requested by the IP_SRC is "cn.xxxx.com".

212:判断所述请求的域名中是否存在不可见字符。212: Determine whether there are invisible characters in the requested domain name.

所述IP_SRC请求的域名通过ASCII码表示,所述ASCII码(American Standard Code for Information Interchange,美国信息交换标准代码)是基于拉丁字母的一套电脑编码系统,主要用于显示现代英语和其他西欧语言。它是最通用的信息交换标准,并等同于国际标准ISO/IEC 646。ASCII第一次以规范标准的类型发表是在1967年,最后一次更新则是在1986年,到目前为止共定义了128个字符。The domain name requested by the IP_SRC is represented by ASCII code, and the ASCII code (American Standard Code for Information Interchange, American Standard Code for Information Interchange) is a set of computer coding systems based on Latin letters, mainly used to display modern English and other Western European languages . It is the most common information exchange standard and is equivalent to the international standard ISO/IEC 646. ASCII was first published as a canonical standard type in 1967, last updated in 1986, and has so far defined a total of 128 characters.

所谓不可见字符,即位于ASCII码取值范围(128个字符)之外的字符。The so-called invisible characters are characters outside the range of ASCII codes (128 characters).

213:如果是,即存在不可见字符,则确定源端到目的端之间存在DNS隧道木马。213: If yes, that is, there are invisible characters, it is determined that there is a DNS tunnel Trojan horse between the source end and the destination end.

214:如果不存在所述不可见字符,即所述IP_SRC请求的域名中的字符全都是ASCII码中的字符,则从第一询问包中确定与其对应的第一响应包。具体过程可参考前述步骤205,此处不再赘述。214: If the invisible character does not exist, that is, the characters in the domain name requested by the IP_SRC are all characters in ASCII code, determine the first response packet corresponding to the first query packet. For the specific process, reference may be made to the foregoing step 205, which will not be repeated here.

215:解析所述第一响应包,判断解析第一响应包后得到的第一数据中“数据类型和长度”是否符合DNS协议规范。215: Parse the first response packet, and determine whether the "data type and length" in the first data obtained after parsing the first response packet conforms to the DNS protocol specification.

具体地,按照DNS协议中响应数据的规范解析所述第一数据,其中响应数据是DNS server向源端地址IP_SRC发送的数据,按照DNS协议规范要求,包含如下情形:当目的端IP地址IP_DST为IPv4时,standerd query response数据包中的IP地址长度应为4;当目的端IP地址IP_DST为IPv6时,standerd query response数据包中的IP地址长度应为16。所述“数据类型和长度”检测方法具体包括:Specifically, the first data is parsed according to the specification of the response data in the DNS protocol, wherein the response data is the data sent by the DNS server to the source address IP_SRC, according to the requirements of the DNS protocol specification, including the following situation: when the destination IP address IP_DST is For IPv4, the length of the IP address in the standerd query response packet should be 4; when the destination IP address IP_DST is IPv6, the length of the IP address in the standerd query response packet should be 16. The "data type and length" detection method specifically includes:

215-1:判断解析的数据类型是IPv4还是IPv6。215-1: Determine whether the parsed data type is IPv4 or IPv6.

一种实现方法是,在第一询问包(standerd query response)中的负载部分,获得IP_DST数据长度指示字段,目前为4或6,该指示字段占1个字节,如果该字节取值为0x04,则IP_DST为IPv4;如果该字节取值为0x06,则IP_DST为IPv6。One implementation method is to obtain the IP_DST data length indication field in the load part of the first query packet (standerd query response), which is currently 4 or 6, and the indication field occupies 1 byte, if the value of the byte is 0x04, IP_DST is IPv4; if the value of this byte is 0x06, IP_DST is IPv6.

215-2:判断IPv4或者IPv6中指示的数据长度(Data length)是否为预设值,对于所述IPv4其对应的IP地址长度为第一预设值,所述第一预设值为4;对于IPv6其对应的IP地址长度为第二预设值,所述第二预设值为16。215-2: determine whether the data length (Data length) indicated in IPv4 or IPv6 is a preset value, and for the IPv4, its corresponding IP address length is a first preset value, and the first preset value is 4; For IPv6, the corresponding IP address length is a second preset value, and the second preset value is 16.

216:如果是,即IP_DST长度与结合上一步216-1中解析出的长度一致,则检测不存在DNS隧道木马。216: If yes, that is, the IP_DST length is consistent with the length parsed in the previous step 216-1, it is detected that there is no DNS tunnel Trojan.

217:如果否,即解析的IP_DST长度与结合上一步216-1的解析出的长度指示不一致,比如IP地址的数据类型为IPv4时,响应数据包中的IP地址长度不是4;或者IP地址的数据类型为IPv6时,响应数据包中的IP地址长度不是16,则判断结果为存在DNS隧道木马。217: If no, the parsed IP_DST length is inconsistent with the parsed length indication in combination with the previous step 216-1. For example, when the data type of the IP address is IPv4, the length of the IP address in the response packet is not 4; When the data type is IPv6, and the length of the IP address in the response packet is not 16, the judgment result is that there is a DNS tunnel Trojan.

图9给出图6中编号13385数据包解析的正常DNS协议standard query response解析结果,该解析目的端IP地址IP_DST的数据类型为IPv4,且地址长度满足第一预设值4,则符合DNS协议规范,进而确定不存在DNS隧道木马。Fig. 9 shows the normal DNS protocol standard query response parsing result of the number 13385 data packet parsing in Fig. 6, the data type of the parsing destination IP address IP_DST is IPv4, and the address length satisfies the first preset value 4, then conforms to the DNS protocol specification, which in turn determines that there is no DNS tunneling Trojan.

图10给出了图6中编号为13385数据包解析的发生异常的解析结果,该解析目的端IP地址IP_DST的数据类型为IPv4,但是指示字段“04”后面实际地址数据长度为3,而不是第一预设值4,即不符合DNS协议规范,则确定存在DNS隧道木马。Figure 10 shows the abnormal parsing result of the parsing of the data packet numbered 13385 in Figure 6. The data type of the IP address IP_DST of the parsing destination is IPv4, but the actual address data length after the indication field "04" is 3, instead of The first preset value of 4, that is, does not conform to the DNS protocol specification, it is determined that there is a DNS tunnel Trojan.

本方法实现了对于不符合DNS协议规范的数据流量中DNS隧道木马检测,能够在网络异常或者DNS服务器出错的情况下,准确地发现隐藏的隧道木马,并且不存在误报、漏报的情况。在网络通信正常的前提下,只要发现不符DNS合规范要求的异常数据包或报文,就可以迅速地检测出DNS隧道中是否存在DNS隧道木马。The method realizes the detection of the DNS tunnel Trojan horse in the data traffic that does not conform to the DNS protocol specification, and can accurately find the hidden tunnel Trojan horse in the case of network abnormality or DNS server error, and there are no false positives or false negatives. Under the premise of normal network communication, as long as abnormal data packets or packets that do not meet the DNS requirements are found, it can quickly detect whether there is a DNS tunnel Trojan in the DNS tunnel.

下面介绍与上述方法实施例对应的装置实施例。Apparatus embodiments corresponding to the foregoing method embodiments are introduced below.

图11为本申请实施例提供的一种木马检测装置的结构示意图。所述装置可以是一种网络设备,或位于所述网络设备中的一个部件,例如芯片电路。并且该装置可以实现前述实施例中的DNS木马检测方法。FIG. 11 is a schematic structural diagram of a Trojan horse detection device provided by an embodiment of the present application. The apparatus may be a network device, or a component located in the network device, such as a chip circuit. And the device can implement the DNS Trojan detection method in the foregoing embodiment.

具体地,如图11所示,该装置可以包括:采集单元1101、解析单元1102和确定单元1103。其中,可选的,所述解析单元1102又可称为DNS协议解析单元,所述确定单元1103又可称为木马判别单元。此外,所述装置还可以包括存储单元等其他的单元或模块,本实施例对此不予限制。Specifically, as shown in FIG. 11 , the apparatus may include: a collection unit 1101 , an analysis unit 1102 and a determination unit 1103 . Wherein, optionally, the parsing unit 1102 may also be referred to as a DNS protocol parsing unit, and the determining unit 1103 may also be referred to as a Trojan horse identification unit. In addition, the apparatus may further include other units or modules such as a storage unit, which are not limited in this embodiment.

其中,采集单元1101用于接收来自源端的第一询问包,所述第一询问包中包括源端的IP地址。解析单元1102用于当所述第一询问包符合DNS协议规范的情况下,获取与所述第一询问包对应的第一响应包,以及解析所述第一响应包得到至少一个目的IP地址。确定单元1103用于在所述源端IP地址和所述至少一个目的IP地址之间均不存在数据包的情况下,确定所述源端到所述目的端之间存在DNS隧道木马。The collection unit 1101 is configured to receive a first query packet from the source end, where the first query packet includes the IP address of the source end. The parsing unit 1102 is configured to obtain a first response packet corresponding to the first query packet when the first query packet conforms to the DNS protocol specification, and parse the first response packet to obtain at least one destination IP address. The determining unit 1103 is configured to determine that a DNS tunnel Trojan exists between the source end and the destination end when there is no data packet between the source end IP address and the at least one destination IP address.

其中,所述第一响应包为DNS服务器发送,且所述至少一个目的IP地址归属于目的端。Wherein, the first response packet is sent by the DNS server, and the at least one destination IP address belongs to the destination end.

可选的,在一种具体的实施方式中,确定单元1103,还用于所述源端IP地址和 每个所述至少一个目的IP地址之间均存在数据包的情况下,确定所述源端到所述目的端之间不存在DNS隧道木马。Optionally, in a specific implementation manner, the determining unit 1103 is further configured to determine the source IP address in the case that there is a data packet between the source IP address and each of the at least one destination IP address. There is no DNS tunneling Trojan horse between the endpoint and the destination endpoint.

其中,所述数据包为第一检测周期内的所有数据包,或者,为从检测到的第一个响应包之后开始到所述第一检测周期结束时采集的所有数据包。所述数据包由采集单元1101采集后获得。Wherein, the data packets are all the data packets in the first detection period, or are all the data packets collected from after the detection of the first response packet to the end of the first detection period. The data packet is obtained after being collected by the collection unit 1101 .

另外,可选的,在另一种具体的实施方式中,采集单元1101还用于在获取与所述第一询问包对应的第一响应包之前,获取在第一检测周期内采集的第一数据包集合,所述第一数据包集合中至少包括DNS协议类型的数据包。解析单元1102还用于通过目标端口从所述第一数据包集合中过滤出所有DNS数据包,以及从所有DNS数据包中选择所述第一询问包,所述DNS数据包包括询问包和响应包。In addition, optionally, in another specific implementation manner, the acquisition unit 1101 is further configured to acquire the first response packet collected in the first detection period before acquiring the first response packet corresponding to the first query packet A data packet set, where the first data packet set at least includes data packets of the DNS protocol type. The parsing unit 1102 is further configured to filter out all DNS data packets from the first data packet set through the target port, and select the first query packet from all DNS data packets, where the DNS data packet includes a query packet and a response Bag.

其中,所述目标端口为UDP的53号端口。Wherein, the target port is port 53 of UDP.

可选的,在又一种具体的实施方式中,解析单元1102具体用于轮询所有DNS数据包中的每个数据包,判断当前检测的数据包中携带的长度指示字段与位于所述长度指示字段之后的实际数据长度是否一致;如果一致,则确定所述当前检测的数据包符合所述DNS协议规范;并统计所有符合所述DNS协议规范的数据包。Optionally, in another specific embodiment, the parsing unit 1102 is specifically configured to poll each data packet in all the DNS data packets, and determine whether the length indication field carried in the currently detected data packet is the same as the length in the data packet. Indicates whether the actual data lengths after the indication field are consistent; if they are consistent, it is determined that the currently detected data packet conforms to the DNS protocol specification; and all data packets conforming to the DNS protocol specification are counted.

在一种具体的实现方式中,解析单元1102具体用于当所述第一询问包中携带的长度指示字段与位于所述长度指示字段之后的实际数据长度不一致,确定所述第一询问包不符合所述DNS协议规范。In a specific implementation manner, the parsing unit 1102 is specifically configured to determine that the first query packet does not contain a length indication field carried in the first query packet and the actual data length after the length indication field is inconsistent. Complies with the DNS protocol specification.

另外,解析单元1102还用于检测第一询问包中携带的长度指示字段与位于所述长度指示字段之后的实际数据长度不一致时,确定所述第一询问包不符合所述DNS协议规范。In addition, the parsing unit 1102 is further configured to detect that the length indication field carried in the first query packet is inconsistent with the actual data length after the length indication field, and determine that the first query packet does not conform to the DNS protocol specification.

可选的,在又一种具体的实施方式中,解析单元1102还用于在确定所述第一询问包不符合所述DNS协议规范的情况下,获取所述源端IP地址请求的域名,所述域名通过字符串表示。确定单元1103还用于判断通过所述字符串表示的域名中是否存在ASCII码之外的字符,如果存在,则确定所述源端到所述目的端之间存在DNS隧道木马。Optionally, in another specific implementation manner, the parsing unit 1102 is further configured to obtain the domain name requested by the source IP address when it is determined that the first query packet does not conform to the DNS protocol specification, The domain name is represented by a string. The determining unit 1103 is further configured to determine whether there are characters other than ASCII codes in the domain name represented by the character string, and if so, determine that there is a DNS tunnel Trojan horse between the source end and the destination end.

另外,确定单元1103还用于在不存在所述ASCII码之外的字符时,解析单元1102获取所述第一询问包对应的第一响应包;解析所述第一响应包得到第一数据,所述第一数据中包含数据类型和长度,确定单元1103还用于判断解析在所述第一数据中的数据类型和长度是否均符合DNS协议规范,如果均符合,则确定不存在DNS隧道木马。In addition, the determining unit 1103 is further configured to, when there are no characters other than the ASCII code, the parsing unit 1102 to obtain the first response packet corresponding to the first query packet; and to parse the first response packet to obtain the first data, Described first data includes data type and length, and determining unit 1103 is also used to judge whether the data type and length parsed in the first data all meet the DNS protocol specification, if all meet, then determine that there is no DNS tunnel Trojan horse .

以及,确定单元1103还用于当所述第一数据中的数据类型和长度至少一个不符合所述DNS协议规范时,确定存在DNS隧道木马。And, the determining unit 1103 is further configured to determine that there is a DNS tunnel Trojan horse when at least one of the data type and length in the first data does not conform to the DNS protocol specification.

图12示出了一种检测设备的结构示意图,该检测设备可以是一种网络设备。所述检测设备包括:处理器110、存储器120、和至少一个通信接口130。其中,处理器110、存储器120和至少一个通信接口130可通过通信总线耦合。FIG. 12 shows a schematic structural diagram of a detection device, and the detection device may be a network device. The detection device includes: a processor 110 , a memory 120 , and at least one communication interface 130 . Wherein, the processor 110, the memory 120 and the at least one communication interface 130 may be coupled through a communication bus.

其中,处理器110为检测设备的控制中心,可用于设备间的通信,例如包括与至少一个客户端,以及服务器DST等其他设备之间的信息传输。The processor 110 is the control center of the detection device, and can be used for communication between devices, for example, including information transmission with at least one client and other devices such as the server DST.

处理器110可以由集成电路(Integrated Circuit,IC)组成,例如可以由单颗封装的IC所组成,也可以由连接多颗相同功能或不同功能的封装IC而组成。举例来说, 处理器110可以包括中央处理器(Central Processing Unit,CPU)或数字信号处理器(Digital Signal Processor,DSP)等。The processor 110 may be composed of an integrated circuit (Integrated Circuit, IC), for example, may be composed of a single packaged IC, or may be composed of a plurality of packaged ICs connected with the same function or different functions. For example, the processor 110 may include a central processing unit (Central Processing Unit, CPU) or a digital signal processor (Digital Signal Processor, DSP) or the like.

此外,处理器110还可以包括硬件芯片,所述该硬件芯片可以是专用集成电路(application specific integrated circuit,ASIC),可编程逻辑器件(programmable logic device,PLD)或其组合。上述PLD可以是复杂可编程逻辑器件(complex programmable logic device,CPLD),现场可编程逻辑门阵列(field-programmable gate array,FPGA),通用阵列逻辑(generic array logic,GAL)或其任意组合。可选的,所述硬件芯片为一种芯片系统或芯片电路。In addition, the processor 110 may further include a hardware chip, and the hardware chip may be an application specific integrated circuit (ASIC), a programmable logic device (PLD) or a combination thereof. The above-mentioned PLD can be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a general-purpose array logic (generic array logic, GAL) or any combination thereof. Optionally, the hardware chip is a chip system or a chip circuit.

存储器120用于存储和交换各类数据或软件,包括存储第一数据包集合、第二数据包集合、第三数据包集合、询问包和响应包等。此外存储器120中可以存储有计算机程序和代码。The memory 120 is used for storing and exchanging various types of data or software, including storing the first data packet set, the second data packet set, the third data packet set, the query packet and the response packet, and the like. In addition, computer programs and codes may be stored in the memory 120 .

具体地,存储器120可以包括易失性存储器(volatile memory),例如随机存取内存(Random Access Memory,RAM);还可以包括非易失性存储器(non-volatile memory),例如快闪存储器(flash memory),硬盘(Hard Sisk Drive,HDD)或固态硬盘(Solid-State Drive,SSD),存储器120还可以包括上述种类的存储器的组合。Specifically, the memory 120 may include volatile memory (volatile memory), such as random access memory (Random Access Memory, RAM); may also include non-volatile memory (non-volatile memory), such as flash memory (flash memory) memory), a hard disk (Hard Sisk Drive, HDD) or a solid-state drive (Solid-State Drive, SSD), the memory 120 may also include a combination of the above-mentioned types of memory.

通信接口130,使用任何收发器一类的装置,用于与其它设备或通信网络通信,如以太网,无线接入网(radio access network,RAN),无线局域网(Wireless Local Area Network,WLAN)、虚拟可扩展局域网(Virtual Extensible Local Area Network,VXLAN)等。Communication interface 130, using any transceiver-like device, for communicating with other devices or communication networks, such as Ethernet, Radio Access Network (RAN), Wireless Local Area Network (WLAN), Virtual Extensible Local Area Network (VXLAN), etc.

应理解,上述检测设备中还可以包括其他更多或更少的部件,本申请实施例示意的结构并不构成对检测设备的具体限定。并且图12所示的部件可以以硬件,软件、固件或者其任意组合的方式来实现。It should be understood that the above detection device may also include other more or less components, and the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the detection device. And the components shown in FIG. 12 can be implemented in hardware, software, firmware or any combination thereof.

当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。例如,在前述图11所示的检测装置中的采集单元1101可以通过通信接口130来实现,所述解析单元1102和确定单元1103的功能可以由处理器110来实现,所述存储单元的功能可以由存储器120实现。When implemented in software, it can be implemented in whole or in part in the form of a computer program product. For example, the acquisition unit 1101 in the detection device shown in FIG. 11 can be implemented through the communication interface 130, the functions of the analysis unit 1102 and the determination unit 1103 can be implemented by the processor 110, and the function of the storage unit can be implemented by the processor 110. Implemented by memory 120 .

具体地,所述检测设备利用至少一个通信接口130接收来自源端的第一询问包,所述第一询问包中包括源端的IP地址,处理器110确定该第一询问包符合DNS协议规范时,获得与第一询问包所对应的第一响应包,并解析该第一响应包得到至少一个目的IP地址;以及,检测当所述源端IP地址和所述至少一个目的IP地址之间均不存在数据包时,确定所述源端到目的端之间存在DNS隧道木马。具体地,处理器110通过调用存储器120中的程序代码,执行上述实施例图4、图5或图8所示的方法。Specifically, the detection device uses at least one communication interface 130 to receive a first query packet from the source end, where the first query packet includes the IP address of the source end, and when the processor 110 determines that the first query packet conforms to the DNS protocol specification, Obtain a first response packet corresponding to the first query packet, and parse the first response packet to obtain at least one destination IP address; and, detect when there is no difference between the source IP address and the at least one destination IP address When there is a data packet, it is determined that there is a DNS tunnel Trojan horse between the source end and the destination end. Specifically, the processor 110 executes the method shown in FIG. 4 , FIG. 5 or FIG. 8 in the foregoing embodiment by calling the program code in the memory 120 .

此外,该检测设备中还包括移动通信模块、无线通信模块等。所述移动通信模块包括:2G/3G/4G/5G等无线通信功能的模块。此外,还可以包括滤波器、开关、功率放大器、低噪声放大器(low noise amplifier,LNA)等。所述无线通信模块可以提供应用在检测设备上的包括WLAN、蓝牙(bluetooth),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM)等无线通信的解决方案。In addition, the detection device also includes a mobile communication module, a wireless communication module, and the like. The mobile communication module includes modules with wireless communication functions such as 2G/3G/4G/5G. In addition, filters, switches, power amplifiers, low noise amplifiers (LNAs), etc. may also be included. The wireless communication module can provide wireless communication solutions including WLAN, bluetooth (bluetooth), global navigation satellite system (GNSS), frequency modulation (frequency modulation, FM), etc. applied to the detection equipment.

此外,本申请实施例还提供了一种网络系统,该网络系统结构可以是如前述图1或图2所示网络架构,包括至少一个客户端、至少一个服务器、DNS服务器,以及网 关等通信设备。其中,上述每个设备的结构可以是如图12所示的检测设备,用于实现前述实施例中的检测方法。In addition, an embodiment of the present application also provides a network system, and the network system structure may be the network architecture shown in the aforementioned FIG. 1 or FIG. 2 , including at least one client, at least one server, a DNS server, and a communication device such as a gateway. . The structure of each of the above devices may be the detection device shown in FIG. 12 , which is used to implement the detection method in the foregoing embodiment.

本实施例能够检测出完全符合DNS协议规范的数据包中,是否隐藏有DNS隧道木马,解决了基于一般规则的入侵检测系统无法发现高隐蔽性DNS隧道木马的问题。另外,对于不符合DNS协议规范的数据包中DNS隧道木马检测,能够在网络异常或者DNS服务器出错的情况下,准确地发现隐藏的隧道木马,并且不存在误报、漏报的情况。在网络通信正常的前提下,只要发现不符DNS合规范要求的异常数据包或报文,就可以迅速地检测出DNS隧道中是否存在DNS隧道木马。This embodiment can detect whether there is a DNS tunnel Trojan hidden in a data packet that fully complies with the DNS protocol specification, and solves the problem that a general rule-based intrusion detection system cannot find a DNS tunnel Trojan with high concealment. In addition, for the detection of DNS tunnel Trojan horses in data packets that do not conform to the DNS protocol specification, the hidden tunnel Trojan horses can be accurately discovered in the case of network abnormalities or DNS server errors, and there are no false positives or false negatives. Under the premise of normal network communication, as long as abnormal data packets or packets that do not meet the DNS requirements are found, it can quickly detect whether there is a DNS tunnel Trojan in the DNS tunnel.

本申请实施例还提供一种计算机程序产品,所述计算机程序产品包括一个或多个计算机程序指令。在计算机加载和执行所述计算机程序指令时,全部或部分地产生按照上述各个实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络或者其他可编程装置。Embodiments of the present application also provide a computer program product, where the computer program product includes one or more computer program instructions. When a computer loads and executes the computer program instructions, all or part of the processes or functions described in the various embodiments described above occur. The computer may be a general purpose computer, special purpose computer, computer network, or other programmable device.

所述计算机程序指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个通信设备、计算机、服务器或数据中心通过有线或无线方式向另一个通信设备进行传输。The computer program instructions may be stored in or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions may be transmitted from a communication device, computer, server or data The center transmits to another communication device by wire or wireless.

其中,所述计算机程序产品和所述计算机程序指令可以位于前述检测设备的存储器中,从而实现本申请实施例所述的木马检测方法。Wherein, the computer program product and the computer program instructions may be located in the memory of the aforementioned detection device, so as to implement the Trojan horse detection method described in the embodiments of the present application.

此外,在本申请的描述中,除非另有说明,“多个”是指两个或多于两个。另外,为了便于清楚描述本申请实施例的技术方案,在本申请的实施例中,采用了“第一”、“第二”等字样对功能和作用基本相同的相同项或相似项进行区分。本领域技术人员可以理解“第一”、“第二”等字样并不对数量和执行次序进行限定,并且“第一”、“第二”等字样也并不限定一定不同。Also, in the description of this application, unless stated otherwise, "plurality" means two or more than two. In addition, in order to clearly describe the technical solutions of the embodiments of the present application, in the embodiments of the present application, words such as "first" and "second" are used to distinguish the same or similar items with basically the same function and effect. Those skilled in the art can understand that the words "first", "second" and the like do not limit the quantity and execution order, and the words "first", "second" and the like are not necessarily different.

以上所述的本申请实施方式并不构成对本申请保护范围的限定。The above-described embodiments of the present application do not limit the protection scope of the present application.

Claims (20)

一种木马检测方法,其特征在于,所述方法包括:A Trojan horse detection method, characterized in that the method comprises: 接收来自源端的第一询问包,所述第一询问包中包括源端的IP地址;receiving a first query packet from the source, where the first query packet includes the IP address of the source; 当所述第一询问包符合域名系统DNS协议规范,获取与所述第一询问包对应的第一响应包,所述第一响应包为DNS服务器发送;When the first query packet conforms to the domain name system DNS protocol specification, obtain a first response packet corresponding to the first query packet, and the first response packet is sent by the DNS server; 解析所述第一响应包得到至少一个目的IP地址;Parsing the first response packet to obtain at least one destination IP address; 如果所述源端IP地址和所述至少一个目的IP地址之间均不存在数据包,则确定所述源端到所述目的端之间存在DNS隧道木马。If there is no data packet between the source IP address and the at least one destination IP address, it is determined that there is a DNS tunnel Trojan horse between the source and the destination. 根据权利要求1所述的方法,其特征在于,还包括:The method of claim 1, further comprising: 如果所述源端IP地址和每个所述至少一个目的IP地址之间均存在数据包,则确定所述源端到所述目的端之间不存在DNS隧道木马。If there is a data packet between the source end IP address and each of the at least one destination IP address, it is determined that there is no DNS tunnel Trojan horse between the source end and the destination end. 根据权利要求1或2所述的方法,其特征在于,获取与所述第一询问包对应的第一响应包之前,还包括:The method according to claim 1 or 2, wherein before acquiring the first response packet corresponding to the first query packet, the method further comprises: 获取在第一检测周期内采集的第一数据包集合,所述第一数据包集合中至少包括DNS协议类型的数据包;Obtain the first data packet set collected in the first detection period, and the first data packet set at least includes the data packets of the DNS protocol type; 所述接收来自源端的第一询问包,包括:The receiving the first query packet from the source includes: 通过目标端口从所述第一数据包集合中过滤出所有DNS数据包,所述DNS数据包包括询问包和响应包;Filter out all DNS data packets from the first data packet set through the target port, and the DNS data packets include query packets and response packets; 从所述所有DNS数据包中选择所述第一询问包。The first challenge packet is selected from all the DNS data packets. 根据权利要求1-3任一项所述的方法,其特征在于,所述第一询问包符合所述DNS协议规范,包括:The method according to any one of claims 1-3, wherein the first query packet conforms to the DNS protocol specification, comprising: 所述第一询问包中携带的长度指示字段与位于所述长度指示字段之后的实际数据长度一致。The length indication field carried in the first query packet is consistent with the actual data length located after the length indication field. 根据权利要求4所述的方法,其特征在于,还包括:The method of claim 4, further comprising: 如果所述第一询问包中携带的长度指示字段与位于所述长度指示字段之后的实际数据长度不一致,则所述第一询问包不符合所述DNS协议规范。If the length indication field carried in the first inquiry packet is inconsistent with the actual data length located after the length indication field, the first inquiry packet does not conform to the DNS protocol specification. 根据权利要求5所述的方法,其特征在于,当所述第一询问包不符合所述DNS协议规范,还包括:The method according to claim 5, wherein when the first query packet does not conform to the DNS protocol specification, the method further comprises: 获取所述源端IP地址请求的域名,所述域名通过预设字符串表示;Obtain the domain name requested by the source IP address, where the domain name is represented by a preset character string; 判断通过所述预设字符串表示的域名中是否存在ASCII码之外的字符;Judging whether there are characters other than ASCII codes in the domain name represented by the preset character string; 如果存在,则确定所述源端到所述目的端之间存在DNS隧道木马。If there is, it is determined that there is a DNS tunnel Trojan horse between the source end and the destination end. 根据权利要求6所述的方法,其特征在于,还包括:The method of claim 6, further comprising: 如果不存在所述ASCII码之外的字符,则获取与所述第一询问包对应的第一响应包;If there is no character other than the ASCII code, obtain the first response packet corresponding to the first query packet; 解析所述第一响应包得到第一数据,所述第一数据中包含数据类型和长度;Parsing the first response packet to obtain first data, where the first data includes a data type and a length; 如果所述第一数据中的数据类型和长度均符合DNS协议规范,则确定不存在DNS隧道木马。If both the data type and length in the first data conform to the DNS protocol specification, it is determined that there is no DNS tunneling Trojan. 根据权利要求7所述的方法,其特征在于,还包括:The method of claim 7, further comprising: 如果所述第一数据中的数据类型和长度的至少一个不符合所述DNS协议规范,则 确定存在DNS隧道木马。If at least one of the data type and length in the first data does not conform to the DNS protocol specification, it is determined that there is a DNS tunneling Trojan horse. 根据权利要求1-8任一项所述的方法,其特征在于,所述数据包为第一检测周期内的所有数据包,或者,为从检测到的第一个响应包之后开始到所述第一检测周期结束时采集的所有数据包。The method according to any one of claims 1-8, wherein the data packets are all data packets in the first detection period, or, from the time after the first response packet is detected to the time of the first detection period. All packets collected at the end of the first detection period. 一种木马检测装置,其特征在于,所述装置包括:A Trojan horse detection device, characterized in that the device comprises: 采集单元,用于接收来自源端的第一询问包,所述第一询问包中包括源端的IP地址;a collection unit, configured to receive a first query packet from the source, where the first query packet includes the IP address of the source; 解析单元,用于当所述第一询问包符合域名系统DNS协议规范,获取与所述第一询问包对应的第一响应包,以及解析所述第一响应包得到至少一个目的IP地址,所述第一响应包为DNS服务器发送;a parsing unit, configured to obtain a first response packet corresponding to the first query packet when the first query packet conforms to the DNS protocol specification of the Domain Name System, and parse the first response packet to obtain at least one destination IP address, where The first response packet is sent by the DNS server; 确定单元,用于在所述源端IP地址和所述至少一个目的IP地址之间均不存在数据包的情况下,确定所述源端到目的端之间存在DNS隧道木马。A determining unit, configured to determine that a DNS tunnel Trojan exists between the source end and the destination end when there is no data packet between the source end IP address and the at least one destination IP address. 根据权利要求10所述的装置,其特征在于,The device of claim 10, wherein: 所述确定单元,还用于在所述源端IP地址和每个所述至少一个目的IP地址之间均存在数据包的情况下,确定所述源端到所述目的端之间不存在DNS隧道木马。The determining unit is further configured to determine that there is no DNS between the source end and the destination end when there is a data packet between the source end IP address and each of the at least one destination IP address Tunnel Trojan. 根据权利要求10或11所述的装置,其特征在于,The device according to claim 10 or 11, characterized in that: 所述采集单元,还用于获取在第一检测周期内采集的第一数据包集合,所述第一数据包集合中至少包括DNS协议类型的数据包;The collection unit is further configured to obtain the first data packet set collected in the first detection period, and the first data packet set at least includes the data packets of the DNS protocol type; 所述解析单元,还用于通过目标端口从所述第一数据包集合中过滤出所有DNS数据包,以及从所述所有DNS数据包中选择所述第一询问包,所述DNS数据包包括询问包和响应包。The parsing unit is further configured to filter out all DNS data packets from the first data packet set through a target port, and select the first query packet from the all DNS data packets, where the DNS data packets include query and response packets. 根据权利要求10-12任一项所述的装置,其特征在于,The device according to any one of claims 10-12, characterized in that, 所述解析单元,具体用于当所述第一询问包中携带的长度指示字段与位于所述长度指示字段之后的实际数据长度一致,确定所述第一询问包符合所述DNS协议规范。The parsing unit is specifically configured to determine that the first query packet complies with the DNS protocol specification when the length indication field carried in the first query packet is consistent with the actual data length after the length indication field. 根据权利要求13所述的装置,其特征在于,The device of claim 13, wherein: 所述解析单元,还用于当所述第一询问包中携带的长度指示字段与位于所述长度指示字段之后的实际数据长度不一致时,确定所述第一询问包不符合所述DNS协议规范。The parsing unit is further configured to determine that the first query packet does not conform to the DNS protocol specification when the length indication field carried in the first query packet is inconsistent with the actual data length after the length indication field . 根据权利要求14所述的装置,其特征在于,The apparatus of claim 14, wherein: 所述解析单元,还用于获取所述源端IP地址请求的域名,所述域名通过预设字符串表示;The parsing unit is further configured to obtain the domain name requested by the source IP address, where the domain name is represented by a preset character string; 所述确定单元,还用于判断通过所述预设字符串表示的域名中是否存在ASCII码之外的字符,如果存在,则确定所述源端到所述目的端之间存在DNS隧道木马。The determining unit is further configured to determine whether there are characters other than ASCII codes in the domain name represented by the preset character string, and if so, determine that there is a DNS tunnel Trojan horse between the source end and the destination end. 根据权利要求15所述的装置,其特征在于,The apparatus of claim 15, wherein: 所述解析单元,还用于不存在所述ASCII码之外的字符的情况下,获取与所述第一询问包对应的第一响应包,解析所述第一响应包得到第一数据,所述第一数据中包含数据类型和长度;The parsing unit is further configured to obtain a first response packet corresponding to the first query packet in the absence of characters other than the ASCII code, and parse the first response packet to obtain first data, so The first data includes the data type and length; 所述确定单元,还用于在所述第一数据中的数据类型和长度均符合DNS协议规范时,确定不存在DNS隧道木马。The determining unit is further configured to determine that there is no DNS tunnel Trojan horse when both the data type and length in the first data conform to the DNS protocol specification. 根据权利要求16所述的装置,其特征在于,The apparatus of claim 16, wherein: 所述确定单元,还用于当所述第一数据中的数据类型和长度的至少一个不符合所述DNS协议规范时,确定存在DNS隧道木马。The determining unit is further configured to determine that there is a DNS tunnel Trojan horse when at least one of the data type and length in the first data does not conform to the DNS protocol specification. 根据权利要求10-17任一项所述的装置,其特征在于,所述数据包为第一检测周期内的所有数据包,或者,为从检测到的第一个响应包之后开始到所述第一检测周期结束时采集的所有数据包。The device according to any one of claims 10-17, wherein the data packets are all data packets in the first detection period, or, from the time after the detection of the first response packet to the time of the All packets collected at the end of the first detection period. 一种检测设备,包括处理器和存储器,处理器与存储器耦合,其特征在于,A detection device, comprising a processor and a memory, the processor and the memory are coupled, characterized in that: 所述存储器,用于存储计算机程序指令;the memory for storing computer program instructions; 所述处理器,用于执行所述存储器中存储的所述指令,以使得所述检测设备执行如权利要求1至9中任一项所述的方法。The processor is configured to execute the instructions stored in the memory, so that the detection device performs the method according to any one of claims 1 to 9. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有计算机程序指令,A computer-readable storage medium, wherein computer program instructions are stored in the computer-readable storage medium, 当所述计算机程序指令被运行时,实现如权利要求1至9中任一项所述的方法。The computer program instructions, when executed, implement a method as claimed in any one of claims 1 to 9.
PCT/CN2020/130593 2020-11-20 2020-11-20 Trojan detection method and apparatus, and device Ceased WO2022104738A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2020/130593 WO2022104738A1 (en) 2020-11-20 2020-11-20 Trojan detection method and apparatus, and device
CN202080004649.4A CN112640392B (en) 2020-11-20 2020-11-20 A Trojan detection method, device and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/130593 WO2022104738A1 (en) 2020-11-20 2020-11-20 Trojan detection method and apparatus, and device

Publications (1)

Publication Number Publication Date
WO2022104738A1 true WO2022104738A1 (en) 2022-05-27

Family

ID=75291188

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/130593 Ceased WO2022104738A1 (en) 2020-11-20 2020-11-20 Trojan detection method and apparatus, and device

Country Status (2)

Country Link
CN (1) CN112640392B (en)
WO (1) WO2022104738A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113992442B (en) * 2021-12-28 2022-03-18 北京微步在线科技有限公司 A Trojan connection successful detection method and device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101567884A (en) * 2009-05-26 2009-10-28 西北工业大学 Method for detecting network theft Trojan
US20140157405A1 (en) * 2012-12-04 2014-06-05 Bill Joll Cyber Behavior Analysis and Detection Method, System and Architecture
CN107733851A (en) * 2017-08-23 2018-02-23 刘胜利 DNS tunnels Trojan detecting method based on communication behavior analysis
CN110071829A (en) * 2019-04-12 2019-07-30 腾讯科技(深圳)有限公司 DNS tunnel detection method, device and computer readable storage medium
CN111600863A (en) * 2020-05-08 2020-08-28 杭州安恒信息技术股份有限公司 Network intrusion detection method, device, system and storage medium
CN111600865A (en) * 2020-05-11 2020-08-28 杭州安恒信息技术股份有限公司 A kind of abnormal communication detection method, device and electronic equipment and storage medium

Family Cites Families (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008532133A (en) * 2005-02-24 2008-08-14 アールエスエイ セキュリティー インコーポレーテッド System and method for detecting and mitigating DNS camouflaged Trojans
EP2222048A1 (en) * 2009-02-24 2010-08-25 BRITISH TELECOMMUNICATIONS public limited company Detecting malicious behaviour on a computer network
CN102594825B (en) * 2012-02-22 2016-08-17 北京百度网讯科技有限公司 The detection method of a kind of intranet Trojans and device
US9411955B2 (en) * 2012-08-09 2016-08-09 Qualcomm Incorporated Server-side malware detection and classification
CN103326894B (en) * 2013-05-29 2016-12-28 深信服网络科技(深圳)有限公司 The method and apparatus of DNS Tunnel testing
US10412107B2 (en) * 2017-03-22 2019-09-10 Microsoft Technology Licensing, Llc Detecting domain name system (DNS) tunneling based on DNS logs and network data
CN108390864B (en) * 2018-02-01 2020-12-11 杭州安恒信息技术股份有限公司 A Trojan detection method and system based on attack chain behavior analysis
CN108769034B (en) * 2018-06-01 2021-02-26 杭州安恒信息技术股份有限公司 Method and device for monitoring IP address of remote control Trojan control end on line in real time
CN108848201A (en) * 2018-06-14 2018-11-20 深信服科技股份有限公司 Detection utilizes the method, system and device of DNS tunnel transmission secret data
CN111865876B (en) * 2019-04-29 2021-10-15 华为技术有限公司 Network access control method and device
CN110505246B (en) * 2019-09-25 2021-10-08 腾讯科技(深圳)有限公司 Client network communication detection method, device and storage medium
CN111277570A (en) * 2020-01-10 2020-06-12 中电长城网际系统应用有限公司 Data security monitoring method and device, electronic equipment and readable medium
CN111953673B (en) * 2020-08-10 2022-07-05 深圳市联软科技股份有限公司 DNS hidden tunnel detection method and system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101567884A (en) * 2009-05-26 2009-10-28 西北工业大学 Method for detecting network theft Trojan
US20140157405A1 (en) * 2012-12-04 2014-06-05 Bill Joll Cyber Behavior Analysis and Detection Method, System and Architecture
CN107733851A (en) * 2017-08-23 2018-02-23 刘胜利 DNS tunnels Trojan detecting method based on communication behavior analysis
CN110071829A (en) * 2019-04-12 2019-07-30 腾讯科技(深圳)有限公司 DNS tunnel detection method, device and computer readable storage medium
CN111600863A (en) * 2020-05-08 2020-08-28 杭州安恒信息技术股份有限公司 Network intrusion detection method, device, system and storage medium
CN111600865A (en) * 2020-05-11 2020-08-28 杭州安恒信息技术股份有限公司 A kind of abnormal communication detection method, device and electronic equipment and storage medium

Also Published As

Publication number Publication date
CN112640392B (en) 2022-05-13
CN112640392A (en) 2021-04-09

Similar Documents

Publication Publication Date Title
US11800260B2 (en) Network telemetry with byte distribution and cryptographic protocol data elements
US20230308458A1 (en) Structured data discovery and cryptographic analysis
US9467464B2 (en) System and method for correlating log data to discover network vulnerabilities and assets
US11777971B2 (en) Bind shell attack detection
US10498618B2 (en) Attributing network address translation device processed traffic to individual hosts
JP2009510815A (en) Method and system for reassembling packets before search
US7584506B2 (en) Method and apparatus for controlling packet transmission and generating packet billing data on wired and wireless network
CN113518042B (en) Data processing method, device, equipment and storage medium
CN110868409A (en) A method and system for passive identification of operating system based on TCP/IP protocol stack fingerprint
CN110213124A (en) Passive operation system identification method and device based on the more sessions of TCP
US20120047572A1 (en) Decapsulation of data packet tunnels to process encapsulated ipv4 or ipv6 packets
CN107181605B (en) Message detection method and system, content extraction device and flow matching device
CN112769635B (en) Service identification method and device for multi-granularity feature analysis
WO2022104738A1 (en) Trojan detection method and apparatus, and device
EP4293550A1 (en) Traffic processing method and protection system
CN113965392B (en) Malicious server detection method, system, readable medium and electronic device
Kaushik et al. Network forensic system for ICMP attacks
CN113377051B (en) An FPGA-based network security protection device
CN113992410A (en) Private encrypted data identification method and system
CN119766487B (en) Encryption malicious traffic detection method and device and electronic equipment
US12225048B2 (en) Packet capture using fixed encryption key
Zhu et al. Encrypted Mining Traffic Detection Mechanism Based on TLS Handshake Message and Machine Learning
Graham A botnet needle in a virtual haystack
CN117395023A (en) Network equipment identification method and device for encryption gateway
CN121217623A (en) A programmable router with a traffic probe, a traffic acquisition method and system

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20962029

Country of ref document: EP

Kind code of ref document: A1