Data processing method, device and electronic equipment

By decrypting the encrypted data connection requests and handshake messages between the client and the server under the FTPS protocol, the problem that the network intermediate device cannot obtain the data transmitted between the client and the server is solved, the data connection agent and port identification are realized, and the data efficiency is improved. Transmission security and acquisition efficiency.

CN115118713BActive Publication Date: 2024-10-29BEIJING HILLSTONE NETWORKS INFORMATION TECHCO
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210698179.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-20
Publication Date
2024-10-29
Estimated Expiration
2042-06-20

AI Technical Summary

Technical Problem

Under the FTPS protocol, the encrypted data connection request between the client and the server prevents the network intermediate device from obtaining the transmission data between the client and the server, resulting in low acquisition efficiency.

Method used

By decrypting the data connection request sent by the client to the server and the handshake message generated by the server, it detects whether the request information and the reply information match, and when they match, control the network intermediate device to establish a connection with the client and server to Get the target encrypted data.

Benefits of technology

It implements the network intermediary device's data connection proxy between the client and the server, ensuring accurate identification of the data communication port opened by the client in any scenario, solving the problem of low acquisition efficiency, and improving the security and reliability of data transmission. Monitorability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115118713B_ABST
    Figure CN115118713B_ABST
Patent Text Reader

Abstract

The present application discloses a data processing method, device and electronic device. The method includes: obtaining a data connection request sent by a client to a server and a handshake message generated by the server according to the data connection request, wherein the data connection request includes at least request information, the request information includes at least a first port number, and the data connection request and the handshake message are in an encrypted state; decrypting the data connection request and the handshake message, and detecting whether the request information matches the reply information; when the reply information matches the request information, controlling the network intermediate device to connect to the client and the server respectively according to the reply information, and obtaining the target encrypted data transmitted between the client and the server. The present application solves the technical problem of low acquisition efficiency of the network intermediate device in the prior art when obtaining encrypted data transmitted between the client and the server.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology and information security, and more specifically, to a data processing method, device and electronic device. Background Art

[0002] FTPS is an enhanced FTP protocol that uses standard FTP (file transfer protocol) protocols and instructions on the secure socket layer, adding SSL (secure socketslayer) security features to the FTP protocol and data channel. People can usually enable SSL encryption based on the FTP client to access the FTPS server to upload and download files, and the file transfer process is encrypted.

[0003] However, when the client and the server communicate based on the FTPS protocol, the data connection request sent by the client to the server is also encrypted, which makes it impossible for network intermediate devices such as firewalls to proxy the connection between the client and the server, and thus cannot obtain the data transmitted between the client and the server.

[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention

[0005] The embodiments of the present application provide a data processing method, device and electronic device to at least solve the technical problem of low acquisition efficiency of network intermediate devices in the prior art when acquiring encrypted data transmitted between a client and a server.

[0006] According to one aspect of an embodiment of the present application, a data processing method is provided, comprising: obtaining a data connection request sent by a client to a server and a handshake message generated by the server according to the data connection request, wherein the data connection request includes at least request information, the request information includes at least a first port number, and the first port number is the port number of a data communication port opened by the client; the handshake message includes at least reply information, the reply information includes at least a second port number, and the second port number is the port number identified by the server by parsing the data connection request, and the data connection request and the handshake message are in an encrypted state; decrypting the data connection request and the handshake message, and detecting whether the request information matches the reply information; when the reply information matches the request information, controlling the network intermediate device to connect to the client and the server respectively according to the reply information, and obtaining target encrypted data transmitted between the client and the server.

[0007] Furthermore, the data processing method also includes: before obtaining the data connection request sent by the client to the server and the handshake message generated by the server according to the data connection request, detecting whether encrypted data can be transmitted between the client and the server; when encrypted data can be transmitted between the client and the server, obtaining a first request sent by the client to the server, wherein the first request is used to represent that the client requests the server to transmit data in an encrypted mode, and the data transmitted between the client and the server in the encrypted mode is encrypted data; according to the first request, controlling the network intermediate device to establish an initial connection with the client and the server respectively, and obtaining a control command between the client and the server, wherein the control command is an encrypted command, and the control command includes at least a data connection request and a handshake message.

[0008] Furthermore, the data processing method also includes: obtaining a plain text command transmitted between the client and the server; and determining whether encrypted data can be transmitted between the client and the server according to the plain text command.

[0009] Furthermore, the data processing method also includes: the request information also includes at least the network address of the client, and the reply information also includes at least the target network address identified by the server by parsing the data connection request, detecting whether the network address is the same as the target network address, and whether the first port number is the same as the second port number; when the network address is the same as the target network address, and the first port number is the same as the second port number, determining that the reply information matches the request information, and generating a first detection result, wherein the first detection result is used to characterize that the server correctly identifies the request information of the client; when the network address is different from the target network address, or the first port number is different from the second port number, determining that the reply information does not match the request information, and generating a second detection result, wherein the second detection result is used to characterize that the server incorrectly identifies the request information of the client.

[0010] Furthermore, the data processing method also includes: obtaining target encrypted data sent by a service port, wherein the service port is a port opened on the server; and forwarding the target encrypted data sent by the service port to a data communication port.

[0011] Furthermore, the data processing method also includes: acquiring target encrypted data sent by the data communication port; and forwarding the target encrypted data sent by the data communication port to the service port.

[0012] Furthermore, the data processing method also includes: after obtaining the target encrypted data transmitted between the client and the server, decrypting the target encrypted data to obtain the decrypted data to be detected; detecting whether there is abnormal information in the data to be detected, and generating a detection result, wherein the abnormal information at least includes program information that maliciously attacks the server or the client.

[0013] According to another aspect of an embodiment of the present application, a data processing device is also provided, including: a first acquisition module, used to acquire a data connection request sent by a client to a server and a handshake message generated by the server according to the data connection request, wherein the data connection request includes at least request information, the request information includes at least a first port number, the first port number is the port number of the data communication port opened by the client, the handshake message includes at least reply information, the reply information includes at least a second port number, the second port number is the port number identified by the server by parsing the data connection request, and the data connection request and the handshake message are in an encrypted state; a decryption module, used to decrypt the data connection request and the handshake message, and detect whether the request information matches the reply information; a second acquisition module, used to control the network intermediate device to connect to the client and the server respectively according to the reply information when the reply information matches the request information, and acquire the target encrypted data transmitted between the client and the server.

[0014] According to another aspect of an embodiment of the present application, a computer-readable storage medium is further provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned data processing method when running.

[0015] According to another aspect of an embodiment of the present application, an electronic device is also provided, which includes one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by one or more processors, the one or more processors are implemented to run the programs, wherein the programs are configured to execute the above-mentioned data processing method when running.

[0016] In the present application, by decrypting the data connection request and the handshake message, after obtaining the data connection request sent by the client to the server and the handshake message generated by the server according to the data connection request, the data connection request and the handshake message are decrypted, and the request information and the reply information are detected to see whether they match. Finally, when the reply information matches the request information, the network intermediate device is controlled to connect to the client and the server respectively according to the reply information, and the target encrypted data transmitted between the client and the server is obtained. Among them, the data connection request at least includes the request information, the request information at least includes the first port number, and the first port number is the port number of the data communication port opened by the client, the handshake message at least includes the reply information, and the reply information at least includes the second port number, and the second port number is the port number identified by the server by parsing the data connection request, and the data connection request and the handshake message are in an encrypted state.

[0017] It can be seen from the above content that after obtaining the data connection request and handshake message in an encrypted state, the present application will first decrypt them, thereby obtaining the request information in the data connection request and the reply information in the handshake message. Furthermore, since the request information at least contains the first port number of the data communication port opened by the client, and the reply information contains the second port number, therefore, no matter which port the data communication port opened by the client is, the network intermediate device can determine the port in the decrypted state, thereby successfully connecting the client and the server, and then obtaining the target encrypted data between the client and the server, that is, achieving the purpose of the network intermediate device acting as a proxy for the data connection between the client and the server, and solving the problem in the prior art that the network intermediate device cannot obtain the encrypted data transmitted between the client and the server because the data connection request initiated by the client to the server is in an encrypted state.

[0018] It can be seen that through the technical solution of the present application, the purpose of having the network intermediate device proxy the data connection between the client and the server is achieved, thereby ensuring that the network intermediate device accurately identifies the data communication port opened by the client in any scenario, thereby solving the technical problem of low acquisition efficiency of the network intermediate device in the prior art when acquiring encrypted data transmitted between the client and the server. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0020] Figure 1 is a schematic diagram of an optional data processing method according to an embodiment of the present application;

