A TCP covert tunnel detection system, electronic device and storage medium based on exhaustive decryption

Through an exhaustive decryption-based detection system, combined with filtering modules and multi-layer decryption modules, the detection of TCP hidden tunnels is solved, and the problem of difficulty in taking into account both flexibility and accuracy in the existing technology is achieved, and efficient identification of TCP hidden tunnels is achieved. and accurate detection.

CN118802385BActive Publication Date: 2024-11-22CHINA ACADEMY OF INFORMATION & COMM
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411292195.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-14
Publication Date
2024-11-22
Estimated Expiration
2044-09-14

AI Technical Summary

Technical Problem

The existing TCP hidden tunnel detection method is difficult to take into account both flexibility and accuracy. It is impossible to effectively identify TCP hidden tunnel traffic with feature modifications. The false alarm rate for legal applications is high, and the detection accuracy cannot be determined 100%. .

Method used

Using a detection system based on exhaustive decryption, the filter module, a single algorithm exhaustive decryption module and a combined algorithm exhaustive decryption module are adopted, combined with the public protocol filter, an encrypted online data filter, a single algorithm submodule and a combined algorithm submodule, and the TCP encrypted traffic performs multi-layer decryption matching to identify TCP hidden tunnels.

Benefits of technology

It improves the accuracy and interpretability of TCP hidden tunnel detection, can accurately identify malicious traffic, reduce false alarm rates, and enhances the detection ability of encrypted traffic.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118802385B_ABST
    Figure CN118802385B_ABST
Patent Text Reader

Abstract

The present invention provides a TCP covert tunnel detection system, electronic device and storage medium based on exhaustive decryption, wherein the system includes: decrypting the transmitted TCP payload by a single algorithm (such as XOR, addition, subtraction, decoding and decompression) and a combination algorithm (combining XOR, addition, subtraction, decoding and decompression in pairs). By analyzing whether the decrypted data contains system information such as IP address, computer name, user name, operating system version and MAC address, it is determined whether the TCP payload contains a covert tunnel. The solution proposed by the present invention can effectively solve the problem of difficulty in detecting simple encrypted TCP covert tunnels, improve detection accuracy and explainability, and help to accurately identify malicious traffic.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of network security, and in particular relates to a TCP covert tunnel detection system, electronic equipment and storage medium based on exhaustive decryption. Background Art

[0002] In the field of information security, covert tunneling technology is a common means for attackers to bypass network defense systems and achieve data theft and remote control. Covert tunneling embeds malicious traffic into legitimate network protocols, disguising it as normal communication to evade detection. As one of the important forms, TCP covert tunneling uses the characteristics of TCP to establish a stable and covert communication channel. Since the TCP protocol is widely used in network communications, its covert tunnel has high concealment and stability.

[0003] Currently, there are two main types of detection methods for TCP covert tunnels.

[0004] The first method is to extract payload features (such as specific hexadecimal characters) and then generate corresponding Suricata rules for detection. Although this method can achieve high detection accuracy, its flexibility is limited and it cannot effectively identify TCP covert tunnel traffic that has been modified with features. Taking the currently active Silver Fox Trojan as an example, the online data packet of the Silver Fox Trojan may contain identification data ranging from 6 bytes to 32 bytes. The Silver Fox Trojan can be detected by generating Suricata rules based on these identification data, but the attacker can evade detection by erasing these identification data.

[0005] The second method is to scan TCP / UDP private protocols based on protocol fingerprints to identify potential TCP covert tunnels. Although this method has a wide coverage and high flexibility, its detection accuracy is relatively low. In actual network traffic, many legitimate applications such as remote desktop software such as Sunflower and ToDesk also use TCP / UDP tunnels for data transmission. The protocol format of these legitimate software may be similar to that of some Trojans, resulting in false positives. In addition, even if encrypted traffic using private protocols is detected, the accuracy of the detection cannot be 100% determined because the data transmission content cannot be decrypted. Summary of the invention

[0006] In order to solve the above technical problems, the present invention proposes a technical solution of TCP covert tunnel detection, electronic equipment and storage medium based on exhaustive decryption to solve the above technical problems.

[0007] The first aspect of the present invention discloses a TCP covert tunnel detection system based on exhaustive decryption; the system comprises: a filtering module, a single algorithm exhaustive decryption module, a combined algorithm exhaustive decryption module and a system information matching module;

[0008] The filtering module includes: a public protocol filter and an encrypted online data filter;

[0009] Inputting the triplet of TCP encrypted traffic and the TCP payload into the public protocol filter; when the TCP payload does not hit any public protocol feature, the public protocol filter will output the triplet and the TCP payload to the encrypted online data filter; the triplet includes: source IP, destination IP and destination port;

