A TCP proxy method and device for UDP knocking service

By deploying a knocking proxy server in a zero-trust architecture, listening on TCP ports and implementing a keep-alive mechanism, the UDP packet loss problem is solved, stable TCP connections and two-way authentication are achieved, ensuring the reliability and concealment of knocking requests.

CN116455669BActive Publication Date: 2026-11-17HUZHOU XISE DIGITAL SECURITY RES INST
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310518359.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-09
Publication Date
2026-11-17
Estimated Expiration
2043-05-09

AI Technical Summary

Technical Problem

In the existing zero-trust technology architecture, UDP protocol knocking requests are susceptible to packet loss due to network problems, resulting in knocking failure and affecting access retry time.

Method used

By deploying a knock-on proxy server, listening on a TCP port, enabling a keep-alive mechanism to maintain the TCP connection, sending encapsulated payloads using UDP sockets, and waiting for a response within a preset time, the connection is terminated if no response is received, and if a response is received, the response packet is transferred to the TCP connection. Furthermore, HMAC fields and timestamps are introduced for two-way verification.

Benefits of technology

In environments where UDP transmission is unreliable, a stable TCP connection is provided to avoid UDP packet loss, protect the stealth and performance of the knock-on verification server, and ensure communication reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116455669B_ABST
    Figure CN116455669B_ABST
Patent Text Reader

Abstract

A TCP proxy method and apparatus for a UDP knocking service involves a knocking proxy server listening on a specified TCP port. When a TCP knocking request packet from a knocking request object arrives, the knocking proxy server obtains the TCP payload of the request packet. The knocking proxy server then uses a UDP socket to send the raw payload encapsulated in UDP to a knocking verification server. The knocking proxy server waits for a response from the knocking verification server on the current UDP socket. If the knocking verification server does not respond within a preset time, the knocking proxy server terminates the TCP connection of the current knocking session. If the knocking verification server responds within the preset time, the knocking response packet received from the UDP channel is transferred to the TCP connection and returned to the knocking request object. After the knocking response packet is successfully sent, the TCP connection of the current knocking session is terminated. This invention solves the knocking failure problem caused by UDP packet loss in existing knocking verification services in practical application scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of communication processing technology, specifically relating to a TCP proxy method and apparatus for UDP knocking service. Background Technology

[0002] Zero Trust represents a new generation of cybersecurity protection concepts. Its key lies in breaking the default "trust" and not trusting any person, device, or system inside or outside the enterprise network by default. It rebuilds the trust foundation of access control based on identity authentication and authorization, thereby ensuring that identities, devices, applications, and links are trustworthy.

[0003] Currently, existing zero-trust technology architectures typically use the UDP protocol to make knocking requests, thus achieving the invisibility of network services. Only the requesting party that is legally authorized when knocking can truly access the invisible network service.

[0004] In existing technical solutions, the door-knock verification server only accepts UDP packets. Due to the various complexities of network infrastructure, UDP traffic is susceptible to packet loss, which can cause door-knock requests to fail to reach the verification server, increasing application retry time. Therefore, finding a way to avoid UDP packet loss due to network issues while still protecting the door-knock verification server's own anonymity and overall performance is of practical application significance. Summary of the Invention

[0005] To address this issue, the present invention provides a TCP proxy method and apparatus for UDP knocking services, which solves the problem of knocking failure caused by UDP packet loss in practical application scenarios of existing knocking verification services.

[0006] To achieve the above objectives, the present invention provides the following technical solution: a TCP proxy method for UDP knocking service, comprising:

[0007] The knocking proxy server listens on a specified TCP port. When the TCP knocking request packet of the knocking request object arrives, the knocking proxy server obtains the TCP payload of the knocking request packet. At the same time, the knocking proxy server enables a keep-alive mechanism to maintain the establishment of the TCP connection.

[0008] The knocking proxy server enables a UDP socket to send the raw payload encapsulated in UDP to the knocking verification server, and the knocking proxy server waits for the response from the knocking verification server on the current UDP socket;

[0009] If the door-knocking verification server does not respond within a preset time, the door-knocking proxy server will interrupt the TCP connection of the current door-knocking session;

[0010] If the door-knocking verification server responds within a preset time, the door-knocking proxy server will transfer the door-knocking response packet received from the UDP channel to a TCP connection and return it to the door-knocking request object. After the door-knocking response packet is successfully sent, the door-knocking proxy server will interrupt the TCP connection of the current door-knocking session.