[0021] Figure 2 is a schematic diagram of an optional FTP active mode connection process according to an embodiment of the present application;

[0022] Figure 3 is a schematic diagram of an optional FTP passive mode connection process according to an embodiment of the present application;

[0023] Figure 4 is a schematic diagram of interaction between a server and a client in an implicit security mode according to an embodiment of the present application;

[0024] Figure 5 is a schematic diagram of interaction between a server and a client in an explicit security mode according to an embodiment of the present application;

[0025] Figure 6It is a flow chart of a data processing method based on FTP passive mode according to an embodiment of the present application;

[0026] Figure 7 is a schematic diagram of a data processing method according to an embodiment of the present application;

[0027] Figure 8 is an optional single message processing flow chart according to an embodiment of the present application;

[0028] Fig. 9 It is a schematic diagram of an optional data processing device according to an embodiment of the present application. DETAILED DESCRIPTION

[0029] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0030] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0031] In addition, it should be noted that the relevant information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for display, data for analysis, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties. For example, an interface is set between this system and the relevant user or organization. Before obtaining relevant information, it is necessary to send an acquisition request to the aforementioned user or organization through the interface, and obtain relevant information after receiving the consent information fed back by the aforementioned user or organization.

[0032] Example 1

[0033] According to an embodiment of the present application, a method embodiment of a data processing method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0034] It should be noted that the executors of the data processing method in the embodiments of the present application include but are not limited to network intermediate devices such as firewalls. Network intermediate devices are usually deployed between the client and the server and provide proxy services for the client and the server.

[0035] Figure 1 is a schematic diagram of an optional data processing method according to an embodiment of the present application, such as Figure 1 As shown, the method comprises the following steps:

[0036] Step S101, obtaining a data connection request sent by a client to a server and a handshake message generated by the server according to the data connection request.

[0037] In step S101, the data connection request includes at least request information, the request information includes at least a first port number, and the first port number is the port number of the data communication port opened by the client; the handshake message includes at least reply information, the reply information includes at least a second port number, and the second port number is the port number identified by the server by parsing the data connection request, and the data connection request and the handshake message are in an encrypted state.

[0038] Specifically, the client may be an FTP client, and the server may be an FTPS server. An encrypted connection may be established between the server and the client via the FTPS protocol. FTPS is also known as "FTP-SSL" and "FTP-over-SSL". SSL is a protocol for encrypting and decrypting data in a secure connection between a client and a server with SSL functionality.

[0039] When the network intermediate device has successfully proxied the control connection between the client and the server, when the client needs to upload files to the server or download files from the server, the client will send a data connection request to the server in the hope of establishing a data connection between the server and the server, wherein the data connection request includes at least the first port number and the client's network address and other request information. It should be noted that the first port number can be the port number of the data communication port randomly opened by the client. In other words, the data communication port opened by the client can be random, so in actual applications, the first port number can also be dynamically changed.

[0040] In addition, after the server receives the data connection request, the server will parse the data connection request and identify the second port number, which can be understood as the port number of the data communication port opened by the client, which is determined by the server through its own identification mechanism. In addition to the second port number, the server will also identify the target network address by parsing the data connection request, which can be the network address of the client, which is determined by the server through its own identification mechanism.

[0041] Step S102: decrypt the data connection request and the handshake message, and detect whether the request information matches the reply information.

[0042] In step S102, since the network intermediate device has successfully proxied the control connection between the client and the server, the data connection request sent by the client will reach the network intermediate device, and after receiving the data connection request, the network intermediate device will decrypt the data connection request, and then parse out the first port number, the client's network address and other request information in the data connection request, and send the request information to the ALG (application layer gateway) identification module for cache. After the server receives the data connection request, the server will actively initiate a connection to the client and attempt to perform an SSL handshake with the client. After the handshake message reaches the network intermediate device, the network intermediate device will decrypt the handshake message, and then extract the second port number, target network address and other reply information from the handshake message.

[0043] Furthermore, the network intermediate device will match the second port number with the first port number cached in the ALG identification module, and match the target network address with the network address cached in the ALG identification module. When both are successfully matched, it means that the server has correctly identified the client's data connection request. At this time, the network intermediate device can perform SSL proxy on the traffic corresponding to the data connection request, and record that the initiator of the traffic at this time is the server.

[0044] It should be noted that when the client and the server communicate based on the FTPS protocol, the data connection request sent by the client to the server is encrypted, and the data connection request will contain information such as the port number of the data communication port opened by the client. However, in some modes, the data communication port opened by the client is random. In this case, since the data connection request is encrypted, network intermediate devices such as firewalls cannot know which data communication port the client randomly opens, which makes it impossible for network intermediate devices to connect to the client and the server, and cannot obtain the encrypted data transmitted between the client and the server.

[0045] In the present application, after receiving the data connection request, the network intermediate device will decrypt the data connection request, and then accurately identify the port number of the data communication port opened by the client based on the request information obtained after decryption. On this basis, even if the data communication port opened on the client is random, the present application can still obtain the port number of the data communication port in the decrypted state, thereby ensuring that the network intermediate device accurately connects to the client and the server, and realizes the data connection proxy for the client and the server.

[0046] Step S103, when the reply information matches the request information, the network intermediate device is controlled to connect to the client and the server respectively according to the reply information, and the target encrypted data transmitted between the client and the server is obtained.