[0010] The encrypted online data filter will filter multiple encrypted online data packet features from the predefined TCP payloads every time it accumulates a predefined number of identical triples. When two or more encrypted online data packet features are hit, the encrypted online data filter will output the predefined number of identical triples of TCP payloads to the single algorithm exhaustive decryption module and the combined algorithm exhaustive decryption module.

[0011] The single algorithm exhaustive decryption module includes five single algorithm submodules: an addition exhaustive decryption submodule, an XOR exhaustive decryption submodule, a subtraction exhaustive decryption submodule, a decoding submodule and a decompression submodule;

[0012] The encrypted online data filter inputs a predefined number of identical triplet TCP payloads into the five single algorithm submodules to obtain five single algorithm decryption results;

[0013] The single algorithm exhaustive decryption module inputs the five single algorithm decryption results into the system information matching module;

[0014] The combined algorithm exhaustive decryption module includes a plurality of combined submodules; each combined submodule is a series combination of any two single algorithm submodules among the five single algorithm submodules;

[0015] The encrypted online data filter inputs a predefined number of identical triplet TCP payloads into the multiple combination submodules to obtain multiple combination algorithm decryption results;

[0016] The combined algorithm exhaustive decryption module inputs the decryption results of the multiple combined algorithms into the system information matching module;

[0017] The system information matching module matches the system information in five single algorithm decryption results and multiple combined algorithm decryption results. If the data is matched, it is determined that the TCP encrypted traffic contains a TCP covert tunnel.

[0018] According to the system of the first aspect of the present invention, the multiple encrypted online data packet features include: length indication, constant value, continuous identical data, compression algorithm identification header, Base64 encoded data and TCP large port.

[0019] According to the system of the first aspect of the present invention, a predefined number of identical triplet TCP payloads are respectively input into the addition exhaustive decryption submodule to obtain the first single algorithm decryption result including:

[0020] Convert a predefined number of identical triples of TCP payloads into a hexadecimal byte stream;

[0021] Sequentially take numbers from 2 to 254 as subtraction keys, perform byte-by-byte addition operations on the hexadecimal byte stream, and obtain the first single algorithm decryption result.

[0022] According to the system of the first aspect of the present invention, a predefined number of identical triplet TCP payloads are respectively input into the XOR exhaustive decryption submodule to obtain the second single algorithm decryption result including:

[0023] Convert a predefined number of identical triples of TCP payloads into a hexadecimal byte stream;

[0024] Sequentially take numbers from 2 to 254 as XOR keys, perform byte-by-byte XOR with the hexadecimal byte stream, and obtain the second single algorithm decryption result.

[0025] According to the system of the first aspect of the present invention, a predefined number of identical triplet TCP payloads are respectively input into the subtraction exhaustive decryption submodule to obtain the third single algorithm decryption result including:

[0026] Convert a predefined number of identical triples of TCP payloads into a hexadecimal byte stream;

[0027] Sequentially take numbers from 2 to 254 as subtraction keys, perform byte-by-byte subtraction operations with the hexadecimal byte stream, and obtain the third single algorithm decryption result.

[0028] According to the system of the first aspect of the present invention, a predefined number of identical triplet TCP payloads are respectively input into the decoding submodule, and the fourth single algorithm decryption result is obtained, including:

[0029] Convert a predefined number of identical triples of TCP payloads into a hexadecimal byte stream;

[0030] Use UTF-16LE, UTF-16BE and Base64 to decode the hexadecimal byte stream respectively to obtain the fourth single algorithm decryption result.

[0031] According to the system of the first aspect of the present invention, a predefined number of identical triplet TCP payloads are respectively input into the decompression submodule, and the fifth single algorithm decryption result is obtained, including:

[0032] Convert a predefined number of identical triples of TCP payloads into a hexadecimal byte stream;

[0033] Match the compression algorithm identification header,

[0034] If "\x1f\x8b\x08\" is matched, the hexadecimal byte stream is decompressed using the Gzip library provided by Python to obtain the decryption result of the fifth algorithm;

[0035] If "\x78\x9c" is matched, the hexadecimal byte stream is decompressed using the Python built-in library Zlib to obtain the decryption result of the fifth algorithm.

[0036] According to the system of the first aspect of the present invention, the system information includes: IP address, computer name, user name, operating system version and MAC address.

[0037] A second aspect of the present invention provides an electronic device, comprising a memory and a processor, wherein a computer program is stored on the memory, and when the computer program is executed by the processor, a method in a TCP covert tunnel detection system based on exhaustive decryption as described in the first aspect of the present invention is executed.