[0011] As a preferred TCP proxy method for UDP knocking service, the knocking proxy server does not participate in the encryption and decryption of the knocking request packet, and is responsible for forwarding the knocking request packet;

[0012] The knock request packet and the knock response packet follow a point-to-point two-way authentication encrypted communication and identity verification.

[0013] As a preferred TCP proxy method for UDP knocking services, the knocking request packet incorporates an HMAC field, and the knocking verification server performs first-level verification on the knocking request packet.

[0014] When the knocking request object sends the knocking request packet, it calculates and fills in the MAC. The knocking verification server hashes the packet header data using the same algorithm and verifies the HMAC field of the knocking request packet. If the HMAC does not match, the knocking request packet is discarded directly.

[0015] As a preferred TCP proxy method for UDP knocking service, after the knocking verification server successfully performs first-level verification on the knocking request packet, the knocking verification server parses the timestamp of the knocking request packet for second-level verification.

[0016] If the timestamp of the knock request packet cannot be parsed, the knock request packet is discarded.

[0017] If the timestamp is earlier than the time when the knock request packet was last received, the knock request packet is determined to be a replay attack, and the knock request packet is discarded directly.

[0018] As a preferred TCP proxy method for UDP knocking service, if the timestamp is within a predetermined range from the time of the last knocking request packet, the knocking request packet is determined to be a flooding attack and the knocking request packet is directly discarded.

[0019] As a preferred TCP proxy method for UDP knocking service, when the knocking verification server verifies the knocking request packet, the knocking verification server notifies the gateway to allow the knocking request object to access application resources from the application server.

[0020] The present invention also provides a TCP proxy device for UDP knocking service, comprising:

[0021] The TCP port listening module is used to listen on a specified TCP port through a knocking proxy server.

[0022] The knocking request processing module is used to obtain the TCP payload of the knocking request packet when the TCP knocking request packet of the knocking request object arrives, and at the same time, the knocking proxy server enables the keep-alive mechanism to maintain the establishment of the TCP connection.

[0023] The door-knocking data forwarding module is used by the door-knocking proxy server to send the raw payload encapsulated in UDP to the door-knocking verification server via a UDP socket.

[0024] The knocking response waiting module is used by the knocking proxy server to wait for the response from the knocking verification server on the current UDP socket;

[0025] The response failure handling module is used so that if the door knocking verification server does not respond within a preset time, the door knocking proxy server will interrupt the TCP connection of the current door knocking session.

[0026] The successful response processing module is used to transfer the knock response packet received from the UDP channel to the knock request object in a TCP connection if the knock verification server responds within a preset time. After the knock response packet is successfully sent, the knock proxy server interrupts the TCP connection of the current knock session.

[0027] As a preferred solution for the TCP proxy device in the UDP knocking service, the knocking proxy server does not participate in the encryption and decryption of the knocking request packet, and the knocking proxy server is responsible for forwarding the knocking request packet;

[0028] The knock request packet and the knock response packet follow a point-to-point two-way authentication encrypted communication and identity verification.

[0029] As a preferred solution for the TCP proxy device in the UDP knocking service, it also includes a first-level verification module, used by the knocking verification server to perform first-level verification on the knocking request packet:

[0030] The knock request packet introduces an HMAC field. When the knock request object sends the knock request packet, it calculates and fills in the MAC. The knock verification server hashes the packet header data using the same algorithm and verifies the HMAC field of the knock request packet. If the HMAC does not match, the knock request packet is discarded directly.

[0031] It also includes a secondary verification module, which is used by the door knocking verification server to parse the timestamp of the door knocking request packet for secondary verification after the door knocking verification server has successfully performed primary verification on the door knocking request packet;

[0032] In the secondary verification module:

[0033] If the timestamp of the knock request packet cannot be parsed, the knock request packet is discarded.

[0034] If the timestamp is earlier than the time when the knock request packet was last received, the knock request packet is determined to be a replay attack and the knock request packet is discarded directly.

[0035] If the timestamp is within a predetermined range from the time of the last knock request packet, the knock request packet is determined to be a flood attack, and the knock request packet is discarded directly.

[0036] As a preferred solution for the TCP proxy device of the UDP knocking service, it also includes a resource release module, which is used to notify the gateway to allow the knocking request object to access application resources from the application server after the knocking verification server verifies the knocking request packet.