[0047] In step S103, the network intermediate device detects whether the network address is the same as the target network address, and whether the first port number is the same as the second port number. When the network address is the same as the target network address, and the first port number is the same as the second port number, the network intermediate device determines that the reply information matches the request information, and generates a first detection result, wherein the first detection result indicates that the server correctly identifies the request information of the client; when the network address is different from the target network address, or the first port number is different from the second port number, the network intermediate device determines that the reply information does not match the request information, and generates a second detection result, wherein the second detection result indicates that the server incorrectly identifies the request information of the client.

[0048] Through the above matching process, it can be ensured that only after the server accurately identifies the client's request information, the network intermediate device will establish data proxy connections with the client and the server respectively, thereby avoiding the problem of network intermediate device proxy failure.

[0049] In addition, the above-mentioned target encrypted data can be data that the client wants to upload to the server, or data that the client wants to download from the server, and all of these data are in an encrypted state.

[0050] In an optional embodiment, after obtaining the target encrypted data transmitted between the client and the server, the network intermediate device will decrypt the target encrypted data to obtain the decrypted data to be detected, and then the network intermediate device will detect whether there is abnormal information in the data to be detected and generate a detection result, wherein the abnormal information at least includes program information that maliciously attacks the server or the client.

[0051] It should be noted that as more and more clients and servers enable SSL protection, the network intermediate devices between the client and the server cannot effectively monitor, inspect, filter and count the application layer content carried by SSL. As a result, more and more malicious attack programs transmit sensitive files or virus files through FTPS encryption, resulting in user privacy leakage or FTPS server intranet attacks.

[0052] In the present application, by decrypting the acquired target encrypted data, the decrypted user traffic (corresponding to the above-mentioned data to be detected) can be audited, checked and filtered in a timely manner, so as to identify abnormal information in the data to be detected and improve the data transmission security between the client and the server. Among them, the above-mentioned network intermediate device can be a network security device such as a network firewall, and the above-mentioned abnormal information can be user sensitive information, such as company confidential data, user privacy data, and the abnormal information can also be program information that maliciously attacks the server or client, such as a script carrying a virus program.

[0053] Based on the contents of the above steps S101 to S103, it can be known that in the present application, by decrypting the data connection request and the handshake message, after obtaining the data connection request sent by the client to the server and the handshake message generated by the server according to the data connection request, the data connection request and the handshake message are decrypted, and the request information and the reply information are detected to see whether they match. Finally, when the reply information matches the request information, the network intermediate device is controlled to connect to the client and the server respectively according to the reply information, and the target encrypted data transmitted between the client and the server is obtained. Among them, the data connection request at least includes request information, the request information at least includes a first port number, and the first port number is the port number of the data communication port opened by the client, the handshake message at least includes reply information, and the reply information at least includes a second port number, and the second port number is the port number identified by the server by parsing the data connection request, and the data connection request and the handshake message are in an encrypted state.

[0054] It can be seen from the above content that after obtaining the data connection request and handshake message in an encrypted state, the present application will first decrypt them, thereby obtaining the request information in the data connection request and the reply information in the handshake message. Furthermore, since the request information at least contains the first port number of the data communication port opened by the client, and the reply information contains the second port number, therefore, no matter which port the data communication port opened by the client is, the network intermediate device can determine the port in the decrypted state, thereby successfully connecting the client and the server, and then obtaining the target encrypted data between the client and the server, that is, achieving the purpose of the network intermediate device acting as a proxy for the data connection between the client and the server, and solving the problem in the prior art that the network intermediate device cannot obtain the encrypted data transmitted between the client and the server because the data connection request initiated by the client to the server is in an encrypted state.

[0055] It can be seen that through the technical solution of the present application, the purpose of having the network intermediate device proxy the data connection between the client and the server is achieved, thereby ensuring that the network intermediate device accurately identifies the data communication port opened by the client in any scenario, thereby solving the technical problem of low acquisition efficiency of the network intermediate device in the prior art when acquiring encrypted data transmitted between the client and the server.

[0056] In addition, in an optional embodiment, the reply information may also include the port number of the data communication port opened by the server. On this basis, if the data communication port opened by the server is also random in some encrypted connection modes, the present application can accurately identify the data communication port opened on the server by decrypting the reply information, thereby ensuring that the network intermediate device successfully implements the data connection proxy between the client and the server.

[0057] Optionally, for better explanation, the following description is based on the common FTP active mode and FTP passive mode, such as Figure 2 As shown in the figure, the connection process of FTP active mode is as follows:

[0058] Step S201: The client initially connects, and the FTP server command port (21) accepts any port of the client;

[0059] Step S202: The FTP server responds to the client command, and the FTP server command port (21) is sent to the client port (N>1023);

[0060] Step S203: The FTP server initializes data connection to the client data port, i.e., the FTP server data port (20) to the client port (N+1≥1024);

[0061] Step S204: The client sends an ACK packet to the data port of the FTP server, and the FTP server data port (20) receives the client port (N+1≥1024).

[0062] From the above content, it can be seen that in the FTP active mode, the client and the server need to negotiate a dynamic port, and then the server actively initiates a connection to the client. In this mode, since the port opened by the client is random, the network intermediate device cannot know which port the client has opened without parsing the data connection request sent by the client. At the same time, combined with the fact that the data connection request is already in an encrypted state, this application adopts the method of first decrypting the data connection request and then parsing and identifying the request information in the data connection request, which can accurately determine the port opened by the client, thereby realizing the successful proxy of the network intermediate device for the data connection between the client and the server in the FTP active mode.

[0063] Figure 3 A schematic diagram of an FTP passive mode connection process according to an embodiment of the present application is shown, as shown in FIG. Figure 3 As shown in the figure, the connection process between the server and the client in FTP passive mode is as follows:

[0064] Step S301: The client initially connects, and the FTP server command port (21) accepts any port of the client;

[0065] Step S302: The FTP server responds to the client command, and the FTP server command port (21) is sent to the client port (N>1023);

[0066] Step S303, the client initializes data connection to any port specified by the FTP server, and the FTP server data port (P>1023) accepts the client port (N+1≥1024);

[0067] Step S304, the FTP server sends an ACK response and data to the client's data port, FTP server data port (P>1023) to client port (N+1≥1024).

[0068] From the above content, it can be seen that in the FTP passive mode, although the port opened on the server is an arbitrary port, since the reply information in this application contains the port number of the data communication port opened by the server, in this application, the network intermediate device can obtain the port number of the data communication port opened by the server by decrypting and parsing the handshake message, so that in the FTP passive mode, the data connection proxy between the client and the server can be successfully implemented.

[0069] In an optional embodiment, before obtaining the data connection request sent by the client to the server and the handshake message generated by the server according to the data connection request, the network intermediate device will detect whether encrypted data can be transmitted between the client and the server. In the case that encrypted data can be transmitted between the client and the server, the network intermediate device obtains the first request sent by the client to the server, wherein the first request is used to represent that the client requests the server to transmit data in an encrypted mode, and the data transmitted between the client and the server in the encrypted mode is encrypted data. Subsequently, the network intermediate device controls the network intermediate device to establish initial connections with the client and the server respectively according to the first request, and obtains multiple control commands between the client and the server, wherein the control commands are encrypted commands, and the multiple control commands include at least a data connection request and a handshake message.