[0038] The third aspect of the present invention provides a storage medium, which stores a computer program that can be executed by one or more processors and can be used to implement a method in a TCP covert tunnel detection system based on exhaustive decryption as described in the first aspect of the present invention.

[0039] In summary, the solution proposed in the present invention can effectively solve the detection difficulty problem of simple encrypted TCP covert tunnels, improve detection accuracy and explainability, and help to accurately identify malicious traffic. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0041] Figure 1 A structural diagram of a TCP covert tunnel detection system based on exhaustive decryption according to an embodiment of the present invention;

[0042] Figure 2 The figure is a structural diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0043] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0044] The first aspect of the present invention discloses a TCP covert tunnel detection system based on exhaustive decryption. Figure 1 FIG. 1 is a structural diagram of a TCP covert tunnel detection system based on exhaustive decryption according to an embodiment of the present invention, specifically as follows Figure 1 As shown, the system includes: a filtering module, a single algorithm exhaustive decryption module, a combined algorithm exhaustive decryption module and a system information matching module;

[0045] The filtering module includes: a public protocol filter and an encrypted online data filter;

[0046] Inputting the triplet of TCP encrypted traffic and the TCP payload into the public protocol filter; when the TCP payload does not hit any public protocol feature, the public protocol filter will output the triplet and the TCP payload to the encrypted online data filter; the triplet includes: source IP, destination IP and destination port;

[0047] The encrypted online data filter will filter multiple encrypted online data packet features from the predefined TCP payloads every time it accumulates a predefined number of identical triples. When two or more encrypted online data packet features are hit, the encrypted online data filter will output the predefined number of identical triples of TCP payloads to the single algorithm exhaustive decryption module and the combined algorithm exhaustive decryption module.

[0048] The single algorithm exhaustive decryption module includes five single algorithm submodules: an addition exhaustive decryption submodule, an XOR exhaustive decryption submodule, a subtraction exhaustive decryption submodule, a decoding submodule and a decompression submodule;

[0049] The encrypted online data filter inputs a predefined number of identical triplet TCP payloads into the five single algorithm submodules to obtain five single algorithm decryption results;

[0050] The single algorithm exhaustive decryption module inputs the five single algorithm decryption results into the system information matching module;

[0051] The combined algorithm exhaustive decryption module includes a plurality of combined submodules; each combined submodule is a series combination of any two single algorithm submodules among the five single algorithm submodules;

[0052] The encrypted online data filter inputs a predefined number of identical triplet TCP payloads into the multiple combination submodules to obtain multiple combination algorithm decryption results;

[0053] The combined algorithm exhaustive decryption module inputs the decryption results of the multiple combined algorithms into the system information matching module;

[0054] The system information matching module matches the system information in five single algorithm decryption results and multiple combined algorithm decryption results. If the data is matched, it is determined that the TCP encrypted traffic contains a TCP covert tunnel.

[0055] The filtering module includes: public protocol filter and encrypted online data filter;

[0056] Inputting the triplet of TCP encrypted traffic and the TCP payload into the public protocol filter; when the TCP payload does not hit any public protocol feature, the public protocol filter will output the triplet and the TCP payload to the encrypted online data filter; the triplet includes: source IP, destination IP and destination port;

[0057] Every time the encrypted online data filter accumulates a predefined number of identical triplet TCP payloads, it will screen multiple encrypted online data packet features from the predefined number of TCP payloads. When two or more encrypted online data packet features are hit, the encrypted online data filter will output the predefined number of identical triplet TCP payloads to the single algorithm exhaustive decryption module and the combined algorithm exhaustive decryption module.

[0058] In some embodiments, the multiple encrypted online data packet features include: length indication, constant value, consecutive identical data, compression algorithm identification header, Base64 encoded data and TCP large port.

[0059] Specifically, the public protocol filter contains the characteristics of various public protocols and can identify application layer protocols (such as HTTP, TLS / SSL, RDP, DCERPC, FTP, NTP and SSH, etc.) and some public applications that use TCP for communication.

[0060] Every time the encrypted online data filter accumulates 10 identical triplet TCP payloads, it will screen multiple encrypted online data packet features from the 10 TCP payloads. When two or more of the encrypted online data packet features are hit, the encrypted online data filter will output the 10 identical triplet TCP payloads to the single algorithm exhaustive decryption module and the combined algorithm exhaustive decryption module.

[0061] The screening method for each feature in the encrypted online data filter is as follows.

[0062] Length indication