[0037] The beneficial effects of this invention are as follows: A knocking proxy server listens on a specified TCP port. When a TCP knocking request packet from the requesting object arrives, the knocking proxy server obtains the TCP payload of the knocking request packet. Simultaneously, the knocking proxy server enables a keep-alive mechanism to maintain the TCP connection. The knocking proxy server uses a UDP socket to send the raw payload encapsulated in UDP to the knocking verification server. The knocking proxy server waits for a reply from the knocking verification server on the current UDP socket. If the knocking verification server does not reply within a preset time, the knocking proxy server terminates the TCP connection of the current knocking session. If the knocking verification server replies within the preset time, the knocking proxy server transfers the knocking reply packet received from the UDP channel to the TCP connection and returns it to the requesting object. After successfully sending the knocking reply packet, the knocking proxy server terminates the TCP connection of the current knocking session. This invention expands the communication method between the knocking request object and the knocking verification server by deploying a knocking proxy server. In an environment where UDP transmission is not smooth, it can provide a stable TCP connection for knocking services. While protecting the concealment and overall performance of the knocking verification server, it adds the method of sending knocking packets using the TCP protocol to avoid packet loss caused by UDP network problems. Attached Figure Description

[0038] To more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings in the following description are merely exemplary, and those skilled in the art can derive other embodiments based on the provided drawings without creative effort.

[0039] The structures, proportions, sizes, etc. illustrated in this specification are only for the purpose of assisting those skilled in the art in understanding and reading the content disclosed herein, and are not intended to limit the conditions under which the present invention can be implemented. Therefore, they have no substantial technical significance. Any modifications to the structure, changes in the proportions, or adjustments to the size, without affecting the effects and objectives that the present invention can produce, should still fall within the scope of the technical content disclosed in the present invention.

[0040] Figure 1 This is a schematic diagram of the TCP proxy method for the UDP knocking service provided in this embodiment of the invention;

[0041] Figure 2 This is the NHP protocol header structure in the TCP proxy method for the UDP knocking service provided in this embodiment of the invention;

[0042] Figure 3 This is a schematic diagram of a TCP proxy device for a UDP knocking service provided in an embodiment of the present invention. Detailed Implementation

[0043] The following specific embodiments illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0044] Before understanding the technical solution of this embodiment, it is well known that Zero Trust represents a new generation of network security protection concept. The key lies in breaking the default "trust," which can be summarized in simple terms as "continuous verification, never trust." It means not trusting anyone, device, or system inside or outside the enterprise network by default, and rebuilding the trust foundation of access control based on identity authentication and authorization, thereby ensuring trustworthy identities, devices, applications, and links. Based on the Zero Trust principle, three "securitys" of the office system can be guaranteed: endpoint security, link security, and access control security.

[0045] Before understanding the technical solution of this embodiment, it is well known that network stealth is the use of technical means by which network services hide their existence in the network, do not respond to or respond to unauthorized external access, so that external attackers cannot discover any information that can be used, thereby achieving their own concealment and protection.

[0046] Before understanding the technical solution of this embodiment, it is well known that the single packet authorization protocol is a lightweight security protocol that uses only a single data packet to request access. By integrating all necessary information into a single data packet, it simplifies the knocking process. Before allowing access to the network, it verifies the identity of the device and the user, thereby achieving "network stealth" and making it impossible for attackers to find the service address and port.

[0047] To address the issue of UDP packet loss causing knock-on failures in existing door-knock verification services during real-world applications, a new method is introduced to send knock-on packets using TCP, while maintaining the stealth and overall performance of the door-knock verification server. This avoids UDP packet loss caused by network issues. (See also...) Figure 1 In this embodiment of the invention, a TCP proxy method for UDP knocking service is provided, including the following steps:

[0048] The knocking proxy server listens on a specified TCP port. When the TCP knocking request packet of the knocking request object arrives, the knocking proxy server obtains the TCP payload of the knocking request packet. At the same time, the knocking proxy server enables a keep-alive mechanism to maintain the establishment of the TCP connection.

[0049] The knocking proxy server enables a UDP socket to send the raw payload encapsulated in UDP to the knocking verification server, and the knocking proxy server waits for the response from the knocking verification server on the current UDP socket;

[0050] If the door-knocking verification server does not respond within a preset time, the door-knocking proxy server will interrupt the TCP connection of the current door-knocking session;

[0051] If the door-knocking verification server responds within a preset time, the door-knocking proxy server will transfer the door-knocking response packet received from the UDP channel to a TCP connection and return it to the door-knocking request object. After the door-knocking response packet is successfully sent, the door-knocking proxy server will interrupt the TCP connection of the current door-knocking session.