[0070] Optionally, the network intermediate device may obtain a plain text command transmitted between the client and the server, wherein the plain text command is an unencrypted command, and then the network intermediate device determines whether encrypted data can be transmitted between the client and the server according to the plain text command.

[0071] Specifically, when FTP SSL protection is enabled, there are two different initialization methods for SSL security extension: explicit security mode and implicit security mode. Figure 4 As shown in the figure, implicit security mode usually runs on port 990 of the server. In this mode, all data exchanges need to establish an SSL session between the client and the server, and the server will reject any connection attempt that does not use SSL. In other words, in implicit security mode, it is the default that encrypted data can be transmitted between the client and the server. After the server and the client complete the SSL handshake negotiation, the two can directly exchange FTP data based on SSL encryption on the specified port.

[0072] Figure 5 A schematic diagram of the interaction between the server and the client in explicit security mode is shown, Figure 5 As shown in the figure, in explicit security mode, the server can support both FTP and FTPS sessions. Before starting a session, the client usually accesses port 21 of the server. The client first establishes a plaintext connection with the server, and sends the AUTH TLS or AUTH SSL command before sending the user credentials to request the server to switch the command channel to the SSL encryption channel. After the channel is successfully established, the user credentials are sent to the FTP server, thereby ensuring that any command during the session can be automatically encrypted through the SSL channel. In other words, in explicit security mode, only after a plaintext connection is established first, will the client and server perform SSL handshake negotiation, and then complete the FTP data interaction based on SSL encryption.

[0073] Since the port of the server is fixed and well-known in the implicit security mode, the network intermediate device can directly determine the port of the server to be connected and the port of the client. However, for the explicit security mode, the client needs to first negotiate with the server in plain text on port 21, and then convert it into a ciphertext connection. Therefore, the network intermediate device in this application will detect in real time whether there is a plain text command transmitted between the client and the server. When the client sends a plain text command to the server to establish a plain text connection, the plain text connection will be TCP proxied by the network intermediate device. When the client and the server negotiate and confirm that both support SSL, the client will actively initiate an AUTH TLS request (corresponding to the first request mentioned above), expecting to switch to an SSL connection with the server. After the first request arrives at the network intermediate device, it will notify the SSL proxy module on the network intermediate device, and the network intermediate device is ready to start the SSL proxy function. After the network intermediate device starts the SSL proxy function, the network intermediate device conducts handshake negotiations with the client and the server respectively to establish an initial connection. At this point, the SSL control connection between the client and the server is successfully completed by the network intermediate device.

[0074] After the network middleware proxies the SSL control connection between the client and the server, it will obtain various control instructions transmitted between the client and the server, including encrypted data connection requests and handshake messages.

[0075] In an optional embodiment, the network intermediate device obtains the target encrypted data sent by the data communication port, and then forwards the target encrypted data sent by the data communication port to the service port.

[0076] Optionally, the above service port is a port opened on the server. When the client needs to upload file data to the server, the client will encrypt the file data into target encrypted data and send the target encrypted data through the opened data communication port. After the target encrypted data reaches the network intermediate device, the network intermediate device will forward the target encrypted data to the service port, thereby achieving the purpose of uploading the file data to the server.

[0077] In an optional embodiment, the network intermediate device obtains the target encrypted data sent by the service port, and then the network intermediate device forwards the target encrypted data sent by the service port to the data communication port.

[0078] Optionally, the service port is a port opened on the server. When the client needs to download file data from the server, the server will encrypt the file data into target encrypted data and send the target encrypted data through the opened data communication port. After the target encrypted data reaches the network intermediate device, the network intermediate device will forward the target encrypted data to the data communication port opened on the client, thereby achieving the purpose of downloading the file data from the server to the client.

[0079] In an optional embodiment, Figure 6 A flow chart of a data processing method based on FTP passive mode is shown, as Figure 6 As shown, the server is configured in passive mode, port 21 is the port for receiving FTP control connections, and a 5001 port is configured as the data port for receiving data connection requests. The client first performs the first SSL handshake negotiation with the server through the network intermediate device to establish an FTP control connection based on SSL encryption. When it is necessary to upload / download data files, the client performs the second SSL handshake negotiation with the server through the network intermediate device, and attempts to establish a data connection with the server's 5001 data port, which is then proxied and forwarded by the network intermediate device.

[0080] The following is the configuration of the network intermediate device proxy FTP:

[0081]

[0082]

[0083] From the above content, it can be seen that in passive mode, it is necessary to know in advance which data communication port is opened by the server. Therefore, in this mode, when connecting to the server, this application will decrypt and parse the handshake message to obtain the port number of the data communication port opened by the server contained in the reply information, thereby realizing the data connection proxy between the client and the server in the FTP passive mode, and then obtaining the target encrypted data transmitted between the client and the server.

[0084] In an optional embodiment, Figure 7 A schematic diagram of a data processing method based on FTP active mode and explicit security mode is shown, as Figure 7 As shown, the following steps are included:

[0085] Step S701: In the initial state, the client will initiate access to port 21 of the server by default and establish a plain text connection, which is proxied by the TCP proxy of the network intermediate device;

[0086] Step S702, when the client and the server both negotiate and confirm that they both support SSL, the client will actively initiate an AUTH TLS request, hoping to switch to an SSL connection with the server. After the request reaches the network intermediate device, it will notify the SSL proxy module on the network intermediate device to prepare to enable the SSL proxy function;

[0087] Step S703: The client performs SSL handshake negotiation with the network intermediate device, and the network intermediate device performs SSL handshake negotiation with the server at the same time;

[0088] Step S704, the SSL control connection between the client and the server is proxied by the network intermediate device;

[0089] Step S705, when the client uploads or downloads file data, it sends a data connection request, and the data connection request at least includes the first port number opened by the client and the network address of the client;

[0090] Step S706: After the data connection request arrives at the network intermediate device, the network intermediate device decrypts and parses the data connection request, identifies the first port number and the network address of the client, and sends them to the ALG identification module for buffering;

[0091] Step S707, after the server receives the data connection request, the server will actively initiate a connection to the client and attempt an SSL handshake. After the handshake message reaches the network intermediate device, the network intermediate device extracts the destination network address and the second port number in the handshake message, and matches them with the network address and the first port number cached in the ALG (application layer gateway) identification module. After a successful match, the SSL proxy will be used for the traffic, and the traffic initiator is recorded as the server at this time.

[0092] Step S708, the network intermediate device establishes SSL connections with the client and the server respectively, to realize the data connection between the proxy client and the server;

[0093] Step S709: Each time the network intermediate device forwards the target encrypted data, it will decrypt the target encrypted data and send it to the application layer for inspection, and audit, inspect and filter the traffic in the application layer inspection module.

[0094] Among them, Figure 7 In the figure, the dotted line represents plaintext transmission, and the solid line represents ciphertext transmission.