[0063] An encryption Trojan that uses TCP covert tunnel communication may set 2 bytes or 4 bytes of data to indicate the length of the entire TCP payload, or the length of other TCP payloads in addition to the length.

[0064] The length of the first 16 bytes of the first TCP payload (the first uplink packet payload) is matched, and the sliding window size is 2 and 4. The hexadecimal data in the sliding window is converted into length values ​​1 and 2 in big-endian and little-endian order, respectively. When length value 1 or length value 2 meets any of the following conditions, it can be determined that the uplink packet has a length indication.

[0065] Condition 1: The length value is equal to the TCP payload length;

[0066] Condition 2: The length value plus 2 or 4 equals the TCP payload length.

[0067] Constant value

[0068] An encryption Trojan that uses TCP covert tunnel communication may set multiple bytes as a flag, which is constant in the TCP payload of the same triplet (the same source IP, destination IP, and destination port).

[0069] The operation is performed on 10 identical triplet TCP payloads, and the first 100 bytes of the first 3 TCP payloads are compared byte by byte. If identical data with a length greater than 6 appears in the current 3 TCP payloads, it is determined that the TCP session has a constant value.

[0070] Consecutive identical bytes

[0071] There may be padding data in the online packet data structure of the TCP encryption Trojan, and the padding data is mostly hexadecimal data 00. After the online data is encrypted using encryption algorithms such as XOR or shift, these padding data will become consecutive identical bytes other than 00.

[0072] The first TCP payload (the first uplink packet payload) is operated, the sliding window size is set to 6, and starting from the 5th byte of the TCP payload, when all bytes in the sliding window are the same, it is determined that there are consecutive identical bytes in the TCP payload.

[0073] Compression Algorithm

[0074] As shown in Table 1, TCP encryption Trojans may use various compression algorithms to compress communication data, with GZIP and Zlib being the most commonly used. If the first TCP payload (the first uplink packet payload) contains a compression algorithm identification header, then the TCP payload is determined to have hit the compression algorithm feature.

[0075] Table 1

[0076]

[0077] Base64 encoding

[0078] As shown in Table 2, the TCP encryption Trojan may use the Base64 algorithm to encode the encrypted data. Use the following regular expression to match the first TCP payload (the first upstream packet payload). If a match is found, it is determined that the TCP payload meets the Base64 encoding characteristics.

[0079] Table 2

[0080]

[0081] Uncommon ports

[0082] As shown in Table 3, the command and control server may use uncommon ports to communicate with the Trojan. When the triple is operated, when the destination port is in the table below or between [30000, 65535], the uncommon port feature is hit.

[0083] Table 3

[0084]

[0085] The single algorithm exhaustive decryption module includes five single algorithm submodules: an addition exhaustive decryption submodule, an XOR exhaustive decryption submodule, a subtraction exhaustive decryption submodule, a decoding submodule and a decompression submodule;

[0086] The encrypted online data filter inputs a predefined number of identical triplet TCP payloads into the five single algorithm submodules to obtain five single algorithm decryption results;

[0087] The single-algorithm exhaustive decryption module inputs the five single-algorithm decryption results into the system information matching module.

[0088] In some embodiments, a predefined number of identical triplet TCP payloads are respectively input into the addition exhaustive decryption submodule to obtain the first single algorithm decryption result including:

[0089] Convert a predefined number of identical triples of TCP payloads into a hexadecimal byte stream;

[0090] Sequentially take numbers from 2 to 254 as subtraction keys, perform byte-by-byte addition operations on the hexadecimal byte stream, and obtain the first single algorithm decryption result.

[0091] The TCP payloads of several predefined identical triples are input into the XOR exhaustive decryption submodule respectively, and the second single algorithm decryption results are obtained, including:

[0092] Convert the TCP payload of a predefined number of identical triples into a hexadecimal byte stream, such as "\x9d\x00\xca\xe4\xd4\x76\xe1\x8b\xca\xae\xca\xa7\xca\xa3\xca\xa4\xca\xa3\xca\xb9\xca\xbe\xca\xb8\xca\xab\xca\xbe\xca\xa5\xca\xb8\xca\xc a\xca\x90\xca\x82\xca\xe7\xca\x89\xca\x84\xca\xca\xca\x87\xca\xa3\xca\xa9\xca\xb8\ xca\xa5\xca\xb9\xca\xa5\xca\xac\xca\xbe\xca\xea\xca\x9d\xca\xa3\xca\xa4\xca\xae\xca \xa5\xca\xbd\xca\xb9\xca\xea\xca\xfb\xca\xfa\xca\xea\xca\xd9\x84\xd0\x84\x2f\x97\x 96\x85\x13\xb0\x82\xb8\xca\xca\xfc\xca\xfe\xca\xea\xca\x87\x85\xca\xca\xfa\xca\xfa\ xca\xf0\xca\xfa\xca\x89\xca\xf0\xca\xf8\xca\xf3\xca\xf0\xca\xfb\xca\xf9\xca\xf0\xc a\xf3\xca\xf8\xca\xf0\xca\xfd\xca\x8e\xca\xca\xca\xfd\xca\xe4\xca\xfa\xca\xca\xca”;