[0052] In this embodiment, a knocking proxy server is deployed before the knocking verification server (or cluster entry point). The knocking proxy server listens on a TCP port (e.g., 62201). When a TCP knocking request packet arrives, the knocking proxy server obtains the TCP payload (knocking data) of the knocking request packet, then enables a keep-alive mechanism to maintain the TCP connection, and uses a UDP socket to send the raw payload encapsulated in UDP to the knocking verification server, while waiting for a reply from the knocking verification server on this UDP socket. If the knocking verification server does not reply within a specified time (e.g., 8 seconds), the TCP connection for this knocking session is terminated. If the knocking verification server replies promptly, it transfers the knocking reply packet received from the UDP channel to the TCP connection and returns it to the knocking request object, terminating the TCP connection after successful transmission.

[0053] In this embodiment, the knocking proxy server does not participate in the encryption and decryption of the knocking request packet, but is responsible for forwarding the knocking request packet; the knocking request packet and the knocking response packet follow point-to-point bidirectional verification encrypted communication and identity authentication.

[0054] Specifically, to avoid the knocking proxy server becoming a bottleneck in the entire knocking process, it does not participate in the encryption and decryption of knocking request packets; it only forwards them. Therefore, both the knocking request and response packets must adhere to point-to-point, two-way authentication encryption and communication, ensuring that the knocking proxy server cannot obtain the actual knocking business data during the forwarding process. Since the NHP protocol supports both UDP and TCP, this forwarding is possible.

[0055] Support Figure 2In this embodiment, an HMAC field is introduced into the knock request packet. The knock verification server performs first-level verification on the knock request packet: when the knock request object sends the knock request packet, it calculates and fills in the MAC. The knock verification server hashes the packet header data using the same algorithm and verifies the HMAC field of the knock request packet. If the HMAC does not match, the knock request packet is discarded. After the knock verification server successfully verifies the knock request packet at first level, it parses the timestamp of the knock request packet for second-level verification. If the timestamp of the knock request packet cannot be parsed, the knock request packet is discarded. If the timestamp is earlier than the time when the knock request packet was last received, the knock request packet is determined to be a replay attack and is discarded. If the timestamp is within a predetermined range from the knocking time of the last knock request packet, the knock request packet is determined to be a flooding attack and is discarded. Once the knocking verification server verifies the knocking request packet, it notifies the gateway to allow the knocking request object to access application resources from the application server.

[0056] Specifically, the NHP header of the knock request packet introduces an HMAC field. The knock request object calculates and fills in the MAC address when sending the packet. At the receiving end, the header data is hashed using the same algorithm, and the HMAC field is verified. If the HMAC does not match, the packet is discarded. After successful first-level verification, the timestamp ciphertext carried in the knock request packet header is used for second-level verification. If the receiver cannot decrypt the timestamp, the packet is discarded. After parsing the timestamp, if this timestamp is earlier than the time of the last received knock request packet, it indicates a replay attack and the packet is discarded. If this knock request packet comes from the same source IP address and source port, and this timestamp is too close to the time of the last knock, it is determined to be a flooding attack and the packet is discarded. Because the NHP protocol header contains the data needed for stealth communication verification, supporting mutual verification and one-time data exchange between the two parties, the message encapsulated by the NHP header cannot be modified midway, and third parties other than the designated receiver cannot decrypt it. Thus, based on the security of the NHP message, knock proxy forwarding is achieved.

[0057] The data structure of the knock request packet is shown in the table below:

[0058]

[0059] In summary, this invention uses a knocking proxy server to listen on a designated TCP port. When a TCP knocking request packet from a knocking request object arrives, the knocking proxy server obtains the TCP payload of the knocking request packet and simultaneously enables a keep-alive mechanism to maintain the TCP connection. The knocking proxy server then uses a UDP socket to send the raw payload encapsulated in UDP to the knocking verification server, waiting for a response from the knocking verification server on the current UDP socket. If the knocking verification server does not respond within a preset time, the knocking proxy server terminates the TCP connection of the current knocking session. If the knocking verification server responds within the preset time, the knocking proxy server transfers the knocking response packet received from the UDP channel to the TCP connection and returns it to the knocking request object. After successfully sending the knocking response packet, the knocking proxy server terminates the TCP connection of the current knocking session. The knock request packet incorporates an HMAC field. The knock verification server performs first-level verification on the knock request packet: when sending the knock request packet, the knock requesting object calculates and fills in the MAC address. The knock verification server hashes the packet header data using the same algorithm and verifies the HMAC field of the knock request packet. If the HMAC does not match, the knock request packet is discarded. After successful first-level verification, the knock verification server parses the timestamp of the knock request packet for second-level verification. If the timestamp cannot be parsed, the knock request packet is discarded. If the timestamp is earlier than the time of the last received knock request packet, the knock request packet is considered a replay attack and is discarded. If the timestamp is within a predetermined range from the knocking time of the last knock request packet, the knock request packet is considered a flooding attack and is discarded. When the knock verification server successfully verifies the knock request packet, it notifies the gateway to allow the knock requesting object to access application resources from the application server. This invention expands the communication method between the knocking request object and the knocking verification server by deploying a knocking proxy server. In an environment where UDP transmission is not smooth, it can provide a stable TCP connection for knocking services. While protecting the concealment and overall performance of the knocking verification server, it adds the method of sending knocking packets using the TCP protocol to avoid packet loss caused by UDP network problems.