[0095] As can be seen from the above content, the present application provides a complete proxy solution, which, combined with the ALG (application layer gateway) function, can fully proxy the FTP / FTPS protocol, adapt to the FTP active / passive working mode, be compatible with the implicit / explicit security mode, and after the proxy is successful, perform data decryption, perform application layer security checks, and implement security detection such as auditing, filtering and monitoring of FTPS encrypted traffic. The technical solution in the present application is suitable for scenarios where it is expected to proxy and monitor FTPS traffic, for example, scenarios where it is expected to provide protection for the FTPS server and the intranet where the FTPS server is located, and scenarios where FTPS encrypted traffic is viewed to prevent malicious users from uploading malicious files or attacking the FTPS server.

[0096] In an optional embodiment, Figure 8 FIG. 4 shows an optional single message processing flow chart according to an embodiment of the present application. Figure 8 As shown, the network intermediate device includes a user-mode network card driver module, an ALG identification module, a user-mode TCP proxy module, an SSL proxy module, and an APP stream check module (abnormal information detection module). Among them, the user-mode network card driver module is responsible for sending and receiving data connection requests and handshake messages, the ALG module is responsible for identifying the FTPS data connection stream of interest (corresponding to the target encrypted data), the user-mode TCP module implements the TCP connection proxy between the client and the server, the SSL proxy module is responsible for proxying all SSL connections between the client and the server, and can be used as an SSL proxy and decrypted regardless of whether the traffic is initiated by the client or the server first, and the APP stream check module is responsible for checking, auditing, and filtering the decrypted data.

[0097] From the above content, it can be seen that this application can perform SSL full-process proxy for FTPS traffic, whether it is FTP plaintext control traffic, FTPS ciphertext control traffic, or FTPS ciphertext data traffic. This application can adapt to the working mode of the server. After the proxy is turned on, there is no need to make any configuration changes to the server. The client user cannot perceive that the FTPS connection is proxied. By decrypting the FTPS traffic, the originally decrypted user traffic can be audited, checked and filtered in time, which can provide protection for the server.

[0098] Example 2

[0099] According to an embodiment of the present application, a data processing device embodiment is also provided, wherein: Fig. 9 is a schematic diagram of an optional data processing device according to an embodiment of the present application, such as Fig. 9 As shown, the device includes: a first acquisition module 901, a decryption module 902 and a second acquisition module 903.

[0100] It should be noted that the data processing device in the embodiment of the present application can run on network intermediate devices including but not limited to firewalls. The network intermediate devices are usually deployed between the client and the server and provide proxy services for the client and the server.

[0101] Among them, the first acquisition module 901 is used to obtain the data connection request sent by the client to the server and the handshake message generated by the server according to the data connection request, wherein the data connection request at least includes request information, and the request information includes at least a first port number, and the first port number is the port number of the data communication port opened by the client; the handshake message includes at least reply information, and the reply information includes at least a second port number, and the second port number is the port number identified by the server by parsing the data connection request, and the data connection request and the handshake message are in an encrypted state.

[0102] Specifically, the client may be an FTP client, and the server may be an FTPS server. An encrypted connection may be established between the server and the client via the FTPS protocol. FTPS is also known as "FTP-SSL" and "FTP-over-SSL". SSL is a protocol for encrypting and decrypting data in a secure connection between a client and a server with SSL functionality.

[0103] When the network intermediate device has successfully proxied the control connection between the client and the server, when the client needs to upload files to the server or download files from the server, the client will send a data connection request to the server in the hope of establishing a data connection between the server and the server, wherein the data connection request includes at least the first port number and the client's network address and other request information. It should be noted that the first port number can be the port number of the data communication port randomly opened by the client. In other words, the data communication port opened by the client can be random, so in actual applications, the first port number can also be dynamically changed.

[0104] In addition, after the server receives the data connection request, the server will parse the data connection request and identify the second port number, which can be understood as the port number of the data communication port opened by the client, which is determined by the server through its own identification mechanism. In addition to the second port number, the server will also identify the target network address by parsing the data connection request, which can be the network address of the client, which is determined by the server through its own identification mechanism.

[0105] The decryption module 902 is used to decrypt the data connection request and the handshake message, and detect whether the request information matches the reply information.

[0106] Specifically, since the network intermediate device has successfully proxied the control connection between the client and the server, the data connection request sent by the client will reach the network intermediate device. After receiving the data connection request, the network intermediate device will decrypt the data connection request, and then parse out the first port number, the client's network address and other request information in the data connection request, and send the request information to the ALG (application layer gateway) identification module for cache. After the server receives the data connection request, the server will actively initiate a connection to the client and attempt to perform an SSL handshake with the client. After the handshake message reaches the network intermediate device, the network intermediate device will decrypt the handshake message, and then extract the second port number, target network address and other reply information from the handshake message.

[0107] Furthermore, the network intermediate device will match the second port number with the first port number cached in the ALG identification module, and match the target network address with the network address cached in the ALG identification module. When both are successfully matched, it means that the server has correctly identified the client's data connection request. At this time, the network intermediate device can perform SSL proxy on the traffic corresponding to the data connection request, and record that the initiator of the traffic at this time is the server.

[0108] It should be noted that when the client and the server communicate based on the FTPS protocol, the data connection request sent by the client to the server is encrypted, and the data connection request will contain information such as the port number of the data communication port opened by the client. However, in some modes, the data communication port opened by the client is random. In this case, since the data connection request is encrypted, network intermediate devices such as firewalls cannot know which data communication port the client randomly opens, which makes it impossible for network intermediate devices to connect to the client and the server, and cannot obtain the encrypted data transmitted between the client and the server.

[0109] In the present application, after receiving the data connection request, the network intermediate device will decrypt the data connection request, and then accurately identify the port number of the data communication port opened by the client based on the request information obtained after decryption. On this basis, even if the data communication port opened on the client is random, the present application can still obtain the port number of the data communication port in the decrypted state, thereby ensuring that the network intermediate device accurately connects to the client and the server, and realizes the data connection proxy for the client and the server.

[0110] The second acquisition module 903 is used to control the network intermediate device to connect to the client and the server respectively according to the reply information when the reply information matches the request information, and obtain the target encrypted data transmitted between the client and the server.

[0111] Specifically, the network intermediate device will detect whether the network address is the same as the target network address, and whether the first port number is the same as the second port number. When the network address is the same as the target network address, and the first port number is the same as the second port number, the network intermediate device determines that the reply information matches the request information, and generates a first detection result, wherein the first detection result indicates that the server correctly identifies the client's request information; when the network address is different from the target network address, or the first port number is different from the second port number, the network intermediate device determines that the reply information does not match the request information, and generates a second detection result, wherein the second detection result indicates that the server incorrectly identifies the client's request information.

[0112] Through the above matching process, it can be ensured that only after the server accurately identifies the client's request information, the network intermediate device will establish data proxy connections with the client and the server respectively, thereby avoiding the problem of network intermediate device proxy failure.

[0113] In addition, the above-mentioned target encrypted data can be data that the client wants to upload to the server, or data that the client wants to download from the server, and all of these data are in an encrypted state.

[0114] In an optional embodiment, after obtaining the target encrypted data transmitted between the client and the server, the network intermediate device will decrypt the target encrypted data to obtain the decrypted data to be detected, and then the network intermediate device will detect whether there is abnormal information in the data to be detected and generate a detection result, wherein the abnormal information at least includes program information that maliciously attacks the server or the client.