[0093] Sequentially take numbers from 2 to 254 as XOR keys, perform byte-by-byte XOR with the hexadecimal byte stream, and obtain the second single algorithm decryption result.

[0094] result = b''

[0095] for data in extracted_data_bytes:# Take one byte from the TCP payload at a time

[0096] result = result + struct.pack('B', data ^ xorkey)#XOR with the XOR key, convert the decimal data after XOR to hexadecimal, and store it in result.

[0097] Take the number 2 as the XOR key, and the output XOR result is shown in the figure below. Take 3, 4, 5, 6, ..., 254 as the XOR key in sequence.

[0098]

[0099] When the number 202 is taken as the XOR key, the output XOR result is as follows.

[0100]

[0101] The TCP payloads of several predefined identical triples are input into the subtraction exhaustive decryption submodules respectively, and the decryption results of the third algorithm are obtained, including:

[0102] Convert a predefined number of identical triples of TCP payloads into a hexadecimal byte stream, such as "\x58\x59\x67\x5f\x68\x63\x64\x41\x66\x44\x55\x67\x62\x55\x55\x90\x90\x34\x55\x78\x81\x7d\x82\x90\x90\x34\x6b\x7d\x82\x78\x83 \x8b\x87\x34\x4b\x34\x69\x80\x88\x7d\x81\x75\x88\x79\x90\x90\x57\x4e\x70\x7c\ x44\x82\x8d\x81\x7a\x82\x70\x4b\x45\x4a\x44\x4c\x4b\x42\x79\x8c\x79\x90\x90”;

[0103] Sequentially take numbers from 2 to 254 as subtraction keys, perform byte-by-byte subtraction operations with the hexadecimal byte stream, and obtain the third single algorithm decryption result.

[0104] temp = b''

[0105] for data in extracted_data_bytes: # Take one byte from the TCP payload at a time

[0106] temp = temp + struct.pack('B', (data - key)&0xff)# Perform subtraction operation with the subtraction key, convert the decimal data after the subtraction operation into hexadecimal, and store it in temp.

[0107] Take the number 2 as the subtraction key, and the result is shown in the figure below. Take 3, 4, 5, 6, ..., 254 as the XOR key in sequence.

[0108]

[0109] Taking the number 20 as the subtraction key, the result is as follows.

[0110]

[0111] The TCP payloads of the predefined several identical triples are input into the decoding submodules respectively, and the fourth algorithm decryption results are obtained, including:

[0112] Convert a predefined number of identical triples of TCP payloads into a hexadecimal byte stream, such as “\x57\xca\x00\x2e\x1e\xbc\x2b\x41\x00\x64\x00\x6d\x00\x69\x00\x6e\x00\x69\x00\x73\x00\x74\x00\x72\x00\x61\x00\x74\x00\x6f\x00\x72\x00\x0 0\x00\x5a\x00\x48\x00\x2d\x00\x43\x00\x4e\x00\x00\x00\x4d\x00\x69\x00\x63\x00\x72\ x00\x6f\x00\x73\x00\x6f\x00\x66\x00\x74\x00\x20\x00\x57\x00\x69\x00\x6e\x00\x64\x00 \x6f\x00\x77\x00\x73\x00\x20\x00\x31\x00\x30\x00\x20\x00\x13\x4e\x1a\x4e\xe5\x5d\x 5c\x4f\xd9\x7a\x48\x72\x00\x00\x36\x00\x34\x00\x20\x00\x4d\x4f\x00\x00\x30\x00\x30\ x00\x3a\x00\x30\x00\x43\x00\x3a\x00\x32\x00\x39\x00\x3a\x00\x31\x00\x33\x00\x3a\x0 0\x39\x00\x32\x00\x3a\x00\x37\x00\x44\x00\x00\x00\x37\x00\x2e\x00\x30\x00\x00\x00”;

[0113] The hexadecimal byte stream is decoded using UTF-16LE, UTF-16BE and Base64 respectively, as shown in Table 4, and the decoding operation is performed using the built-in function of Python to obtain the fourth algorithm decryption result.

[0114]