[0060] It should be noted that the method of this embodiment can be applied to a distributed scenario, where multiple devices cooperate to complete the task. In such a distributed scenario, one of these devices may execute only one or more steps of the method in this embodiment, and the multiple devices will interact with each other to complete the method described.

[0061] It should be noted that the above description describes some embodiments of this disclosure. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in a different order than that shown in the above embodiments and still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0062] See Figure 3 Based on the same inventive concept, embodiments of the present invention also provide a TCP proxy device for UDP knocking services, comprising:

[0063] TCP port listening module 1 is used to listen on a specified TCP port through a knocking proxy server;

[0064] The knocking request processing module 2 is used to obtain the TCP payload of the knocking request packet when the TCP knocking request packet of the knocking request object arrives, and at the same time, the knocking proxy server enables the keep-alive mechanism to maintain the establishment of the TCP connection.

[0065] The door-knocking data forwarding module 3 is used by the door-knocking proxy server to send the raw payload encapsulated in UDP to the door-knocking verification server via a UDP socket.

[0066] Knock response waiting module 4 is used for the knock proxy server to wait for the response from the knock verification server on the current UDP socket;

[0067] The response failure handling module 5 is used to interrupt the TCP connection of the current knocking session if the knocking verification server does not respond within a preset time.

[0068] The successful response processing module 6 is used to transfer the knock response packet received from the UDP channel to the knock request object in the TCP connection if the knock verification server responds within a preset time. After the knock response packet is successfully sent, the knock proxy server will interrupt the TCP connection of the current knock session.

[0069] In this embodiment, the knocking proxy server does not participate in the encryption and decryption of the knocking request packet; the knocking proxy server is responsible for forwarding the knocking request packet.

[0070] The knock request packet and the knock response packet follow a point-to-point two-way authentication encrypted communication and identity verification.

[0071] In this embodiment, a primary verification module 7 is also included, which is used by the door-knocking verification server to perform primary verification on the door-knocking request packet:

[0072] The knock request packet introduces an HMAC field. When the knock request object sends the knock request packet, it calculates and fills in the MAC. The knock verification server hashes the packet header data using the same algorithm and verifies the HMAC field of the knock request packet. If the HMAC does not match, the knock request packet is discarded directly.

[0073] It also includes a secondary verification module 8, which is used by the door-knocking verification server to parse the timestamp of the door-knocking request packet for secondary verification after the door-knocking verification server has successfully performed primary verification on the door-knocking request packet;

[0074] In the secondary verification module 8:

[0075] If the timestamp of the knock request packet cannot be parsed, the knock request packet is discarded.

[0076] If the timestamp is earlier than the time when the knock request packet was last received, the knock request packet is determined to be a replay attack and the knock request packet is discarded directly.

[0077] If the timestamp is within a predetermined range from the time of the last knock request packet, the knock request packet is determined to be a flood attack, and the knock request packet is discarded directly.

[0078] In this embodiment, a resource release module 9 is also included, which is used to notify the gateway to allow the application access resource of the application server when the knocking verification server verifies the knocking request packet.

[0079] It should be noted that the information interaction and execution process between the modules of the above-mentioned device are based on the same concept as the method embodiment in this application, and the resulting technical effects are the same as those in the method embodiment in this application. For details, please refer to the description in the method embodiment shown above in this application, and it will not be repeated here.

[0080] The embodiments of this application are intended to cover all such substitutions, modifications, and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the embodiments of this application should be included within the protection scope of this application.

Claims