[0115] It should be noted that as more and more clients and servers enable SSL protection, the network intermediate devices between the client and the server cannot effectively monitor, inspect, filter and count the application layer content carried by SSL. As a result, more and more malicious attack programs transmit sensitive files or virus files through FTPS encryption, resulting in user privacy leakage or FTPS server intranet attacks.

[0116] In the present application, by decrypting the acquired target encrypted data, the decrypted user traffic (corresponding to the above-mentioned data to be detected) can be audited, checked and filtered in a timely manner, so as to identify abnormal information in the data to be detected and improve the data transmission security between the client and the server. Among them, the above-mentioned network intermediate device can be a network security device such as a network firewall, and the above-mentioned abnormal information can be user sensitive information, such as company confidential data, user privacy data, and the abnormal information can also be program information that maliciously attacks the server or client, such as a script carrying a virus program.

[0117] It can be seen from the above content that after obtaining the data connection request and handshake message in an encrypted state, the present application will first decrypt them, thereby obtaining the request information in the data connection request and the reply information in the handshake message. Furthermore, since the request information at least contains the first port number of the data communication port opened by the client, and the reply information contains the second port number, therefore, no matter which port the data communication port opened by the client is, the network intermediate device can determine the port in the decrypted state, thereby successfully connecting the client and the server, and then obtaining the target encrypted data between the client and the server, that is, achieving the purpose of the network intermediate device acting as a proxy for the data connection between the client and the server, and solving the problem in the prior art that the network intermediate device cannot obtain the encrypted data transmitted between the client and the server because the data connection request initiated by the client to the server is in an encrypted state.

[0118] It can be seen that through the technical solution of the present application, the purpose of having the network intermediate device proxy the data connection between the client and the server is achieved, thereby ensuring that the network intermediate device accurately identifies the data communication port opened by the client in any scenario, thereby solving the technical problem of low acquisition efficiency of the network intermediate device in the prior art when acquiring encrypted data transmitted between the client and the server.

[0119] In addition, in an optional embodiment, the reply information may also include the port number of the data communication port opened by the server. On this basis, if the data communication port opened by the server is also random in some encrypted connection modes, the present application can accurately identify the data communication port opened on the server by decrypting the reply information, thereby ensuring that the network intermediate device successfully implements the data connection proxy between the client and the server.

[0120] Optionally, for better explanation, the following description is based on the common FTP active mode and FTP passive mode, such as Figure 2 As shown in the figure, the connection process of FTP active mode is as follows:

[0121] Step S201: The client initially connects, and the FTP server command port (21) accepts any port of the client;

[0122] Step S202: The FTP server responds to the client command, and the FTP server command port (21) is sent to the client port (N>1023);

[0123] Step S203: The FTP server initializes data connection to the client data port, i.e., the FTP server data port (20) to the client port (N+1≥1024);

[0124] Step S204: The client sends an ACK packet to the data port of the FTP server, and the FTP server data port (20) receives the client port (N+1≥1024).

[0125] From the above content, it can be seen that in the FTP active mode, the client and the server need to negotiate a dynamic port, and then the server actively initiates a connection to the client. In this mode, since the port opened by the client is random, the network intermediate device cannot know which port the client has opened without parsing the data connection request sent by the client. At the same time, combined with the fact that the data connection request is already in an encrypted state, this application adopts the method of first decrypting the data connection request and then parsing and identifying the request information in the data connection request, which can accurately determine the port opened by the client, thereby realizing the successful proxy of the network intermediate device for the data connection between the client and the server in the FTP active mode.

[0126] Figure 3 A schematic diagram of an FTP passive mode connection process according to an embodiment of the present application is shown, as shown in FIG. Figure 3 As shown in the figure, the connection process between the server and the client in FTP passive mode is as follows:

[0127] Step S301: The client initially connects, and the FTP server command port (21) accepts any port of the client;

[0128] Step S302: The FTP server responds to the client command, and the FTP server command port (21) is sent to the client port (N>1023);

[0129] Step S303, the client initializes data connection to any port specified by the FTP server, and the FTP server data port (P>1023) accepts the client port (N+1≥1024);

[0130] Step S304, the FTP server sends an ACK response and data to the client's data port, FTP server data port (P>1023) to client port (N+1≥1024).

[0131] From the above content, it can be seen that in the FTP passive mode, although the port opened on the server is an arbitrary port, since the reply information in this application contains the port number of the data communication port opened by the server, in this application, the network intermediate device can obtain the port number of the data communication port opened by the server by decrypting and parsing the handshake message, so that in the FTP passive mode, the data connection proxy between the client and the server can be successfully implemented.

[0132] Optionally, the data processing device further includes: a detection module, a third acquisition module and a fourth acquisition module. The detection module is used to detect whether encrypted data can be transmitted between the client and the server; the third acquisition module is used to acquire a first request sent by the client to the server when encrypted data can be transmitted between the client and the server, wherein the first request is used to represent that the client requests the server to transmit data in an encrypted mode, and the data transmitted between the client and the server in the encrypted mode is encrypted data; the fourth acquisition module is used to control the network intermediate device to establish an initial connection with the client and the server respectively according to the first request, and acquire multiple control commands between the client and the server, wherein the control command is an encrypted command, and the multiple control commands include at least the data connection request and the handshake message.

[0133] Optionally, the detection module includes: a first acquisition unit and a first determination unit. The first acquisition unit is used to acquire a plain text command transmitted between the client and the server; the first determination unit is used to determine whether encrypted data can be transmitted between the client and the server according to the plain text command.

[0134] Specifically, when FTP SSL protection is enabled, there are two different initialization methods for SSL security extension: explicit security mode and implicit security mode. Figure 4 As shown in the figure, implicit security mode usually runs on port 990 of the server. In this mode, all data exchanges need to establish an SSL session between the client and the server, and the server will reject any connection attempt that does not use SSL. In other words, in implicit security mode, it is the default that encrypted data can be transmitted between the client and the server. After the server and the client complete the SSL handshake negotiation, the two can directly exchange FTP data based on SSL encryption on the specified port.

[0135] Figure 5 A schematic diagram of the interaction between the server and the client in explicit security mode is shown, Figure 5As shown in the figure, in explicit security mode, the server can support both FTP and FTPS sessions. Before starting a session, the client usually accesses port 21 of the server. The client first establishes a plaintext connection with the server, and sends the AUTH TLS or AUTH SSL command before sending the user credentials to request the server to switch the command channel to the SSL encryption channel. After the channel is successfully established, the user credentials are sent to the FTP server, thereby ensuring that any command during the session can be automatically encrypted through the SSL channel. In other words, in explicit security mode, only after a plaintext connection is established first, will the client and server perform SSL handshake negotiation, and then complete the FTP data interaction based on SSL encryption.

