Encrypted data packet identification method, device and electronic device
The current and historical data packets of encrypted traffic are obtained through intelligent gateways, session features are generated, and long-term memory neural network model is used for classification, solving the problem that traditional methods cannot recognize encrypted data packets, and realizing accurate identification of encrypted traffic and session type The accurate judgment improves network security and traffic control capabilities.
Patent Information
- Application Number
- CN202110270072.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-12
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2041-03-12
AI Technical Summary
Traditional network traffic classification methods cannot accurately identify encrypted data packets, resulting in limited recognition capabilities of encrypted traffic and inability to effectively manage traffic and analyze user behaviors.
The intelligent gateway obtains the current encrypted data packets in the encrypted traffic in real time, group them into the target session based on the five-tuple information, obtains multiple historical encrypted data packets, generates target session characteristics, and classifies them through the long-term and short-term memory neural network model. Determines the session type for processing.
It realizes accurate and fast classification and identification of encrypted data packets, can accurately identify session types, supports traffic processing, and improves network security and traffic control capabilities.
Smart Images

Figure CN115086242B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of network technology, and in particular to an encrypted data packet identification method and device, an electronic device, and a computer-readable storage medium. Background Art
[0002] With the development and progress of network technology, encrypted network traffic has shown explosive growth, which has brought great challenges to network bandwidth, network security and traffic control. Accurately identifying the application category of encrypted data packets in network traffic is the basis for effective traffic control, optimization, and user behavior analysis. Due to the development and progress of network technology, the limitations of traditional network traffic classification methods, such as those based on port number query and effective packet payload detection technology, have become increasingly obvious, and they are unable to accurately classify and identify data packets in today's traffic.
[0003] In the face of the increasing amount of encrypted traffic and the limited ability of traditional network traffic classification methods to identify encrypted traffic, the present invention proposes a method that can accurately and quickly classify and identify encrypted data packets in network traffic.
[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0005] The purpose of the present disclosure is to provide an encrypted data packet identification method, device and electronic device, which can accurately classify and identify encrypted data packets in encrypted traffic.
[0006] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.
[0007] The disclosed embodiment provides an encrypted data packet identification method, comprising: obtaining a current encrypted data packet in encrypted traffic in real time through an intelligent gateway; grouping the current encrypted data packet into a target session according to five-tuple information of the current encrypted data packet, wherein the target session also includes a plurality of historical encrypted data packets; obtaining N target encrypted data packets including the current encrypted data packet from the target session in chronological order, wherein N is a positive integer greater than or equal to 1; generating a target session feature according to the N target encrypted data packets; and inputting the target session feature into a session classification network model to determine the session type of the target session.
[0008] In some embodiments, N target encrypted data packets including the current encrypted data packet are obtained from the target session in chronological order, including: queuing all encrypted data packets in the target session in chronological order, with the current encrypted data packet being located at the head or the tail of the queue; and obtaining N encrypted data packets in chronological order starting from the current encrypted data packet according to the queuing result to serve as the target encrypted data packets.
[0009] In some embodiments, a target session feature is generated based on the N target encrypted data packets, including: obtaining the source port, destination port, uplink and downlink flags, payload paylod length, TCP window and the interval time between adjacent target encrypted data packets of each target encrypted data packet; generating a packet feature for each target encrypted data packet based on the source port, destination port, uplink and downlink flags, payload paylod length, TCP window and the interval time between adjacent target encrypted data packets of each target encrypted data packet; splicing the packet features of each target encrypted data packet in chronological order to generate the target session feature.
[0010] In some embodiments, generating target session characteristics based on the N target encrypted data packets also includes: obtaining the encryption protocol version, data packet size, and duration of each target encrypted data packet respectively, so as to generate data packet characteristics for each target encrypted data packet according to the source port, destination port, uplink and downlink flags, payload paylod length, TCP window, interval time between adjacent target encrypted data packets, encryption protocol version, data packet size, and duration of each target encrypted data packet.
[0011] In some embodiments, before the target session feature is input into the session classification network model, the method includes: obtaining a training session sample and a training label corresponding to the training session sample, wherein the training session sample is composed of N training encrypted data packets; inputting the training session sample into a long short-term memory neural network model to obtain training data packet features of each training encrypted data packet; splicing each training data packet feature in chronological order through the long short-term memory neural network to obtain the training session feature of the training session sample; classifying the training session feature through the long short-term memory neural network to obtain a predicted label for the training session sample; processing the predicted label and the training label through a target loss function to obtain a target cross entropy; optimizing the parameters of the long short-term memory neural network model based on the target cross entropy and through a target optimization function to complete the training of the long short-term memory neural network model and obtain the session classification network model.
[0012] In the disclosed embodiment, the encrypted data packet identification also includes: determining that the session type of the target session is a malicious session; marking the target session with a malicious session label so that the intelligent gateway refuses to pass the encrypted data packet whose five-tuple information belongs to the target session.
[0013] In some embodiments, the encrypted data packet identification also includes: determining that the session type of the target session is an important session; marking the target session with an important session tag so that the intelligent gateway arranges a smooth network link for the encrypted data packet whose five-tuple information belongs to the target session.
[0014] The embodiment of the present disclosure provides an encrypted data packet identification device, which further includes: a current encrypted data packet acquisition module, an encrypted data packet grouping module, a target encrypted data packet acquisition module, a target session feature acquisition module, and a prediction module.
[0015] Among them, the current encrypted data packet acquisition module can be configured to acquire the current encrypted data packet in the encrypted traffic in real time through the intelligent gateway; the encrypted data packet grouping module can be configured to group the current encrypted data packet into a target session according to the five-tuple information of the current encrypted data packet, and the target session also includes multiple historical encrypted data packets; the target encrypted data packet acquisition module can be configured to acquire N target encrypted data packets including the current encrypted data packet from the target session in chronological order, where N is a positive integer greater than or equal to 1; the target session feature acquisition module can be configured to generate a target session feature based on the N target encrypted data packets; the prediction module can be configured to input the target session feature into a session classification network model to determine the session type of the target session.
[0016] An embodiment of the present disclosure proposes an electronic device, which includes: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement any of the encrypted data packet identification methods described above.
[0017] The embodiment of the present disclosure provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the encrypted data packet identification method as described in any one of the above items is implemented.
[0018] The embodiment of the present disclosure provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. A processor of a computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the above-mentioned encrypted data packet identification method.
[0019] The encrypted data packet identification method, device, electronic device, and computer-readable storage medium provided by certain embodiments of the present disclosure perform grouping processing on the current encrypted data packet through quintuple information, and determine the session group (i.e., target session) to which the current encrypted data packet belongs; then obtain the target encrypted data packet including the current encrypted data packet from the target session according to the time sequence; then perform feature extraction on the target encrypted data packet to generate the target session feature of the target session; finally, perform feature classification on the target session feature through the session classification network model to determine the session type of the target session. The present disclosure accurately and quickly determines the session type of the target session by performing feature processing on the current encrypted data packet with the same quintuple information and the historical encrypted data packet closest to the current encrypted data packet, and then determines the session type of the current encrypted data packet, so as to process the current encrypted data packet according to the session type to which the current encrypted data packet belongs.
[0020] It is to be understood that the foregoing general description and the following detailed description are exemplary only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.
[0022] Figure 1 A schematic diagram showing an exemplary system architecture that can be applied to an encrypted data packet identification method or an encrypted data packet identification device according to an embodiment of the present disclosure.
[0023] Figure 2 The present invention is a schematic diagram showing the structure of a computer system applied to an encrypted data packet identification device according to an exemplary embodiment.
[0024] Figure 3 The figure is a flow chart showing a method for encrypting a data packet according to an exemplary embodiment.
[0025] Figure 4 It is a structural diagram of a long short-term memory neural network model according to an exemplary embodiment.
[0026] Figure 5 The diagram is a flow classification diagram according to an exemplary embodiment.
[0027] Figure 6A conversation classification network model training method is shown according to an exemplary embodiment.
[0028] Figure 7 The figure is a block diagram of a device for identifying encrypted data packets according to an exemplary embodiment. DETAILED DESCRIPTION
[0029] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that this disclosure will be comprehensive and complete and will fully convey the concepts of the example embodiments to those skilled in the art. The same reference numerals in the figures represent the same or similar parts, and thus their repeated description will be omitted.
[0030] The features, structures or characteristics described in the present disclosure may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known methods, devices, implementations or operations are not shown or described in detail to avoid blurring the various aspects of the present disclosure.
[0031] The accompanying drawings are only schematic diagrams of the present disclosure, and the same reference numerals in the drawings represent the same or similar parts, so their repeated description will be omitted. Some block diagrams shown in the accompanying drawings do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0032] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and steps, nor must they be executed in the order described. For example, some steps can be decomposed, and some steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0033] In this specification, the terms "a", "an", "the", "said" and "at least one" are used to indicate the presence of one or more elements / components / etc.; the terms "comprising", "including" and "having" are used to express an open-ended inclusion and mean that additional elements / components / etc. may exist in addition to the listed elements / components / etc.; the terms "first", "second" and "third" etc. are used only as labels and are not intended to limit the quantity of their objects.
[0034] Before introducing the embodiments of the present disclosure, the intelligent gateway involved in the embodiments of the present disclosure is first introduced.
[0035] A gateway is also called an internetwork connector or a protocol converter. A gateway realizes network interconnection above the network layer. It is a complex network interconnection device that is only used for interconnecting two networks with different high-level protocols. Gateways can be used for both wide area network interconnection and local area network interconnection. A gateway is a computer system or device that performs the important task of conversion. It is used between two systems with different communication protocols, data formats or languages, or even completely different architectures. A gateway is a translator. Unlike a bridge that simply transmits information, a gateway repackages the received information to meet the needs of the destination system.
[0036] The gateway can be used between servers, between servers and client devices, or between clients, and the present disclosure does not impose any restrictions on this.
[0037] Below, the application scenario of the present disclosure is introduced by taking the application of a smart network card between a server and a client device as an example, but the present disclosure is not limited to this.
[0038] Figure 1 A schematic diagram showing an exemplary system architecture that can be applied to an encrypted data packet identification method or an encrypted data packet identification device according to an embodiment of the present disclosure.
[0039] like Figure 1 As shown, system architecture 100 may include terminal devices 101, 102, 103, intelligent gateway 104 and server 105. Terminal devices 101, 102, 103 and the server may communicate via the intelligent gateway, and the network may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0040] Users can use terminal devices 101, 102, 103 to interact with server 105 through the network to receive or send messages, etc. Terminal devices 101, 102, 103 can be various electronic devices with display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, wearable devices, virtual reality devices, smart homes, etc.
[0041] The server 105 may be a server that provides various services, such as a background management server that provides support for devices operated by users using the terminal devices 101, 102, and 103. The background management server may analyze and process the received request data, and feed back the processing results to the terminal device.
[0042] The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, as well as big data and artificial intelligence platforms, etc. The present disclosure does not impose any restrictions on this.
[0043] When the server 105 communicates with the terminal devices 101, 102, 103, the communication data may pass through the intelligent gateway in the form of encrypted traffic to complete the protocol conversion, etc. The encrypted traffic may be composed of a plurality of encrypted data packets.
[0044] When the server 105 communicates with the terminal devices 101, 102, and 103, the communication data may pass through the intelligent gateway 104, which can be used to obtain the current encrypted data packet in the encrypted traffic in real time; group the current encrypted data packet into a target session according to the five-tuple information of the current encrypted data packet, and the target session also includes multiple historical encrypted data packets; obtain N target encrypted data packets including the current encrypted data packet from the target session in chronological order, where N is a positive integer greater than or equal to 1; generate target session features according to the N target encrypted data packets; input the target session features into a session classification network model to determine the session type of the target session, and then process the current encrypted data packet according to the session type of the target session, etc.
[0045] It should be understood that Figure 1 The number of terminal devices, gateways and servers in the figure is only for illustration. The server 105 may be a physical server or may be composed of multiple servers. According to actual needs, it may have any number of terminal devices, networks and servers.
[0046] Reference below Figure 2 , which shows a schematic diagram of the structure of a computer system 200 of a terminal device suitable for implementing an embodiment of the present application. Figure 2 The terminal device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0047] like Figure 2As shown, the computer system 200 includes a central processing unit (CPU) 201, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 202 or a program loaded from a storage part 208 into a random access memory (RAM) 203. In the RAM 203, various programs and data required for the operation of the computer system 200 are also stored. The CPU 201, the ROM 202, and the RAM 203 are connected to each other via a bus 204. An input / output (I / O) interface 205 is also connected to the bus 204.
[0048] The following components are connected to the I / O interface 205: an input section 206 including a keyboard, a mouse, etc.; an output section 207 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 208 including a hard disk, etc.; and a communication section 209 including a network interface card such as a LAN card, a modem, etc. The communication section 209 performs communication processing via a network such as the Internet. A drive 210 is also connected to the I / O interface 205 as needed. A removable medium 211, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 210 as needed, so that a computer program read therefrom is installed into the storage section 208 as needed.
[0049] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program contains a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication part 209, and / or installed from a removable medium 211. When the computer program is executed by the central processing unit (CPU) 201, the above-mentioned functions defined in the system of the present application are executed.
[0050] It should be noted that the computer-readable storage medium shown in the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium may also be any computer-readable storage medium other than a computer-readable storage medium that can send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0051] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the above-mentioned module, program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0052] The modules and / or units involved in the embodiments described in the present application may be implemented by software or hardware. The modules and / or units described may also be arranged in a processor, for example, may be described as: a processor includes a sending unit, an acquiring unit, a determining unit, and a first processing unit. The names of these modules and / or units do not, in some cases, constitute limitations on the modules and / or units themselves.
[0053] As another aspect, the present application also provides a computer-readable storage medium, which may be included in the device described in the above embodiment; or it may exist independently without being assembled into the device. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed by a device, the device can implement functions including: obtaining the current encrypted data packet in the encrypted traffic in real time through the intelligent gateway; grouping the current encrypted data packet into a target session according to the five-tuple information of the current encrypted data packet, and the target session also includes multiple historical encrypted data packets; obtaining N target encrypted data packets including the current encrypted data packet from the target session in chronological order, where N is a positive integer greater than or equal to 1; generating target session features according to the N target encrypted data packets; and inputting the target session features into the session classification network model to determine the session type of the target session.
[0054] Traffic identification is an important task in the field of computer networks. Its purpose is to determine whether the network traffic data contains malicious behavior at the network boundary. If malicious behavior is found, security measures such as blocking are taken in a timely manner to ensure the network security of end users. In recent years, with the widespread application of encrypted communication protocols, many malicious traffic has also begun to use encrypted communication. Since malicious behavior is hidden in encrypted data, malicious traffic is difficult to identify, and malicious encrypted traffic has become a problem and bottleneck for security monitoring.
[0055] With the rapid development of network technology, the Internet and related applications have appeared in every corner of our daily life. Correspondingly, the types of encrypted traffic on the Internet are increasing and the scale is getting larger and larger. The Internet has enabled people's daily life quality to be continuously improved and enhanced, but at the same time, the Internet has also brought more and more problems, such as the large-scale spread of viruses and Trojans and the harm caused by them, the large-scale congestion and delay of the network caused by a large number of P2P applications and traffic, and the hostile forces using the Internet to steal secrets and conduct network attacks on important government agencies and scientific research institutes in my country. These problems need to be dealt with urgently. One of the keys to solving the above problems is how to accurately and effectively identify various types of encrypted traffic in a complex real network environment and detect abnormal traffic.
[0056] The technical solution provided by the disclosed embodiment accurately determines the session type of the current encrypted data packet by performing feature recognition on the session group features of the target session where the current encrypted data packet is located. For example, the current encrypted data packet belongs to an encrypted data packet in a malicious session, a video session, a voice session, or the like, so as to perform traffic processing according to the session type of the current encrypted data packet to meet user needs.
[0057] Figure 3 is a flowchart of a method for encrypting a data packet according to an exemplary embodiment. The method provided by the embodiment of the present disclosure can be executed by any electronic device with computing processing capabilities. For example, the method can be executed by the above Figure 1 In the embodiments, the intelligent gateway executes. In the following embodiments, the execution subject is taken as the intelligent gateway as an example for illustration, but the present disclosure is not limited to this.
[0058] Reference Figure 3 The encrypted data packet identification method provided by the embodiment of the present disclosure may include the following steps.
[0059] In step S1, the intelligent gateway obtains the current encrypted data packet in the encrypted traffic in real time.
[0060] A data packet, also known as a packet, is a formatted unit of data transmitted in a packet-switched network.
[0061] A data packet can be divided into two parts, including control information, namely the header, and the data itself, namely the payload. A data packet can be compared to a letter, the header is equivalent to the envelope, and the data part of the data packet is equivalent to the content of the letter.
[0062] An encrypted data packet can be formed by encrypting the data of the data packet (that is, the payload) through a certain encryption protocol, and multiple data packets can form encrypted traffic by passing through the intelligent gateway continuously.
[0063] It is understandable that, since an intelligent gateway can perform protocol conversion on traffic from (or to) different devices, the encrypted data packets obtained by the intelligent gateway in a continuous time may come from different devices, may be forwarded to different devices, may be generated through the same communication protocol, or may be generated through different protocols, and the present disclosure does not limit this. In order to be able to perform fine-grained classification of the session type of encrypted traffic passing through the intelligent gateway, the embodiments of the present disclosure classify and identify the encrypted data packets in the encrypted traffic one by one.
[0064] In some embodiments, the encrypted data packet obtained by the intelligent gateway at the current time may be referred to as a current encrypted data packet, and the encrypted data packet obtained by the intelligent gateway at a historical time may be referred to as a historical encrypted data packet.
[0065] In step S2, the current encrypted data packet is grouped into a target session according to the five-tuple information of the current encrypted data packet, and the target session also includes a plurality of historical encrypted data packets.
[0066] Quintuple is a communication term, usually referring to source IP address, source port, destination IP address, destination port, and transport layer protocol.
[0067] In some embodiments, data packets with the same five-tuple information may be grouped into one session.
[0068] In some embodiments, since the same intelligent gateway may receive data packets with different five-tuple information at different times, the intelligent gateway may group the encrypted data packets according to the five-tuple information of the data packet after receiving the current encrypted data packet to serve as encrypted data packets in a session.
[0069] For example, when the intelligent gateway obtains the current encrypted data packet, it can group the current encrypted data packet into a target session according to the five-tuple information of the current encrypted data packet. The target session may also include multiple other historical encrypted data packets with the same five-tuple information as the current encrypted data packet.
[0070] In step S3, N target encrypted data packets including the current encrypted data packet are obtained from the target session in chronological order, where N is a positive integer greater than or equal to 1.
[0071] In some embodiments, all encrypted data packets in the target session may be queued in chronological order, and the current encrypted data packet may be located at the head or the tail of the queue, which is not limited in the present disclosure.
[0072] In some embodiments, N (eg, 20) encrypted data packets may be acquired in chronological order starting from the current encrypted data packet according to the queuing result to serve as the target encrypted data packet.
[0073] In short, the historical encrypted data packet closest to the current encrypted data packet can be used as the target encrypted data packet.
[0074] It can be understood that if the target session includes at least N encrypted data packets, N encrypted data packets can be obtained in chronological order starting from the current encrypted data packet to serve as the target encrypted data packet; if there are less than N encrypted data packets in the target session, the intelligent gateway does not classify and identify the current encrypted data packet, but continues to obtain the encrypted data packet at the next moment.
[0075] In step S4, target session features are generated according to the N target encrypted data packets.
[0076] In some embodiments, one or more of the source port, destination port, uplink and downlink flags, payload paylod length, TCP window and the interval time between adjacent target encrypted data packets of each target encrypted data packet can be obtained respectively; then, according to one or more of the source port, destination port, uplink and downlink flags, payload paylod length, TCP window and the interval time between adjacent target encrypted data packets of each target encrypted data packet, packet characteristics are generated for each target encrypted data packet respectively; finally, the packet characteristics of each target encrypted data packet are spliced in chronological order to generate the target session characteristics.
[0077] Among them, the source port of the target data packet may refer to the port for sending the target encrypted data packet; the destination port may refer to the port for receiving the target encrypted data packet; the uplink and downlink flags may be used to determine whether the target encrypted data packet is an uplink data packet or a downlink data packet; the payload may be used to determine the payload of the target encrypted data packet; TCP window (i.e. TCP Window): a feature of the TCP protocol, indicating the amount of data that can be received, and its function is to control the flow rate of TCP; the interval time between two adjacent target encrypted data packets may refer to the reception interval time of the two adjacent target encrypted data packets.
[0078] Reasons for selecting the above features as the features of the target encrypted data packet may include:
[0079] 1. Based on the observation of actual traffic, especially for the types we want to distinguish, the above characteristics have relatively high specificity and can be used as a basis for distinction.
[0080] 2. Considering the complexity of feature extraction, the above six features for each packet are relatively basic and can be extracted quickly. (Considering the real-time nature of traffic prediction, since the same session generally has hundreds or even thousands of packets with similar actual features, extracting only the features of the first N (for example, 20) packets is conducive to real-time prediction of traffic categories, without having to wait until the end of the entire session to perform statistics and predictions. From the perspective of business needs, predicting traffic in advance is also conducive to traffic control, and is convenient for operations such as traffic on-off control and route selection.
[0081] In some other embodiments, the encryption protocol version, packet size, and duration can also be obtained for each target encrypted data packet, so as to generate packet characteristics for each target encrypted data packet based on its source port, destination port, uplink and downlink flags, payload paylod length, TCP window, interval time between adjacent target encrypted data packets, encryption protocol version, packet size, and duration.
[0082] It can be understood that methods for generating data packet features based on feature information known to those skilled in the art are all within the protection scope of the embodiments of the present disclosure.
[0083] To ensure that the embodiment can be clearly reproduced, this embodiment provides the following method to explain the process of generating data packet features, but the present disclosure is not limited thereto.
[0084] Assume that the packet feature of the target encrypted data packet can be generated according to the payload of the target encrypted data packet and the time interval between adjacent target encrypted data packets. The generation process may include the following steps:
[0085] The effective load is pre-set into n levels according to the load range, and the corresponding characteristic values of each level are 1 to n respectively; the time interval is pre-set into m levels according to the interval range, and the corresponding characteristic values of each level are 1 to m; if the effective load of the target encrypted data packet falls within the first load level, the characteristic value of the effective load of the target encrypted data packet is 1; if the interval time of the target encrypted data packet falls within the mth interval time level, the characteristic value of the interval time of the target encrypted data packet is m; in summary, the data packet characteristic value generated according to the effective load and interval time of the target encrypted data packet is [1, m].
[0086] According to the above method, those skilled in the art can deduce a method of generating data packet features for a target encrypted data packet according to other features, which will not be described in detail in this disclosure.
[0087] In step S5, the target session feature is input into a session classification network model to determine the session type of the target session.
[0088] In some embodiments, the session classification network model may be a Figure 4 Obtained after training the long short-term memory neural network model (LSTM, Long Short-Term Memory) shown.
[0089] Figure 4 This is a schematic diagram of a single neuron unfolded in time series, that is, the input of a single neuron at each moment is composed of the output result of the previous moment and the external input at that moment in the time series. The conversation classification network model is obtained by training a large amount of data;
[0090] Long short-term memory network is a time recurrent neural network, which is specially designed to solve the long-term dependency problem of general RNN (recurrent neural network). All RNNs have a chain form of repeated neural network modules. Long short-term memory neural network is a time recurrent neural network, which is suitable for processing and predicting important events with time intervals and delays in time series, and can learn long-term dependencies.
[0091] In the disclosed embodiment, each data packet feature in the target session feature includes the time interval between each adjacent encrypted data packet. The characteristics between adjacent target encrypted data packets can be better learned through the long short-term memory network model.
[0092] In some embodiments, the session type of the target session may be a malicious session type, a video chat conference type, a voice chat conference type, a video play type, a music play type, a file transfer type, or other types.
[0093] In some embodiments, if the session type of the target session is determined to be a malicious session, the target session may be marked with a malicious session tag so that the intelligent gateway may reject encrypted data packets whose five-tuple information belongs to the target session in subsequent operations.
[0094] In some embodiments, if the session type of the target session is determined to be an important session, the target session can be marked with an important session tag so that the intelligent gateway can arrange a smooth network link for the encrypted data packet whose five-tuple information belongs to the target session in subsequent work.
[0095] Among them, the important conversation can be a conversation type specified in advance, such as a video conversation, voice conversation, etc. sent by a certain device, and the present disclosure does not limit this.
[0096] In some other embodiments, combined with user-defined requirements, the method provided by the embodiments of the present disclosure can be used to control the on-off of traffic, such as user-defined rules allowing file transfer and voice chat traffic to pass through, but not allowing traffic for watching videos and listening to music to pass through the gateway;
[0097] In some other embodiments, user-defined rules and functions of other modules of the intelligent gateway system can be combined to select links for traffic data according to the prediction results. For example, video conference traffic will be arranged to pass through a smoother network link, giving priority to ensuring low-latency network quality;
[0098] In addition, authorized users are allowed to obtain gateway traffic statistics within a period of time, such as network traffic statistics within the past 7 days. The statistical results are as follows: Figure 5As shown, statistics show that the traffic passing through the smart gateway over a period of time includes 17.39% of video playback traffic, 0.03% of voice call traffic, 2.7% of search engine traffic, etc.
[0099] The encrypted data packet identification method proposed in the present invention has simple and representative features, fast extraction speed, and creatively adds the use of the time dimension to the encrypted traffic identification method (such as innovatively adding the time interval features of adjacent target encrypted data packets to the data packet features, using the long short-term memory neural network model to extract features, etc.), and obtains a higher encrypted traffic identification accuracy through single-layer neural network model training.
[0100] The encrypted traffic identification technology based on this solution can be well applied to intelligent gateways, replacing traditional DPI traffic identification solutions to complete encrypted and non-encrypted traffic analysis, statistics, and management, thereby realizing data mining and application in the cloud network era, and ensuring the security of cloud basic services through traffic control.
[0101] Figure 6 A conversation classification network model training method is shown according to an exemplary embodiment. Figure 6 , the above method for training the conversation classification network model may include the following steps.
[0102] In step S01, a training session sample and a training label corresponding to the training session sample are obtained, wherein the training session sample is composed of N training encrypted data packets.
[0103] In some embodiments, the training session sample may be a session sample with a known training label, and the session sample may include N encrypted data packets with the same five-tuple information. The encrypted data packets with the same five-tuple information may be obtained through the same intelligent gateway within a period of time.
[0104] In step S02, the training session samples are input into a long short-term memory neural network model to obtain training data packet features of each training encrypted data packet.
[0105] In step S03, the features of each training data packet are spliced in chronological order through the long short-term memory neural network to obtain the training session features of the training session sample.
[0106] In step S04, the training session features are classified by the long short-term memory neural network to obtain a predicted label for the training session sample.
[0107] In step S05, the predicted label and the training label are processed by a target loss function to obtain a target cross entropy.
[0108] In some embodiments, the target cross entropy between the predicted label and the training label can be obtained by formula (1).
[0109]
[0110] Among them, y i can represent the predicted label, It can represent the training label, and n represents the number of training session samples.
[0111] In step S06, the parameters of the long short-term memory neural network model are optimized based on the target cross entropy through a target optimization function to complete the training of the long short-term memory neural network model and obtain the conversation classification network model.
[0112] In some embodiments, the parameters in the long short-term memory neural network model can be optimized by the AdamOptimizer (adaptive) optimization algorithm to complete the training of the long short-term memory neural network model and obtain a session classification network model.
[0113] The technical solution provided by the embodiment of the present disclosure trains a conversation classification network model that can accurately identify the categories of conversation features of a target conversation through pre-labeled training conversation samples. During the training process, the recognition accuracy of the conversation classification network model is provided through the setting of cross entropy and optimization functions.
[0114] Figure 7 is a block diagram of a device for identifying encrypted data packets according to an exemplary embodiment. Figure 7 The encrypted data packet identification device 700 provided in the embodiment of the present disclosure may include: a current encrypted data packet acquisition module 701, an encrypted data packet grouping module 702, a target encrypted data packet acquisition module 703, a target session feature acquisition module 704 and a prediction module 705.
[0115] Among them, the current encrypted data packet acquisition module 701 can be configured to acquire the current encrypted data packet in the encrypted traffic in real time through the intelligent gateway; the encrypted data packet grouping module 702 can be configured to group the current encrypted data packet into a target session according to the five-tuple information of the current encrypted data packet, and the target session also includes multiple historical encrypted data packets; the target encrypted data packet acquisition module 703 can be configured to acquire N target encrypted data packets including the current encrypted data packet from the target session in chronological order, where N is a positive integer greater than or equal to 1; the target session feature acquisition module 704 can be configured to generate a target session feature based on the N target encrypted data packets; the prediction module 705 can be configured to input the target session feature into a session classification network model to determine the session type of the target session.
[0116] In some embodiments, the target encrypted data packet acquisition module 703 may include: a sorting unit and a target encrypted data packet determination unit.
[0117] Among them, the sorting unit can be configured to queue all encrypted data packets in the target session in chronological order, with the current encrypted data packet located at the head or tail of the queue; the target encrypted data packet determination unit can be configured to obtain N encrypted data packets in chronological order starting from the current encrypted data packet based on the queuing results, as the target encrypted data packet.
[0118] In some embodiments, the target session feature acquisition module 704 may include: a feature determination unit, a data packet feature generation unit, and a splicing unit.
[0119] Among them, the feature determination unit can be configured to respectively obtain the source port, destination port, uplink and downlink flags, payload paylod length, TCP window and the interval time between adjacent target encrypted data packets of each target encrypted data packet; the packet feature generation unit can be configured to generate packet features for each target encrypted data packet according to the source port, destination port, uplink and downlink flags, payload paylod length, TCP window and the interval time between adjacent target encrypted data packets of each target encrypted data packet; the splicing unit can be configured to splice the packet features of each target encrypted data packet in chronological order to generate the target session feature.
[0120] In some embodiments, the target session feature acquisition module 704 may further include: a feature acquisition unit.
[0121] Among them, the feature acquisition unit can be configured to respectively obtain the encryption protocol version, data packet size, and duration of each target encrypted data packet, so as to generate data packet features for each target encrypted data packet according to the source port, destination port, uplink and downlink flags, payload paylod length, TCP window, interval time between adjacent target encrypted data packets, encryption protocol version, data packet size, and duration of each target encrypted data packet.
[0122] In some embodiments, the encrypted data packet identification device may also include: a training sample acquisition module, a training data packet feature acquisition module, a training session feature generation module, a prediction label generation module, a target cross entropy determination module and a parameter optimization module.
[0123] Among them, the training sample acquisition module can be configured to obtain training session samples and training labels corresponding to the training session samples, and the training session samples are composed of N training encrypted data packets; the training data packet feature acquisition module can be configured to input the training session samples into the long short-term memory neural network model to obtain the training data packet features of each training encrypted data packet; the training session feature generation module can be configured to splice the features of each training data packet in chronological order through the long short-term memory neural network to obtain the training session features of the training session samples; the prediction label generation module can be configured to classify the training session features through the long short-term memory neural network to obtain the prediction label for the training session sample; the target cross entropy determination module can be configured to process the prediction label and the training label through a target loss function to obtain a target cross entropy; the parameter optimization module can be configured to optimize the parameters of the long short-term memory neural network model based on the target cross entropy and through a target optimization function to complete the training of the long short-term memory neural network model and obtain the session classification network model.
[0124] In some embodiments, the encrypted session identification device may further include: a malicious session determination unit and a malicious session marking unit.
[0125] Among them, the malicious session determination unit can be configured to determine that the session type of the target session is a malicious session; the malicious session marking unit can be configured to mark the target session with a malicious session label so that the intelligent gateway refuses to pass the encrypted data packet whose five-tuple information belongs to the target session.
[0126] In some real-time, the encrypted session identification device may further include: an important session determination unit and an important session marking unit.
[0127] Among them, the important session determination unit can be configured to determine that the session type of the target session is an important session; the important session marking unit can be configured to mark the target session with an important session tag, so that the intelligent gateway arranges a smooth network link for the encrypted data packet whose five-tuple information belongs to the target session.
[0128] Since the functions of the device 700 have been described in detail in the corresponding method embodiments, the present disclosure will not elaborate on them here.
[0129] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software, or by combining software with necessary hardware. Therefore, the technical solution of the embodiment of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.), including a number of instructions for a computing device (which can be a personal computer, a server, a mobile terminal, or a smart device, etc.) to execute the method according to the embodiment of the present disclosure, for example Figure 3 One or more of the steps shown.
[0130] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.
[0131] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the disclosure disclosed herein. The present disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not applied for by the present disclosure. The specification and embodiments are to be regarded as exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.
[0132] It should be understood that the present disclosure is not limited to the detailed structures, drawings or implementations shown herein, but rather the present disclosure is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.
Claims
1. A method for identifying an encrypted data packet, characterized in that: include: The intelligent gateway obtains the current encrypted data packets in the encrypted traffic in real time; grouping the current encrypted data packet into a target session according to the five-tuple information of the current encrypted data packet, wherein the target session also includes a plurality of historical encrypted data packets; Queuing all encrypted data packets in the target session in chronological order, wherein the current encrypted data packet is at the head or the tail of the queue; According to the queuing result, N encrypted data packets are obtained in chronological order starting from the current encrypted data packet as target encrypted data packets, where N is a positive integer greater than or equal to 1; Respectively obtain the source port, destination port, uplink and downlink flags, effective load paylod length, TCP window, interval time between adjacent target encrypted data packets, encryption protocol version, data packet size and duration of each target encrypted data packet, so as to generate data packet features for each target encrypted data packet according to the source port, destination port, uplink and downlink flags, effective load paylod length, TCP window, interval time between adjacent target encrypted data packets, encryption protocol version, data packet size and duration of each target encrypted data packet; splicing the data packet features of each target encrypted data packet in chronological order to generate a target session feature; Inputting the target session feature into a session classification network model to determine the session type of the target session, wherein the session classification network model is trained by a long short-term memory neural network model, wherein the input of a single neuron at each moment of the long short-term memory network model consists of an output result at a previous moment and an external input at that moment in a time series, so that the long short-term memory network model can learn the characteristics between adjacent encrypted data packets; Before inputting the target session feature into the session classification network model, the method includes: Obtaining a training session sample and a training label corresponding to the training session sample, wherein the training session sample consists of N training encrypted data packets; Inputting the training session samples into a long short-term memory neural network model to obtain training data packet features of each training encrypted data packet; splicing the features of each training data packet in chronological order through the long short-term memory neural network to obtain the training session features of the training session sample; Classifying the training session features through the long short-term memory neural network to obtain a prediction label for the training session sample; Processing the predicted label and the training label by a target loss function to obtain a target cross entropy; Based on the target cross entropy, the parameters of the long short-term memory neural network model are optimized through a target optimization function to complete the training of the long short-term memory neural network model and obtain the session classification network model.
2. The method according to claim 1, wherein: Also includes: Determining that the session type of the target session is a malicious session; The target session is marked with a malicious session tag so that the intelligent gateway refuses to pass the encrypted data packet whose five-tuple information belongs to the target session.
3. The method according to claim 1, characterized in that: Also includes: Determining that the session type of the target session is an important session; The target session is marked with an important session tag so that the intelligent gateway arranges a smooth network link for the encrypted data packet whose five-tuple information belongs to the target session.
4. An encrypted data packet identification device, characterized in that: include: A current encrypted data packet acquisition module is configured to acquire the current encrypted data packet in the encrypted traffic in real time through the intelligent gateway; an encrypted data packet grouping module, configured to group the current encrypted data packet into a target session according to the five-tuple information of the current encrypted data packet, wherein the target session also includes a plurality of historical encrypted data packets; a target encrypted data packet acquisition module, configured to queue all encrypted data packets in the target session in chronological order, with the current encrypted data packet being at the head or tail of the queue; and to acquire N encrypted data packets in chronological order starting from the current encrypted data packet according to the queuing result as target encrypted data packets, where N is a positive integer greater than or equal to 1; A target session feature acquisition module is configured to respectively acquire the source port, destination port, uplink and downlink flags, effective load paylod length, TCP window, interval time between adjacent target encrypted data packets, encryption protocol version, data packet size and duration of each target encrypted data packet, so as to generate data packet features for each target encrypted data packet according to the source port, destination port, uplink and downlink flags, effective load paylod length, TCP window, interval time between adjacent target encrypted data packets, encryption protocol version, data packet size and duration of each target encrypted data packet; splicing the data packet features of each target encrypted data packet in chronological order to generate a target session feature; a prediction module configured to input the target session feature into a session classification network model to determine the session type of the target session, wherein the session classification network model is trained by a long short-term memory neural network model, wherein the input of a single neuron at each moment of the long short-term memory network model consists of an output result at a previous moment and an external input at that moment in a time series, so that the long short-term memory network model can learn the characteristics between adjacent encrypted data packets; Before inputting the target session feature into the session classification network model, the method includes: Obtaining a training session sample and a training label corresponding to the training session sample, wherein the training session sample consists of N training encrypted data packets; Inputting the training session samples into a long short-term memory neural network model to obtain training data packet features of each training encrypted data packet; splicing the features of each training data packet in chronological order through the long short-term memory neural network to obtain the training session features of the training session sample; Classifying the training session features through the long short-term memory neural network to obtain a prediction label for the training session sample; Processing the predicted label and the training label by a target loss function to obtain a target cross entropy; Based on the target cross entropy, the parameters of the long short-term memory neural network model are optimized through a target optimization function to complete the training of the long short-term memory neural network model and obtain the session classification network model.
5. An electronic device, characterized in that: include: Memory; as well as A processor coupled to the memory, wherein the processor is configured to execute the method according to any one of claims 1 to 3 based on instructions stored in the memory.
6. A computer-readable storage medium having a program stored thereon, wherein when the program is executed by a processor, the method according to any one of claims 1 to 3 is implemented.