[0115] Table 4

[0116]

[0117] The TCP payloads of several predefined identical triples are input into the decompression submodule respectively, and the decryption results of the fifth algorithm are obtained, including:

[0118] Convert a predefined number of identical triples of TCP payloads into a hexadecimal byte stream, such as "\x1f\x8b\x08\x00\x50\x74\xa0\x66\x00\xff\x05\x80\x21\x11\x00\x00\x08\xc4\x32\x2d\x0d\x05\x30\x18\x10\x88\xaf\xbf\xab\xd9\xbe\x3c\x08\x4d\x50\xcc\x5b\x09\x00\x00\x00";

[0119] Match the compression algorithm identification header,

[0120] If "\x1f\x8b\x08\" is matched, the hexadecimal byte stream is decompressed using the Python built-in library Gzip to obtain the decryption result of the fifth algorithm, as shown in Table 5;

[0121] If "\x78\x9c" is matched, the hexadecimal byte stream is decompressed using the Python built-in library Zlib to obtain the decryption result of the fifth algorithm, as shown in Table 5.

[0122] Table 5

[0123]

[0124] After decompressing with gzip, the string "windows11" is obtained.

[0125] The combined algorithm exhaustive decryption module includes a plurality of combined submodules; each combined submodule is a series combination of any two single algorithm submodules among the five single algorithm submodules;

[0126] The encrypted online data filter inputs a predefined number of identical triplet TCP payloads into the multiple combination submodules to obtain multiple combination algorithm decryption results;

[0127] The combined algorithm exhaustive decryption module inputs the multiple combined algorithm decryption results into the system information matching module.

[0128] Specifically, the exhaustive decryption process is demonstrated by taking "XOR exhaustive decryption submodule+decoding submodule" and "XOR exhaustive decryption submodule+addition exhaustive decryption submodule" as examples.

[0129] XOR exhaustive decryption submodule + decoding submodule

[0130] Convert the TCP payload into a hexadecimal byte stream, such as "\xa1\x00\x9d\xd9\x9d\xd8\x9d\xce\x9d\xd6\x9d\xc9\x9d\xd2\x9d\xcd\x9d\xb0\x9d\xcf\x9d\xad\x9d\xdc\x9d\xce\x9d\xd3\x9d\xdc\x9d\xdc\x9d\x9d\x9d\x5d\x3 5\xe7\x29\xdc\x9d\xf9\x9d\xf0\x9d\xf4\x9d\xf3\x9d\x9d\x9d\xd0\x9d\xf4\x9d\xfe\x9d\x ef\x9d\xf2\x9d\xee\x9d\xf2\x9d\xfb\x9d\xe9\x9d\xbd\x9d\xca\x9d\xf4\x9d\xf3\x9d\xf9\ x9d\xf2\x9d\xea\x9d\xee\x9d\xbd\x9d\xaa\x9d\xbd\x9d\xc8\x9d\xf1\x9d\xe9\x9d\xf4\x9d \xf0\x9d\xfc\x9d\xe9\x9d\xf8\x9d\xbd\x9d\x9d\x9d\xae\x9d\xaf\x9d\xb0\x9d\xff\x9d\xf 4\x9d\xe9\x9d\x9d\x9d\xa8\x9d\xaf\x9d\xa7\x9d\xa8\x9d\xa9\x9d\xa7\x9d\xad\x9d\xad\x 9d\xa7\x9d\xac\x9d\xad\x9d\xa7\x9d\xde\x9d\xd9\x9d\xa7\x9d\xac\x9d\xaa\x9d\x9d\x9d”;

[0131] The TCP payload is input into the XOR exhaustive decryption submodule, which takes a number from 2 to 254 as the XOR key and performs a byte-by-byte XOR operation with the TCP payload to obtain the result;

[0132] Take the number 2 as the XOR key and perform XOR on it byte by byte to get the following result. Take the numbers 3, 4, 5, 6, 7, ..., 254 as the XOR keys in sequence.

[0133]

[0134] Take the number 157 as the XOR key and perform byte-by-byte XOR to get the following result.

[0135]

[0136] The decryption result of key 157 is used as the input of the decoding submodule, and the result after UTF-16LE decoding is as follows.

[0137]

[0138] The result after UTF-16BE decoding is as follows.

[0139]

[0140] XOR exhaustive decryption submodule + addition exhaustive decryption submodule

[0141]

[0142] The TCP payload is input into the XOR exhaustive decryption submodule, which takes a number from 2 to 254 as the XOR key and performs a byte-by-byte XOR operation with the TCP payload to obtain the result;