[0136] Since the port of the server is fixed and well-known in the implicit security mode, the network intermediate device can directly determine the port of the server to be connected and the port of the client. However, for the explicit security mode, the client needs to first negotiate with the server in plain text on port 21, and then convert it into a ciphertext connection. Therefore, the network intermediate device in this application will detect in real time whether there is a plain text command transmitted between the client and the server. When the client sends a plain text command to the server to establish a plain text connection, the plain text connection will be TCP proxied by the network intermediate device. When the client and the server negotiate and confirm that both support SSL, the client will actively initiate an AUTH TLS request (corresponding to the first request mentioned above), expecting to switch to an SSL connection with the server. After the first request arrives at the network intermediate device, it will notify the SSL proxy module on the network intermediate device, and the network intermediate device is ready to start the SSL proxy function. After the network intermediate device starts the SSL proxy function, the network intermediate device conducts handshake negotiations with the client and the server respectively to establish an initial connection. At this point, the SSL control connection between the client and the server is successfully completed by the network intermediate device.

[0137] After the network middleware proxies the SSL control connection between the client and the server, it will obtain various control instructions transmitted between the client and the server, including encrypted data connection requests and handshake messages.

[0138] Optionally, the request information also includes at least the network address of the client, and the reply information also includes at least the target network address identified by the server by parsing the data connection request. The decryption module also includes: a first detection unit, a second determination unit, and a third determination unit. The first detection unit is used to detect whether the network address is the same as the target network address, and whether the first port number is the same as the second port number; the second determination unit is used to determine that the reply information matches the request information when the network address is the same as the target network address and the first port number is the same as the second port number, and generate a first detection result, wherein the first detection result indicates that the server correctly identifies the request information of the client; the third determination unit is used to determine that the reply information does not match the request information when the network address is different from the target network address, or the first port number is different from the second port number, and generate a second detection result, wherein the second detection result indicates that the server incorrectly identifies the request information of the client.

[0139] Optionally, the second acquisition module further includes: a second acquisition unit and a first forwarding unit. The second acquisition unit is used to acquire the target encrypted data sent by the service port, wherein the service port is a port opened on the server; and the forwarding unit is used to forward the target encrypted data sent by the service port to the data communication port.

[0140] Optionally, the above service port is a port opened on the server. When the client needs to upload file data to the server, the client will encrypt the file data into target encrypted data and send the target encrypted data through the opened data communication port. After the target encrypted data reaches the network intermediate device, the network intermediate device will forward the target encrypted data to the service port, thereby achieving the purpose of uploading the file data to the server.

[0141] Optionally, the second acquisition module further includes: a third acquisition unit and a second forwarding unit. The seventh acquisition module is used to acquire the target encrypted data sent by the data communication port; the first forwarding module is used to forward the target encrypted data sent by the data communication port to the service port.

[0142] Optionally, the service port is a port opened on the server. When the client needs to download file data from the server, the server will encrypt the file data into target encrypted data and send the target encrypted data through the opened data communication port. After the target encrypted data reaches the network intermediate device, the network intermediate device will forward the target encrypted data to the data communication port opened on the client, thereby achieving the purpose of downloading the file data from the server to the client.

[0143] Optionally, the data processing device further includes: a first decryption module and a first detection module. The first decryption module is used to decrypt the target encrypted data to obtain the decrypted data to be detected; the first detection module is used to detect whether there is abnormal information in the data to be detected and generate a detection result, wherein the abnormal information at least includes program information that maliciously attacks the server or the client.

[0144] In an optional embodiment, Figure 6 A flow chart of a data processing method based on FTP passive mode is shown, as Figure 6 As shown, the server is configured in passive mode, port 21 is the port for receiving FTP control connections, and a 5001 port is configured as the data port for receiving data connection requests. The client first performs the first SSL handshake negotiation with the server through the network intermediate device to establish an FTP control connection based on SSL encryption. When it is necessary to upload / download data files, the client performs the second SSL handshake negotiation with the server through the network intermediate device, and attempts to establish a data connection with the server's 5001 data port, which is then proxied and forwarded by the network intermediate device.

[0145] The following is the configuration of the network intermediate device proxy FTP:

[0146]

[0147]

[0148] From the above content, it can be seen that in passive mode, it is necessary to know in advance which data communication port is opened by the server. Therefore, in this mode, when connecting to the server, this application will decrypt and parse the handshake message to obtain the port number of the data communication port opened by the server contained in the reply information, thereby realizing the data connection proxy between the client and the server in the FTP passive mode, and then obtaining the target encrypted data transmitted between the client and the server.

[0149] In an optional embodiment, Figure 7 A schematic diagram of a data processing method based on FTP active mode and explicit security mode is shown, as Figure 7 As shown, the following steps are included:

[0150] Step S701: In the initial state, the client will initiate access to port 21 of the server by default and establish a plain text connection, which is proxied by the TCP proxy of the network intermediate device;

[0151] Step S702, when the client and the server both negotiate and confirm that they both support SSL, the client will actively initiate an AUTH TLS request, hoping to switch to an SSL connection with the server. After the request reaches the network intermediate device, it will notify the SSL proxy module on the network intermediate device to prepare to enable the SSL proxy function;

[0152] Step S703: The client performs SSL handshake negotiation with the network intermediate device, and the network intermediate device performs SSL handshake negotiation with the server at the same time;

[0153] Step S704, the SSL control connection between the client and the server is proxied by the network intermediate device;

[0154] Step S705, when the client uploads or downloads file data, it sends a data connection request, and the data connection request at least includes the first port number opened by the client and the network address of the client;

[0155] Step S706: After the data connection request arrives at the network intermediate device, the network intermediate device decrypts and parses the data connection request, identifies the first port number and the network address of the client, and sends them to the ALG identification module for buffering;

[0156] Step S707, after the server receives the data connection request, the server will actively initiate a connection to the client and attempt an SSL handshake. After the handshake message reaches the network intermediate device, the network intermediate device extracts the destination network address and the second port number in the handshake message, and matches them with the network address and the first port number cached in the ALG (application layer gateway) identification module. After a successful match, the SSL proxy will be used for the traffic, and the traffic initiator is recorded as the server at this time.

[0157] Step S708, the network intermediate device establishes SSL connections with the client and the server respectively, to realize the data connection between the proxy client and the server;

[0158] Step S709: Each time the network intermediate device forwards the target encrypted data, it will decrypt the target encrypted data and send it to the application layer for inspection, and audit, inspect and filter the traffic in the application layer inspection module.

[0159] Among them, Figure 7 In the figure, the dotted line represents plaintext transmission, and the solid line represents ciphertext transmission.

[0160] As can be seen from the above content, the present application provides a complete proxy solution, which, combined with the ALG (application layer gateway) function, can fully proxy the FTP / FTPS protocol, adapt to the FTP active / passive working mode, be compatible with the implicit / explicit security mode, and after the proxy is successful, perform data decryption, perform application layer security checks, and implement security detection such as auditing, filtering and monitoring of FTPS encrypted traffic. The technical solution in the present application is suitable for scenarios where it is expected to proxy and monitor FTPS traffic, for example, scenarios where it is expected to provide protection for the FTPS server and the intranet where the FTPS server is located, and scenarios where FTPS encrypted traffic is viewed to prevent malicious users from uploading malicious files or attacking the FTPS server.