1. A TCP proxy method for UDP knocking service, characterized in that, include: The knocking proxy server listens on a specified TCP port. When the TCP knocking request packet of the knocking request object arrives, the knocking proxy server obtains the TCP payload of the knocking request packet. At the same time, the knocking proxy server enables a keep-alive mechanism to maintain the establishment of the TCP connection. The knocking proxy server enables a UDP socket to send the raw payload encapsulated in UDP to the knocking verification server, and the knocking proxy server waits for the response from the knocking verification server on the current UDP socket; If the door-knocking verification server does not respond within a preset time, the door-knocking proxy server will interrupt the TCP connection of the current door-knocking session; If the door-knocking verification server responds within a preset time, the door-knocking proxy server will transfer the door-knocking response packet received from the UDP channel to the TCP connection and return it to the door-knocking request object. After the door-knocking response packet is successfully sent, the door-knocking proxy server will interrupt the TCP connection of the current door-knocking session. The knocking proxy server does not participate in the encryption and decryption of the knocking request packet; the knocking proxy server is responsible for forwarding the knocking request packet. The knock request packet and the knock response packet follow point-to-point two-way verification encrypted communication and identity authentication. The knock request packet includes an HMAC field, and the knock verification server performs first-level verification on the knock request packet. When the knocking request object sends the knocking request packet, it calculates and fills in the MAC. The knocking verification server hashes the packet header data using the same algorithm and verifies the HMAC field of the knocking request packet. If the HMAC does not match, the knocking request packet is discarded directly. After the knocking verification server successfully performs first-level verification on the knocking request packet, the knocking verification server parses the timestamp of the knocking request packet for second-level verification. If the timestamp of the knock request packet cannot be parsed, the knock request packet is discarded. If the timestamp is earlier than the time when the knock request packet was last received, the knock request packet is determined to be a replay attack and the knock request packet is discarded directly. If the timestamp is within a predetermined range from the time of the last knock request packet, the knock request packet is determined to be a flood attack, and the knock request packet is discarded directly. Once the knocking verification server verifies the knocking request packet, it notifies the gateway to allow the knocking request object to access application resources from the application server.

2. A TCP proxy device for a UDP knocking service, employing the TCP proxy method for a UDP knocking service as described in claim 1, characterized in that, include: The TCP port listening module is used to listen on a specified TCP port through a knocking proxy server. The knocking request processing module is used to obtain the TCP payload of the knocking request packet when the TCP knocking request packet of the knocking request object arrives, and at the same time, the knocking proxy server enables the keep-alive mechanism to maintain the establishment of the TCP connection. The door-knocking data forwarding module is used by the door-knocking proxy server to send the raw payload encapsulated in UDP to the door-knocking verification server via a UDP socket. The knocking response waiting module is used by the knocking proxy server to wait for the response from the knocking verification server on the current UDP socket; The response failure handling module is used so that if the door knocking verification server does not respond within a preset time, the door knocking proxy server will interrupt the TCP connection of the current door knocking session. The successful response processing module is used to transfer the knock response packet received from the UDP channel to the knock request object in the TCP connection if the knock verification server responds within a preset time. After the knock response packet is successfully sent, the knock proxy server will interrupt the TCP connection of the current knock session. The knocking proxy server does not participate in the encryption and decryption of the knocking request packet; the knocking proxy server is responsible for forwarding the knocking request packet. The knock request packet and the knock response packet follow point-to-point two-way verification encrypted communication and identity authentication. It also includes a primary verification module, used by the door-knocking verification server to perform primary verification on the door-knocking request packet: The knock request packet introduces an HMAC field. When the knock request object sends the knock request packet, it calculates and fills in the MAC. The knock verification server hashes the packet header data using the same algorithm and verifies the HMAC field of the knock request packet. If the HMAC does not match, the knock request packet is discarded directly. It also includes a secondary verification module, which is used by the door knocking verification server to parse the timestamp of the door knocking request packet for secondary verification after the door knocking verification server has successfully performed primary verification on the door knocking request packet; In the secondary verification module: If the timestamp of the knock request packet cannot be parsed, the knock request packet is discarded. If the timestamp is earlier than the time when the knock request packet was last received, the knock request packet is determined to be a replay attack and the knock request packet is discarded directly. If the timestamp is within a predetermined range from the time of the last knock request packet, the knock request packet is determined to be a flood attack, and the knock request packet is discarded directly. It also includes a resource access module, which is used to notify the gateway to allow the application server to access resources from the knock request object after the knock verification server verifies the knock request packet.

Citation Information

Patent Citations

  • Zero-trust single packet authentication system and method based on universal browser

    CN114640495A