[0143] Take the number 2 as the XOR key and perform XOR on it byte by byte to get the following result. Take the numbers 3, 4, 5, 6, 7, ..., 254 as the XOR keys in sequence.

[0144]

[0145] Take the number 25 as the XOR key and perform byte-by-byte XOR to get the following result.

[0146]

[0147] The result of the XOR exhaustive decryption submodule is input into the addition exhaustive decryption submodule. The addition exhaustive decryption submodule takes a number from 2 to 254 as the addition key and performs a byte-by-byte addition operation with the TCP payload to obtain the result.

[0148] Take the number 2 as the addition key and perform byte-by-byte addition operations to obtain the following results. Take the numbers 3, 4, 5, 6, 7, ..., 70, ..., 254 as the addition keys in sequence.

[0149]

[0150] Take the number 70 as the addition key and perform byte-by-byte addition operations to obtain the following results.

[0151]

[0152] The system information matching module matches the system information in five single algorithm decryption results and multiple combined algorithm decryption results. If the data is matched, it is determined that the TCP encrypted traffic contains a TCP covert tunnel.

[0153] In some embodiments, the system information includes: IP address, computer name, user name, operating system version and MAC address. The system information is shown in Table 6.

[0154] Table 6

[0155]

[0156] Specifically, all XOR decryption results are input into the system information matching module, and the decryption result of the key 202 contains the system information, so the TCP covert tunnel is successfully detected.

[0157] All subtraction decryption results are input into the system information matching module. The decryption result of key 20 contains the system information, so the TCP covert tunnel is successfully detected.

[0158] The decoded result is input into the system information matching module for matching, and the system information "Microsoft" is matched, and the TCP covert tunnel is successfully detected.

[0159] The decompressed result is input into the system information matching module for matching, matching the operating system information "windows", and successfully detecting the TCP covert tunnel.

[0160] The results of the XOR exhaustive decryption submodule + the decoding submodule are input into the system information matching module for system information matching. The results after UTF-16BE decoding can match the computer name "DESKTOP", the system version "Microsoft", and "Windows", and the TCP covert tunnel is successfully detected.

[0161] The results of the XOR exhaustive decryption submodule + the addition exhaustive decryption submodule are input into the system information matching module. The decryption result with the key 70 contains the system information and the TCP covert tunnel is successfully detected.

[0162] In summary, the technical solutions of various aspects of the present invention have the following advantages compared with the prior art: they can effectively solve the detection difficulty problem of simple encrypted TCP covert tunnels, improve detection accuracy and interpretability, and help to accurately identify malicious traffic.

[0163] The second aspect of the present invention discloses an electronic device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of a method in a TCP covert tunnel detection system based on exhaustive decryption as disclosed in any one of the first aspects of the present invention are implemented.

[0164] Figure 2 is a structural diagram of an electronic device according to an embodiment of the present invention, such as Figure 2As shown, the electronic device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the electronic device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, near field communication (NFC) or other technologies. The display screen of the electronic device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic device can be a touch layer covered on the display screen, or a key, trackball or touchpad set on the housing of the electronic device, or an external keyboard, touchpad or mouse, etc.

[0165] Those skilled in the art will understand that Figure 2 The structure shown in the figure is only a structural diagram of the part related to the technical solution of the present disclosure, and does not constitute a limitation on the electronic device to which the technical solution of the present application is applied. The specific electronic device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0166] The third aspect of the present invention discloses a storage medium, specifically a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of a method in a TCP covert tunnel detection system based on exhaustive decryption according to any one of the first aspects of the present invention are implemented.

[0167] Please note that the technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification. The above embodiments only express several implementation methods of the present application, and their descriptions are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that for ordinary technicians in this field, without departing from the concept of the present application, several variations and improvements can be made, which all belong to the scope of protection of the present application. Therefore, the scope of protection of the patent in this application shall be based on the attached claims.

Claims