[0161] In an optional embodiment, Figure 8 FIG. 4 shows an optional single message processing flow chart according to an embodiment of the present application. Figure 8 As shown, the network intermediate device includes a user-mode network card driver module, an ALG identification module, a user-mode TCP proxy module, an SSL proxy module, and an APP stream check module (abnormal information detection module). Among them, the user-mode network card driver module is responsible for sending and receiving data connection requests and handshake messages, the ALG module is responsible for identifying the FTPS data connection stream of interest (corresponding to the target encrypted data), the user-mode TCP module implements the TCP connection proxy between the client and the server, the SSL proxy module is responsible for proxying all SSL connections between the client and the server, and can be used as an SSL proxy and decrypted regardless of whether the traffic is initiated by the client or the server first, and the APP stream check module is responsible for checking, auditing, and filtering the decrypted data.

[0162] From the above content, it can be seen that this application can perform SSL full-process proxy for FTPS traffic, whether it is FTP plaintext control traffic, FTPS ciphertext control traffic, or FTPS ciphertext data traffic. This application can adapt to the working mode of the server. After the proxy is turned on, there is no need to make any configuration changes to the server. The client user cannot perceive that the FTPS connection is proxied. By decrypting the FTPS traffic, the originally decrypted user traffic can be audited, checked and filtered in time, which can provide protection for the server.

[0163] Example 3

[0164] According to another aspect of an embodiment of the present application, a computer-readable storage medium is further provided, in which a computer program is stored, wherein the computer program is configured to execute the data processing method in the above-mentioned embodiment 1 when running.

[0165] Example 4

[0166] According to another aspect of an embodiment of the present application, an electronic device is also provided, which includes one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by one or more processors, the one or more processors are implemented to run the programs, wherein the programs are configured to execute the data processing method in the above-mentioned embodiment 1 when running.

[0167] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0168] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0169] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0170] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0171] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0172] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.

[0173] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A data processing method, It is characterized in that include: Before the network intermediate device successfully proxies the data connection between the client and the server, obtain a data connection request sent by the client to the server and a handshake message generated by the server according to the data connection request, wherein the data connection request includes at least request information, and the request information includes at least the network address and the first port number of the client, and the first port number is the port number of the data communication port randomly opened by the client; the handshake message includes at least reply information, and the reply information includes at least the target network address and the second port number identified by the server through parsing the data connection request, and the second port number is the port number identified by the server through parsing the data connection request, and the data connection request and the handshake message are in an encrypted state, and the reply information also includes the port number of the data communication port randomly opened by the server; Decrypting the data connection request and the handshake message, and detecting whether the request information matches the reply information; When the reply information matches the request information, controlling the network intermediate device to connect to the client and the server respectively according to the reply information, and obtaining the target encrypted data transmitted between the client and the server; Wherein, detecting whether the reply information matches the request information includes: Detecting whether the network address is the same as the target network address, and whether the first port number is the same as the second port number; In the case where the network address is the same as the target network address, and the first port number is the same as the second port number, determining that the reply information matches the request information, and generating a first detection result, wherein the first detection result is used to indicate that the server correctly identifies the request information of the client; When the network address is different from the target network address, or the first port number is different from the second port number, it is determined that the reply information does not match the request information, and a second detection result is generated, wherein the second detection result is used to characterize that the server incorrectly identifies the request information of the client.

2. The method according to claim 1, It is characterized in that Before obtaining the data connection request sent by the client to the server and the handshake message generated by the server according to the data connection request, the method further includes: Detecting whether encrypted data can be transmitted between the client and the server; In a case where encrypted data can be transmitted between the client and the server, obtaining a first request sent by the client to the server, wherein the first request is used to indicate that the client requests the server to perform data transmission in an encrypted mode, and the data transmitted between the client and the server in the encrypted mode is encrypted data; According to the first request, the network intermediate device is controlled to establish initial connections with the client and the server respectively, and a control command between the client and the server is obtained, wherein the control command is an encrypted command and the control command includes at least the data connection request and the handshake message.

3. The method according to claim 2, It is characterized in that Detecting whether encrypted data can be transmitted between the client and the server includes: Obtaining plaintext commands transmitted between the client and the server; Determine whether encrypted data can be transmitted between the client and the server according to the plain text command.

4. The method according to any one of claims 1 to 3, It is characterized in that Acquiring target encrypted data transmitted between the client and the server, including: Obtaining target encrypted data sent by a service port, wherein the service port is a port opened on the server; The target encrypted data sent by the service port is forwarded to the data communication port.

5. The method according to any one of claims 1 to 4, It is characterized in that Acquiring target encrypted data transmitted between the client and the server, including: Obtaining target encrypted data sent by the data communication port; The target encrypted data sent by the data communication port is forwarded to the service port.

6. The method according to claim 1, It is characterized in that After obtaining the target encrypted data transmitted between the client and the server, the method further includes: Decrypting the target encrypted data to obtain decrypted data to be detected; Detect whether there is abnormal information in the data to be detected, and generate a detection result, wherein the abnormal information at least includes program information that maliciously attacks the server or the client.

7. A data processing device, It is characterized in that include: A first acquisition module is used to acquire, before the network intermediate device successfully proxies the data connection between the client and the server, a data connection request sent by the client to the server and a handshake message generated by the server according to the data connection request, wherein the data connection request includes at least request information, and the request information includes at least the network address and the first port number of the client, and the first port number is the port number of the data communication port opened by the client; the handshake message includes at least reply information, and the reply information includes at least the target network address and the second port number identified by the server through parsing the data connection request, and the second port number is the port number identified by the server through parsing the data connection request, and the data connection request and the handshake message are in an encrypted state, and the reply information also includes the port number of the data communication port randomly opened by the server; A decryption module, used to decrypt the data connection request and the handshake message, and detect whether the request information matches the reply information; A second acquisition module, configured to control the network intermediate device to connect to the client and the server respectively according to the reply information when the reply information matches the request information, and to acquire the target encrypted data transmitted between the client and the server; Wherein, the decryption module includes: a first detection unit, used to detect whether the network address is the same as the target network address, and whether the first port number is the same as the second port number; a second determination unit, used to determine that the reply information matches the request information when the network address is the same as the target network address and the first port number is the same as the second port number, and generate a first detection result, wherein the first detection result is used to characterize that the server correctly identifies the request information of the client; a third determination unit, used to determine that the reply information does not match the request information when the network address is different from the target network address, or the first port number is different from the second port number, and generate a second detection result, wherein the second detection result is used to characterize that the server incorrectly identifies the request information of the client.

8. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, wherein the computer program is configured to execute the data processing method described in any one of claims 1 to 6 when running.

9. An electronic device, It is characterized in that The electronic device comprises one or more processors; a storage device for storing one or more programs, which, when executed by the one or more processors, enables the one or more processors to run the programs, wherein the programs are configured to execute the data processing method described in any one of claims 1 to 6 when run.

Citation Information

Patent Citations

  • Network enciphered data virus detection and elimination system and proxy server and method

    CN101141244A

  • Multi-core parallel reverse proxy method

    CN106210058A