1. A TCP covert tunnel detection system based on exhaustive decryption, It is characterized in that The system comprises: a filtering module, a single algorithm exhaustive decryption module, a combined algorithm exhaustive decryption module and a system information matching module; The filtering module includes: a public protocol filter and an encrypted online data filter; Inputting the triplet of TCP encrypted traffic and the TCP payload into the public protocol filter; when the TCP payload does not hit any public protocol feature, the public protocol filter will output the triplet and the TCP payload to the encrypted online data filter; the triplet includes: source IP, destination IP and destination port; The encrypted online data filter will filter multiple encrypted online data packet features from the predefined TCP payloads every time it accumulates a predefined number of identical triples. When two or more encrypted online data packet features are hit, the encrypted online data filter will output the predefined number of identical triples of TCP payloads to the single algorithm exhaustive decryption module and the combined algorithm exhaustive decryption module. The single algorithm exhaustive decryption module includes five single algorithm submodules: an addition exhaustive decryption submodule, an XOR exhaustive decryption submodule, a subtraction exhaustive decryption submodule, a decoding submodule and a decompression submodule; The encrypted online data filter inputs a predefined number of identical triplet TCP payloads into the five single algorithm submodules to obtain five single algorithm decryption results; The single algorithm exhaustive decryption module inputs the five single algorithm decryption results into the system information matching module; The combined algorithm exhaustive decryption module includes a plurality of combined submodules; each combined submodule is a series combination of any two single algorithm submodules among the five single algorithm submodules; The encrypted online data filter inputs a predefined number of identical triplet TCP payloads into the multiple combination submodules to obtain multiple combination algorithm decryption results; The combined algorithm exhaustive decryption module inputs the decryption results of the multiple combined algorithms into the system information matching module; The system information matching module matches the system information in five single algorithm decryption results and multiple combined algorithm decryption results. If the data is matched, it is determined that the TCP encrypted traffic contains a TCP covert tunnel.

2. According to the TCP covert tunnel detection system based on exhaustive decryption according to claim 1, It is characterized in that The multiple encrypted online data packet features include: length indication, constant value, continuous identical data, compression algorithm identification header, Base64 encoded data and TCP large port.

3. According to the TCP covert tunnel detection system based on exhaustive decryption according to claim 1, It is characterized in that The TCP payloads of several predefined identical triples are input into the addition exhaustive decryption submodule respectively, and the first single algorithm decryption results are obtained, including: Convert a predefined number of identical triples of TCP payloads into a hexadecimal byte stream; Sequentially take numbers from 2 to 254 as addition keys, perform byte-by-byte addition operations with the hexadecimal byte stream, and obtain the first single algorithm decryption result.

4. A TCP covert tunnel detection system based on exhaustive decryption according to claim 1, It is characterized in that The TCP payloads of several predefined identical triples are input into the XOR exhaustive decryption submodule respectively, and the second single algorithm decryption results are obtained, including: Convert a predefined number of identical triples of TCP payloads into a hexadecimal byte stream; Sequentially take numbers from 2 to 254 as XOR keys, perform byte-by-byte XOR with the hexadecimal byte stream, and obtain the second single algorithm decryption result.

5. A TCP covert tunnel detection system based on exhaustive decryption according to claim 1, It is characterized in that The TCP payloads of several predefined identical triples are input into the subtraction exhaustive decryption submodules respectively, and the decryption results of the third algorithm are obtained, including: Convert a predefined number of identical triples of TCP payloads into a hexadecimal byte stream; Sequentially take numbers from 2 to 254 as subtraction keys, perform byte-by-byte subtraction operations with the hexadecimal byte stream, and obtain the third single algorithm decryption result.

6. A TCP covert tunnel detection system based on exhaustive decryption according to claim 1, It is characterized in that The TCP payloads of the predefined several identical triples are input into the decoding submodules respectively, and the fourth algorithm decryption results are obtained, including: Convert a predefined number of identical triples of TCP payloads into a hexadecimal byte stream; Use UTF-16LE, UTF-16BE and Base64 to decode the hexadecimal byte stream respectively to obtain the fourth single algorithm decryption result.

7. A TCP covert tunnel detection system based on exhaustive decryption according to claim 1, It is characterized in that The TCP payloads of several predefined identical triples are input into the decompression submodule respectively, and the decryption results of the fifth algorithm are obtained, including: Convert a predefined number of identical triples of TCP payloads into a hexadecimal byte stream; Match the compression algorithm identification header, If "\x1f\x8b\x08\" is matched, the hexadecimal byte stream is decompressed using the Python built-in library Gzip to obtain the decryption result of the fifth algorithm; If "\x78\x9c" is matched, the hexadecimal byte stream is decompressed using the Python built-in library Zlib to obtain the decryption result of the fifth algorithm.

8. A TCP covert tunnel detection system based on exhaustive decryption according to claim 1, It is characterized in that The system information includes: IP address, computer name, user name, operating system version and MAC address.

9. An electronic device, It is characterized in that The invention comprises a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the method in a TCP covert tunnel detection system based on exhaustive decryption as claimed in any one of claims 1 to 8 is executed.

10. A storage medium, It is characterized in that The computer program stored in the storage medium can be executed by one or more processors and can be used to implement the method in a TCP covert tunnel detection system based on exhaustive decryption as described in any one of claims 1 to 8.