A secure communication method and system for a secure server
By analyzing the field arrangement order of the client handshake message and verifying the insertion perturbation, replay attacks can be identified and defended against, solving the problem of insufficient dynamic detection capability in existing technologies and improving communication security and anti-attack capability.
Patent Information
- Application Number
- CN202611361437.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-03
- Publication Date
- 2026-11-10
AI Technical Summary
Existing communication protection methods lack dynamic detection capabilities when facing attacks such as mirroring, field replay, and link forwarding, resulting in a high false positive rate and insufficient real-time performance, making it impossible to effectively identify and defend against replay attacks.
By analyzing the field arrangement order of multiple acknowledgment messages during the client handshake phase, a message field arrangement trajectory is generated, field reuse patterns are detected, perturbation fields are inserted at different positions, and it is verified whether the client synchronously retains them to determine whether a replay attack exists.
It improves the ability to identify mirror replay attacks, reduces the probability of false positives, and enhances the security and anti-replay attack capabilities of communication links in complex network environments.
Smart Images

Figure CN123074809A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of communication security technology, and in particular to a secure communication method and system for a secure server. Background Technology
[0002] In the internet environment, communication between servers and clients typically relies on handshake verification, session identification, and field validation mechanisms to ensure identity verification and secure data interaction. However, existing communication protection methods mostly focus on verification using fixed checksums, timestamps, or encryption tokens. They lack dynamic detection capabilities targeting the field arrangement structure and position reuse patterns, which attackers exploit by mirroring historical confirmation messages, replaying data, and forwarding links. This allows some replay attacks to bypass traditional verification mechanisms and establish forged communication sessions. Furthermore, existing detection schemes are prone to high false positive rates and insufficient real-time performance when facing modified replay scenarios such as field order perturbations and message mirroring. Summary of the Invention
[0003] Therefore, it is necessary to provide a secure communication method and system for a secure server to solve at least one of the above-mentioned technical problems.
[0004] To achieve the above objectives, a secure communication method for a secure server is provided, the method comprising the following steps: Step S1: Receive the handshake communication request sent by the client and record multiple acknowledgment messages sent consecutively by the same client during the handshake phase; Step S2: Perform position offset analysis on the field arrangement order in multiple confirmation messages to generate the message field arrangement trajectory; Step S3: Based on the detection of the packet field arrangement trajectory, confirm the field reuse pattern in the packet, and determine whether there is a replay attack behavior formed by copying fixed packet fields; Step S4: Based on the judgment result, the control server marks the corresponding communication session as a suspected mirror replay session; Step S5: Insert a position perturbation field into the suspected mirror replay session, and check whether the client retains the corresponding position perturbation field in subsequent returned packets; Step S6: When the client returns a message that does not synchronously retain the corresponding perturbation field, it is determined that there is a replay attack on the corresponding communication link, and the corresponding communication link is closed.
[0005] The present invention also provides a secure communication system for a secure server, used to execute the secure communication method for a secure server as described above, the secure communication system for the secure server comprising: The handshake receiving module is used to receive handshake communication requests sent by the client and record multiple acknowledgment messages sent consecutively by the same client during the handshake phase. The offset analysis module is used to perform position offset analysis on the field arrangement order in multiple acknowledgment messages and generate the message field arrangement trajectory. The reuse detection module is used to detect and confirm the reuse pattern of fields in the message based on the arrangement trajectory of message fields, and to determine whether there is a replay attack behavior formed by copying fixed message fields. The session marking module is used to control the server to mark the corresponding communication session as a suspected mirror replay session based on the judgment result; The disturbance detection module is used to insert a position disturbance field into suspected mirror replay sessions and detect whether the client retains the corresponding position disturbance field in subsequent returned packets. The attack detection module is used to determine if a replay attack has occurred on the corresponding communication link when the client subsequently returns a message that does not synchronously retain the corresponding perturbation field, and then shuts down the corresponding communication link.
[0006] The beneficial effects of this invention lie in its ability to identify mirror-style replay attacks caused by traditional fixed message field duplication through correlation analysis of the field arrangement order, position offset patterns, and field reuse trajectories in continuous acknowledgment messages during the client handshake phase. Compared to detection methods that rely solely on timestamps or single checksums, this invention can uncover hidden cyclic reuse features at the field arrangement structure level. Furthermore, by constructing field cyclic offset chains, offset loop regions, and field cyclic offset nodes, a closed-loop mapping of the fixed offset duplication path in the attack message is achieved, effectively improving the identification capabilities for distorted replay, mirror forwarding, and pseudo-random field insertion attacks. In addition, upon detecting a suspected mirror replay session, the server further inserts a position perturbation field and dynamically verifies whether the corresponding perturbation structure is synchronously retained in subsequent client return messages. This effectively distinguishes between real clients and replay relay links, reduces the probability of false positives, and improves the security and anti-replay attack capabilities of communication links in complex network environments. Attached Figure Description
[0007] Figure 1 A flowchart illustrating the steps of a secure communication method for a secure server; Figure 2 for Figure 1 A detailed flowchart illustrating the implementation steps of step S3. Figure 3 This is a flowchart illustrating a replay attack detection method as described in one embodiment. Figure 4 This is a schematic diagram of a process for determining regular movement behavior in one embodiment. The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0008] The technical method of the present invention will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0009] Furthermore, the accompanying drawings are merely illustrative of the invention and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor methods and / or microcontroller methods.
[0010] It should be understood that although the terms "first," "second," etc., may be used herein to describe various units, these units should not be limited by these terms. These terms are used merely to distinguish one unit from another. For example, without departing from the scope of the exemplary embodiments, a first unit may be referred to as a second unit, and similarly, a second unit may be referred to as a first unit. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.
[0011] To achieve the above objectives, please refer to Figures 1 to 4 A secure communication method for a secure server, the method comprising the following steps: Step S1: Receive the handshake communication request sent by the client and record multiple acknowledgment messages sent consecutively by the same client during the handshake phase; Step S2: Perform position offset analysis on the field arrangement order in multiple confirmation messages to generate the message field arrangement trajectory; Step S3: Based on the detection of the packet field arrangement trajectory, confirm the field reuse pattern in the packet, and determine whether there is a replay attack behavior formed by copying fixed packet fields; Step S4: Based on the judgment result, the control server marks the corresponding communication session as a suspected mirror replay session; Step S5: Insert a position perturbation field into the suspected mirror replay session, and check whether the client retains the corresponding position perturbation field in subsequent returned packets; Step S6: When the client returns a message that does not synchronously retain the corresponding perturbation field, it is determined that there is a replay attack on the corresponding communication link, and the corresponding communication link is closed.
[0012] In one embodiment, reference may be made to Figure 3 This example uses an HTTPS secure access server in a company's data center. The server is deployed behind the company's intranet egress switch and establishes an encrypted communication link with external clients via a TLS secure communication module. Client terminals can be browser terminals, mobile app terminals, or automated interface terminals.
[0013] When a client initiates its first TLS handshake request to the server, the server listens on port 443 and receives the Client Hello handshake message sent by the client. Subsequently, the server establishes a handshake buffer during the handshake phase and continuously records multiple acknowledgment messages sent by the same client within a consecutive time window (e.g., 3 seconds). For example, the server sequentially caches the Session acknowledgment message, extended negotiation message, and handshake ACK message returned by the client, recording the arrival time, message length, and field arrangement structure of each message.
[0014] The server performs position offset analysis on the field arrangement order in multiple acknowledgment messages. Specifically, the field parsing module first performs byte-level splitting of the message, extracting the random number segment, timestamp segment, extended field segment, MAC checksum field, and session identifier field, and records the starting offset address corresponding to each field. For example, the random number segment is recorded as being located at Byte 32, and the extended field as being located at Byte 48. Subsequently, the changes in field positions in consecutive messages are compared. When it is detected that some fields maintain a fixed offset position while other fields show regular displacement, the changes in the positions of each field are connected in chronological order to generate the corresponding message field arrangement trajectory.
[0015] The server detects field reuse patterns based on the arrangement trajectory of message fields. For example, if the server finds that the extended fields in multiple acknowledgment messages are arranged in the exact same order, the random number segment content remains unchanged, and the field offset trajectory shows a periodic repetition, the trajectory analysis module further calculates the field reuse frequency. When the same field arrangement structure appears more than a preset number of times within a short period, it determines that the client is directly copying historical acknowledgment messages. In particular, when the random number segment, timestamp field, and checksum field in the message are simultaneously mirrored, the server determines that the communication link contains suspected replay attacks using fixed message field copying.
[0016] Based on the detection results, the server marks the corresponding communication session as a suspected mirror replay session. For example, the session management module adds the "Replay-Suspected" flag to the session state table corresponding to the TLS connection, suspends the current session from entering the normal business data exchange process, and simultaneously initiates an active disturbance verification mechanism.
[0017] The server inserts position perturbation fields into suspected sessions using a perturbation insertion module. For example, the server dynamically inserts a perturbation field "PX-Offset" into the extended negotiation field region of a subsequent Server Hello acknowledgment message and randomly changes its position in the message, for example, moving it from the 48th byte to the 64th byte. Simultaneously, the server alters the order of some extended fields, requiring legitimate clients to re-parse the current message structure before correctly generating subsequent response messages.
[0018] Subsequently, the server checks whether the client's subsequent return messages synchronously retain the corresponding perturbation fields. For example, if a normal client parses the new handshake structure in real time, its return messages will synchronously include the newly added perturbation fields and maintain the same positional arrangement as the server; however, if an attacker directly replays historical cached messages, the return messages will still maintain the old field arrangement structure, neither including the newly added perturbation fields nor synchronously updating the field offset positions.
[0019] When the server detects that subsequent response messages from the client do not synchronously retain the corresponding perturbation fields, the link control module determines that the current communication data originates from a copy of historical mirrored messages, rather than real-time generated data. For example, if the random number segment and extended fields in the response message retain the old offset positions and the dynamically inserted "PX-Offset" field is missing, the server immediately confirms that a replay attack has occurred on the communication link. Subsequently, the server proactively sends a TLSAlert close notification to the client and disconnects the corresponding TCP connection. Simultaneously, it writes the attack time, source IP address, field trace data, and abnormal message content to the security log database for subsequent security auditing and attack tracing analysis.
[0020] As an example of the present invention, reference is made to... Figure 2 As shown, step S3 in this example includes: Step S31: Extract the session identifier field, timestamp field, checksum field, and status response field from the acknowledgment message, and generate a field arrangement sequence according to the order in which the fields appear; Step S32: Obtain field position offset data based on the position changes of the same field content in the message according to the field arrangement sequence; Step S33: Based on the field position offset data, detect whether the same field content appears cyclically according to a fixed offset pattern to obtain the field reuse trajectory; Step S34: Perform message association mapping on the field multiplexing trajectory to generate mirror multiplexing analysis data; Step S35: Calculate the message field reuse similarity through mirror reuse analysis data. When the message field reuse similarity is greater than the preset similarity threshold, it is determined that there is a replay attack behavior formed by copying fixed message fields.
[0021] In one embodiment, an HTTPS secure access server in an enterprise data center is used as an example. This HTTPS secure access server is deployed in the enterprise's DMZ security zone and establishes encrypted communication connections with external clients through a TLS secure communication module.
[0022] After the client and server establish a TLS handshake connection, the server continuously receives multiple acknowledgment messages returned by the client. The message parsing module first performs field splitting processing on each acknowledgment message, extracting the session identifier field, timestamp field, checksum field, and status response field. For example, it extracts the Session-ID field, Timestamp field, MAC checksum field, and Handshake-Status field from the acknowledgment message. Subsequently, the fields are arranged and recorded according to their actual appearance order in the message. For example, "Session-ID→Timestamp→MAC→Status" is recorded as the first field arrangement sequence, and the field arrangement in subsequent messages is stored synchronously.
[0023] The server obtains field position offset data based on the positional changes of identical field content within the message in a field arrangement sequence. For example, the server compares the position of the Session-ID field in consecutive acknowledgment messages and records its byte offset address in different messages. When the Session-ID is located at byte 24 in the first message and moves to byte 32 in the second message, the corresponding offset is recorded as +8 bytes. Similarly, the server performs offset statistics on the timestamp field, checksum field, and status response field, and combines the positional changes of multiple fields in consecutive messages into a field position offset data set.
[0024] The server detects whether the same field content appears cyclically according to a fixed offset pattern based on field position offset data. For example, it finds that the Session-ID field consistently offsets in multiple acknowledgment messages according to a fixed pattern of "+8Byte → -8Byte → +8Byte", while the MAC checksum field and status response field also maintain the same offset rhythm. In this case, the field trajectory analysis module connects the offset changes of the corresponding fields in chronological order and generates a corresponding field reuse trajectory. If the offset path of the same field content repeatedly appears in different messages, it indicates that the client may be directly copying an existing message template and replaying it cyclically.
[0025] The server performs message association mapping on the field reuse trajectories to generate mirrored reuse analysis data. Specifically, the mirrored reuse detection module cross-correlates the field reuse trajectories in multiple acknowledgment messages. For example, it synchronously matches the offset trajectory of the Session-ID field with the offset trajectory of the MAC checksum field and analyzes the field arrangement relationships between different messages. When the field offset patterns, arrangement order, and field content in multiple messages all show a mirrored correspondence, corresponding mirrored reuse analysis data is generated to characterize the replication association between the messages.
[0026] The server calculates the reusability similarity of message fields by analyzing mirrored reusability data. For example, it performs weighted analysis on field arrangement consistency, field offset cycle consistency, and field content repetition rate, and generates corresponding reusability similarity results. When the field arrangement structure, offset trajectory, and field content in multiple acknowledgment messages are highly consistent, and the final calculated message field reusability similarity is greater than a preset similarity threshold, the server determines that the current communication link contains a replay attack using fixed message field duplication.
[0027] For example, during an HTTPS handshake, the server detects that six consecutive acknowledgment messages returned by a client all have the same field arrangement structure, and the field offset trajectories repeat periodically. Furthermore, some timestamp fields are not updated in real-time during the handshake process. In this case, the server confirms that the data returned by the client originates from a copy of historical cached messages, rather than being generated in real-time. Therefore, the server marks the corresponding communication session as a replay attack session and initiates the subsequent link closure process.
[0028] Preferably, step S32 includes the following steps: Obtain the order in which the acknowledgment messages were received; Based on the order of receipt time, confirm the position number of each field in the field arrangement sequence; Extract the target field with the same content from multiple consecutive field position numbers, and record the position changes of the target field in different acknowledgment messages; Calculate the position offset distance and offset direction of the corresponding target field based on the position change of the target field; Detect whether the target field exhibits a regular movement behavior with a fixed step size offset, and generate field offset trajectory data; Field position offset data is obtained based on field offset trajectory data.
[0029] In one embodiment, an HTTPS secure access server in an enterprise data center is used as an example. This HTTPS secure access server is deployed in the enterprise's DMZ security zone and establishes encrypted communication connections with multiple external clients through a TLS secure communication module.
[0030] The server obtains the receiving time sequence of multiple acknowledgment messages. For example, during the TLS handshake phase, the server receives ACK acknowledgment messages A1, A2, A3, and A4 sent by the client in sequence, and records the corresponding receiving times T1, T2, T3, and T4, respectively. Subsequently, the server establishes a message queue according to the receiving time sequence, enabling subsequent field position analysis to be performed based on continuous communication behavior.
[0031] Subsequently, the server assigns position numbers to each field in the field sequence according to the order of receipt time. For example, the server assigns position numbers to the Session-ID, Timestamp, MAC checksum, and Handshake-Status fields in each acknowledgment message according to their order in the message. In message A1, "Session-ID" is in position 1, "Timestamp" is in position 2, and "MAC" is in position 3; while in message A2, "Session-ID" moves to position 2, and "Timestamp" moves to position 3. These positional relationships are recorded as a set of field position numbers.
[0032] Next, the server extracts the target field with identical content from multiple consecutive field position numbers and records the position changes of the target field in different acknowledgment messages. For example, by extracting the "Session-ID" field from multiple consecutive messages and analyzing its position changes, it is found that the position numbers of this field in A1, A2, A3, and A4 are 1, 2, 3, and 4, respectively, thus forming a corresponding position change sequence. Similarly, the server synchronously analyzes the arrangement changes of the MAC field and the status response field.
[0033] Subsequently, the server calculates the position offset distance and direction of the corresponding target field based on the position changes of the target field. For example, based on the position number change of the "Session-ID" field in adjacent packets, its offset distance is calculated as "+1", and the offset direction is "moving backward"; if a field moves from position 4 to position 2, the offset distance is recorded as "-2", and the offset direction is "moving forward". The server records the position offset results between consecutive packets for each field separately.
[0034] Furthermore, the server detects whether the target field exhibits a regular movement behavior with a fixed step size offset. For example, it detects that the "Session-ID" field continuously moves backward with a fixed step size of "+1", while the MAC field synchronously maintains a regular offset of "+1", returning to the starting position after reaching the end position, forming a cyclic offset. In this case, the trajectory detection module determines that the field exhibits regular movement behavior and generates field offset trajectory data based on the corresponding field arrangement change process.
[0035] Finally, the server obtains field position offset data based on the field offset trajectory data. For example, the field name, offset direction, offset distance, number of loops, and corresponding time sequence are associated and stored to form complete field position offset data, which is used for subsequent detection of replay attacks that use fixed field templates for copying.
[0036] For example, during a TLS handshake, the server discovered that multiple acknowledgment messages sent by a client maintained a fixed arrangement of the "Session-ID→Timestamp→MAC" fields, shifted one position to the right, with identical field content. Since a normal client would not maintain a fixed offset pattern during a real-time handshake, the server flagged this field offset trajectory as a suspected mirroring / reuse trajectory and initiated the subsequent replay attack detection process.
[0037] Preferably, the detection of whether a target field exhibits a regular movement behavior with a fixed step size offset based on the target field's position offset distance and offset direction specifically involves: Extract the position offset distance and offset direction of the target field in consecutive acknowledgment messages; The end position of the target field in the previous acknowledgment message is used as the position offset base point of the next acknowledgment message, and the cross-segment offset step size of the corresponding target field is calculated. Detect whether the cross-segment offset step size of multiple consecutive target fields remains consistent, and determine whether the corresponding offset direction always faces the same field arrangement area; When multiple consecutive target fields move towards the same field arrangement area with the same cross-segment offset step size, it is determined that the target fields have a regular movement behavior with a fixed step size offset, and the corresponding field offset trajectory data is generated.
[0038] In one embodiment, an HTTPS secure access server in an enterprise data center is used as an example. This HTTPS secure access server is deployed in the enterprise's DMZ security zone and establishes an encrypted communication link with external clients through a TLS secure communication module.
[0039] You can refer to this. Figure 4The server extracts the position offset distance and direction of the target field in consecutive acknowledgment messages. For example, during the TLS handshake phase, the server successively receives acknowledgment messages A1, A2, A3, and A4 sent by the client. The field parsing module extracts the position number of the "Session-ID" field from each message and records its position in different messages. For example, the "Session-ID" field is located at the first field position in A1, the second field position in A2, the third field position in A3, and the fourth field position in A4. Based on this, the server calculates the corresponding offset distance, which is "+1" for each message, and the offset direction is "backward".
[0040] Subsequently, the server uses the end position of the target field in the previous acknowledgment message as the position offset base point for the next acknowledgment message and calculates the segment offset step size for the corresponding target field. For example, the end position of the "Session-ID" field in message A1 is used as the position offset reference point for message A2, and the offset span of this field in A2 relative to the previous message is calculated; similarly, the end position in A2 is used as the offset base point for A3. By continuously associating the field position changes in different messages, a sequence of segment offset step sizes for this field in multiple acknowledgment messages is obtained.
[0041] Next, the server checks whether the cross-segment offset step size of multiple consecutive target fields remains consistent, and determines whether the corresponding offset direction always points towards the same field arrangement area. For example, it was found that the cross-segment offset step size of the "Session-ID" field in A1→A2, A2→A3, and A3→A4 always remained "+1", and the offset direction consistently moved towards the field area at the end of the message. At the same time, the server further checked the MAC checksum field and the status response field, and found that they also maintained the same offset pattern.
[0042] Furthermore, the server determines whether the corresponding field consistently moves cyclically within the same field arrangement area. For example, when a field moves back to position 1 from position 4, it is found that it continues to shift backward with a fixed step size of "+1", forming a regular cyclical arrangement trajectory. Since the field arrangement during a normal TLS handshake is usually dynamically generated by the client and does not continuously maintain a fixed direction and fixed step size cyclical shift, this behavior is judged as abnormal field reuse behavior.
[0043] Finally, when multiple target fields move towards the same field arrangement area with the same cross-segment offset step size, the server determines that the target fields exhibit a regular movement behavior with a fixed step size offset and generates corresponding field offset trajectory data. For example, "Session-ID field: +1 cycle offset" and "MAC field: +1 cycle offset" are associated and stored with corresponding time sequence, offset direction, and cycle count information to form complete field offset trajectory data, which is used for subsequent mirror reuse analysis and replay attack identification.
[0044] For example, during an HTTPS handshake, the server discovered that eight consecutive acknowledgment messages returned by a client all maintained a fixed pattern of right-shifting a field by one position, and the field content remained consistent. Because this offset behavior was repeated continuously and in the exact same direction, the server ultimately determined that the client might be using cached acknowledgment messages to perform a mirror replay attack and marked the corresponding communication session as a suspected replay session.
[0045] Preferably, detecting whether the same field content appears cyclically according to a fixed offset pattern based on field position offset data includes: Extract the position offset distance and offset direction of the same field content in the field position offset data; Based on the order in which the acknowledgment messages are received, the positional offset distances of the same field content are arranged consecutively to generate a field offset sequence; Determine whether the content of the same field appears cyclically according to a fixed offset pattern by using the field offset sequence; Generate corresponding field reuse trajectories based on the cyclic offset order of the same field content.
[0046] In one embodiment, an HTTPS secure access server in an enterprise data center is used as an example. This HTTPS secure access server is deployed in the enterprise's DMZ security zone and establishes encrypted communication connections with multiple clients through a TLS secure communication module.
[0047] The server extracts the position offset distance and direction corresponding to the same field content from the field position offset data. For example, during the TLS handshake phase, the server continuously receives acknowledgment messages A1, A2, A3, A4, and A5 sent by the client. The field parsing module extracts the "Session-ID" field from multiple acknowledgment messages and records the position changes of this field in different messages. For example, the "Session-ID" field is positioned as position 1, position 2, position 3, position 4, and then returns to position 1 in A1 to A5, respectively. Based on this, the server calculates the corresponding position offset distance sequence as "+1, +1, +1, -3", with offset directions of "backward, backward, backward, and wraparound forward," respectively.
[0048] Subsequently, the server arranges the position offset distances of identical field contents consecutively according to the reception order of the acknowledgment messages, generating a field offset sequence. For example, according to the chronological order of message reception times T1, T2, T3, T4, and T5, the offset distances corresponding to the "Session-ID" field are arranged sequentially, forming the field offset sequence "(+1→+1→+1→-3)". Simultaneously, the server generates corresponding field offset sequences for the MAC checksum field, timestamp field, and status response field.
[0049] Next, the server determines whether the same field content appears cyclically according to a fixed offset pattern by analyzing the field offset sequence. For example, it was found that the "Session-ID" field consistently offsets by a fixed step size of "+1" in multiple acknowledgment messages, returning to the beginning position after reaching the end of the field, forming a cyclic arrangement. Simultaneously, the MAC field and the status response field also maintain the same cyclic offset pattern. The field offset sequence analysis module further calculates the cycle length and repetition count. When the same offset pattern continuously repeats within a preset time window, it is determined that the field exhibits a fixed offset cyclic behavior.
[0050] Furthermore, the server generates corresponding field reuse trajectories based on the cyclic offset order of the same field content. For example, the cyclic movement of the "Session-ID" field from "position 1 → position 2 → position 3 → position 4 → position 1" is connected in chronological order, and the corresponding offset direction and offset distance are synchronously associated to form a complete field reuse trajectory. Similarly, the server also synchronously records the cyclic offset trajectories of the MAC field, Timestamp field, and Handshake-Status field.
[0051] For example, during an HTTPS handshake, the server discovered that multiple consecutive acknowledgment messages returned by a client maintained completely identical field content, changing only the field arrangement using a fixed offset. Specifically, the "Session-ID" field consistently offset along a fixed cyclic path, while the timestamp field remained unchanged throughout the handshake. Since TLS acknowledgment messages generated by normal clients typically do not maintain a fixed cyclic offset behavior for extended periods, the server flagged this field reuse pattern as a suspected mirrored reuse pattern and initiated subsequent replay attack analysis.
[0052] Preferably, determining whether the same field content appears cyclically according to a fixed offset pattern by using the field offset sequence includes: Window truncation is performed on consecutive offset distances in the field offset sequence to generate corresponding offset distance combinations; The various offset distance combinations are spliced together end to end according to the offset direction to generate a cyclic offset chain; Perform a loop-back mapping on the repeated offset distance combinations in the cyclic offset chain to obtain the field cyclic offset node; Based on the order in which the field cyclic offset nodes appear repeatedly in different acknowledgment messages, a fixed offset cyclic trajectory with the same field content is generated.
[0053] In one embodiment, an HTTPS secure access server in an enterprise data center is used as an example. This HTTPS secure access server is deployed in the enterprise's DMZ security zone and establishes secure connections with external clients through a TLS secure communication module.
[0054] The server performs window truncation on consecutive offset distances in the field offset sequence to generate corresponding offset distance combinations. For example, during the TLS handshake phase, the server continuously receives acknowledgment messages A1, A2, A3, A4, A5, and A6 from the client and extracts the position offset sequence "(+1, +1, +1, -3, +1, +1)" corresponding to the "Session-ID" field. Subsequently, it slides and truncates this sequence according to a preset window length (e.g., three consecutive sets of offset distances) to generate multiple offset distance combinations, such as "(+1, +1, +1)", "(+1, +1, -3)", and "(+1, -3, +1)".
[0055] Subsequently, the server concatenates the various offset distance combinations end-to-end according to the offset direction to generate a cyclic offset chain. For example, if multiple offset distance combinations are found to maintain a directional pattern of "continuously offsetting backward and then looping back," then "(+1,+1,+1)" and "(-3,+1,+1)" are connected according to the offset direction to form a complete cyclic offset chain, making the field offset relationship present a continuous closed-loop structure. In this way, originally discrete offset combinations can be reconstructed into offset links with cyclic characteristics.
[0056] Next, the server performs loop-based mapping on the repeated offset distance combinations in the circular offset chain to obtain field circular offset nodes. For example, if the combination "(+1,+1,+1,-3)" is detected to be repeatedly occurring in the circular offset chain, the location region corresponding to this repeated combination is marked as a circular node. Simultaneously, the field name, occurrence time, and corresponding acknowledgment message number for each circular node are recorded. For example, the offset loop formed by A1 to A4 is marked as the first circular node, and the repeated offset loop formed by A5 to A8 is marked as the second circular node.
[0057] Subsequently, the server generates a fixed offset cyclic trajectory for the same field content based on the order in which the field cyclic offset nodes appear repeatedly in different acknowledgment messages. For example, multiple cyclic nodes are connected sequentially according to the acknowledgment message reception time, establishing a field cyclic trajectory of "position 1 → position 2 → position 3 → position 4 → back to position 1". Simultaneously, the corresponding offset direction, offset distance, and number of cycles are also associated and recorded, thus forming complete fixed offset cyclic trajectory data.
[0058] For example, during an HTTPS handshake, the server discovered that a client was continuously returning multiple acknowledgment messages with identical field content, only changing the field order through a fixed "+1" cyclic offset, and returning to the starting field position after reaching the last field. Because this cyclical pattern repeatedly appeared in multiple acknowledgment messages, and the field content remained consistent, the server determined that the client was using cached historical acknowledgment messages for mirroring and marked the corresponding communication session as a suspected replay attack session.
[0059] Preferably, performing loop-back mapping on the repeated offset distance combinations in the cyclic offset chain includes: Extract the repeated offset distance combinations in the cyclic offset chain and record the corresponding offset directions; The end offset position of the repeated offset distance combination is associated with the beginning offset position of the next repeated offset distance combination to determine the offset loop connection relationship; Based on the offset loop connection relationship, a closed-loop path mapping is performed on the repeated offset distance combination to obtain the corresponding offset loop region; Extract the repeated intersection positions in each offset loop region and mark the repeated intersection positions as field loop offset nodes.
[0060] In one embodiment, an HTTPS secure access server in an enterprise data center is used as an example. This HTTPS secure access server is deployed in the enterprise's DMZ security zone and establishes encrypted communication connections with external clients through a TLS secure communication module.
[0061] The server extracts repeated offset distance combinations from the circular offset chain and records the corresponding offset directions. For example, during the TLS handshake phase, the server continuously receives multiple acknowledgment messages A1 to A8 sent by the client and extracts the offset sequence "(+1,+1,+1,-3,+1,+1,+1,-3)" from the "Session-ID" field. Offset chain analysis reveals that the combination "(+1,+1,+1,-3)" appears repeatedly, thus identifying it as a repeated offset distance combination. Simultaneously, the corresponding offset direction is recorded, where "+1" indicates the field is offset backward, and "-3" indicates the field wraps back from the end to the beginning.
[0062] Subsequently, the server associates the end offset position of the repeated offset distance combination with the start offset position of the next repeated offset distance combination to determine the offset loop connection relationship. For example, after the first set of "(+1,+1,+1,-3)" combinations ends, the "Session-ID" field returns to the starting area of the field arrangement, and the second set of offset combinations continues the same offset behavior from this starting area. Based on this, the end position of the first set of offset combinations is connected with the start position of the second set of offset combinations, thus forming a cyclic connection relationship of field positions.
[0063] Next, the server maps closed-loop paths to repeated offset distance combinations based on offset loop connections, obtaining corresponding offset loop regions. For example, based on the field arrangement position change process, the cyclic offset process of "position 1 → position 2 → position 3 → position 4 → return to position 1" is mapped as a closed-loop path, forming a corresponding offset loop region in the field arrangement space. Simultaneously, the server performs overlay analysis on multiple recurring closed-loop paths to detect whether there are continuously repeating fixed offset trajectories.
[0064] Subsequently, the server extracts the repeated intersection positions in each offset loop region and marks these repeated intersection positions as field cycle offset nodes. For example, if multiple offset loops are found to have repeated intersections at both the "1st field position" and the "4th field position", these repeated intersection positions are marked as field cycle offset nodes. Simultaneously, the server records the occurrence time, loop count, and associated message number of the corresponding node.
[0065] For example, during an HTTPS handshake, the server discovered that a client's acknowledgment message consistently maintained a cyclic offset structure of "Session-ID→Timestamp→MAC→Status," with a fixed loop at the beginning and end of the field arrangement. Since normal TLS handshake messages typically do not maintain a fixed loop offset structure for extended periods, the server marked this cyclic offset node as an abnormal reuse node and determined that the corresponding communication link exhibited suspected replay attack behavior using mirrored copies of historical acknowledgment messages.
[0066] Preferably, the closed-loop path mapping based on the offset loop connection relationship for repeated offset distance combinations includes: Based on the offset loop connection relationship, the repeated offset distances with first and last connections are combined and the paths are concatenated. Using the starting and ending offset positions of each repeated offset distance combination as the endpoints of the path mapping, construct the corresponding offset path; The repeated locations traversed in the corresponding offset path are closed-loop merged to form the corresponding offset closed-loop path; Extract the offset coverage area enclosed by each offset closed loop path to obtain the corresponding offset loop region.
[0067] In one embodiment, an HTTPS secure access server in an enterprise data center is used as an example. This HTTPS secure access server is deployed in the enterprise's DMZ security zone and establishes secure connections with external clients through a TLS secure communication module.
[0068] Based on the offset loop connection relationship, the server concatenates repeating offset distance combinations with beginning and end associations. For example, during the TLS handshake phase, the server continuously receives acknowledgment messages A1 to A8 sent by the client and extracts the repeating offset distance combination "(+1,+1,+1,-3)" from the "Session-ID" field. It finds that the field position after the end of this combination returns to the beginning of the next combination, therefore, the first set of offset combinations is concatenated with the second set of offset combinations, thus forming a continuous offset path chain.
[0069] Subsequently, the server constructs corresponding offset paths using the starting and ending offset positions of each repeated offset distance combination as path mapping endpoints. For example, when the "Session-ID" field moves sequentially from position 1 to position 2, position 3, and position 4, and then returns to position 1 via an offset of "-3", position 1 is determined as the path start point, and the looped position 1 is determined as the path end point. A corresponding offset path is then established in the field arrangement space. Simultaneously, the movement direction, offset distance, and corresponding acknowledgment message number in each offset path are recorded.
[0070] Next, the server performs closed-loop merging on the repeated locations traversed in the corresponding offset paths, forming corresponding offset closed-loop paths. For example, if multiple offset paths repeatedly pass through "field 1 position" and "field 4 position", these repeated locations are used as closed-loop connection points for path merging, thus forming a complete offset closed-loop path of "position 1 → position 2 → position 3 → position 4 → back to position 1". In this way, the originally scattered field offset behavior can be reconstructed into a closed-loop trajectory structure with cyclic loop characteristics.
[0071] Subsequently, the server extracts the offset coverage area enclosed by each offset closed-loop path to obtain the corresponding offset loopback area. For example, based on the cyclic movement range of the field arrangement position, it extracts all field arrangement areas covered between "position 1 to position 4" and generates the corresponding offset loopback area. Simultaneously, the server performs overlay analysis on the offset loopback areas in different acknowledgment messages. When multiple loopback areas continuously and repeatedly cover the same field arrangement range, it is determined that the area exhibits fixed field cyclic reuse behavior.
[0072] For example, during an HTTPS handshake, the server discovered that multiple consecutive acknowledgment messages returned by a client maintained a fixed cyclic offset path for each field. The "Session-ID" field consistently moved in a closed loop: "1st bit → 2nd bit → 3rd bit → 4th bit → back to 1st bit," with the corresponding field content remaining consistent. Since the field arrangement in a normal TLS handshake typically does not maintain a fixed closed-loop offset structure for an extended period, the server marked this offset loop area as an abnormal mirror reuse area and further determined that the corresponding communication link exhibited suspected replay attack behavior.
[0073] Preferably, the offset coverage area enclosed by each offset closed-loop path is extracted as follows: Extract continuous offset position points in each offset closed loop path, and establish corresponding connection edges according to the offset direction; When the ending offset of an adjacent connecting edge coincides with the starting offset of a subsequent connecting edge, the corresponding connecting edge will be folded back and spliced. Based on the connecting edges at each position after the back-and-forth splicing, a corresponding offset enclosing chain is formed; Extract the field position ranges within each offset bounding chain that are not crossed by the offset path, and mark the corresponding field position ranges as the offset coverage area; Generate the corresponding offset loop region based on the offset coverage area.
[0074] In one embodiment, an HTTPS secure access server in an enterprise data center is used as an example. This HTTPS secure access server is deployed in the enterprise's DMZ security zone and establishes secure connections with external clients through a TLS secure communication module.
[0075] The server extracts consecutive offset points from each offset closed-loop path and establishes corresponding connection edges according to the offset direction. For example, during the TLS handshake phase, the server continuously receives acknowledgment messages A1 to A8 sent by the client and extracts the offset closed-loop path "position 1 → position 2 → position 3 → position 4 → back to position 1" from the "Session-ID" field. Each field position is used as an offset point, and corresponding connection edges are established according to the field's movement direction. For example, a first connection edge is established from "position 1 to position 2", a second connection edge from "position 2 to position 3", and a loop connection edge from "position 4 back to position 1".
[0076] Subsequently, when the ending offset of an adjacent connecting edge coincides with the starting offset of a subsequent connecting edge, the server performs a loop-back concatenation on the corresponding connecting edge. For example, the ending position "position 2" of the first connecting edge is the same as the starting position "position 2" of the second connecting edge, so the two connecting edges are concatenated continuously. Similarly, when the loop-back connecting edge "returning from position 4 to position 1" coincides again with the starting connecting edge of the next cycle, the loop-back concatenation continues, thus forming a continuous cyclical field offset structure.
[0077] Next, the server forms a corresponding offset enclosing chain based on the connecting edges at each position after the back-and-forth stitching. For example, all connecting edges in the sequence "position 1 → position 2 → position 3 → position 4 → position 1" are combined in a closed loop to form a complete offset enclosing chain. This offset enclosing chain is used to represent the cyclic offset coverage trajectory of a field in multiple acknowledgment messages. At the same time, the field name, offset direction, and associated message number corresponding to the enclosing chain are also recorded synchronously.
[0078] Subsequently, the server extracts the field position ranges within each offset enclosing chain that are not crossed by the offset path, and marks the corresponding field position ranges as the offset coverage area. For example, if the offset path of the "Session-ID" field is detected to always cycle between "position 1 to position 4" and there is no field offset behavior exceeding this area, then the field arrangement range between "position 1 to position 4" is determined as the offset coverage area. If a field offset path repeatedly covers the same field arrangement area, the abnormal reuse level of that area is further increased.
[0079] Finally, the server generates corresponding offset loopback regions based on the offset coverage range. For example, the offset coverage range from "position 1 to position 4" is mapped to a field loopback region, and a corresponding field loopback identifier is established. Simultaneously, the server performs overlay analysis on the offset loopback regions in multiple acknowledgment messages. When multiple messages are found to continuously maintain the same offset coverage range and the same loopback structure, it is determined that the communication link exhibits suspected replay attack behavior involving the cyclical copying of fixed fields using historical acknowledgment messages.
[0080] For example, during an HTTPS handshake, the server discovers that multiple consecutive acknowledgment messages returned by a client maintain a cyclical offset of the "Session-ID," "Timestamp," and "MAC" fields within a fixed range, forming a recurring closed-loop coverage path. Since normal TLS handshake messages typically do not maintain a fixed offset coverage area for an extended period, the server marks the corresponding offset loop area as an abnormal mirror reuse area and further triggers subsequent replay attack interception procedures.
[0081] Of particular importance, calculating message field reuse similarity through mirror reuse analysis data includes: Extract the repeated positions, offset trajectories, and field arrangement order of fields from the mirror reuse analysis data; Using the repeated positions of fields as the mapping base point, the field offset trajectories in different confirmation messages are mirrored and aligned. Calculate the fields that overlap after mirroring and alignment, and generate the corresponding field overlap coverage length; The message field reuse similarity is calculated based on the correspondence between the field overlap length and the total length of the field arrangement.
[0082] In one embodiment, an HTTPS secure access server in an enterprise data center is used as an example. This HTTPS secure access server is deployed in the enterprise's DMZ security zone and establishes encrypted communication connections with multiple clients through a TLS secure communication module.
[0083] The server extracts the repeated positions, offset trajectories, and field order from the image reuse analysis data. For example, during the TLS handshake phase, the server continuously receives acknowledgment messages A1, A2, A3, and A4 from the client and extracts the arrangement structure of fields such as "Session-ID," "Timestamp," "MAC," and "Handshake-Status." It was found that the "Session-ID" field in multiple acknowledgment messages consistently cycles between positions 1 and 4, while the MAC field repeatedly offsets between positions 2 and 3. Based on this, the server extracts the corresponding data on repeated field positions, field offset trajectories, and field order.
[0084] Subsequently, the server uses the repeated positions of fields as mapping base points to mirror and align the field offset trajectories in different acknowledgment messages. For example, the repeated position of the "Session-ID" field in message A1 is used as the first mapping base point, and the offset trajectory of the corresponding field in message A2 is mirrored in the opposite direction, so that the field offset paths in the two messages can overlap and align within the same field arrangement space. Similarly, the offset trajectories of the MAC field and status response field are mirrored and mirrored to establish a mirrored offset correspondence between different acknowledgment messages.
[0085] Next, the server counts the overlapping field segments after mirroring and alignment, and generates the corresponding field overlap coverage length. For example, after completing the mirroring and alignment of A1 and A2 packets, it is found that the arrangement paths of the three fields "Session-ID→Timestamp→MAC" are completely overlapping, and the corresponding offset trajectories are also consistent. Therefore, this continuous overlapping area is marked as a field overlap segment. At the same time, the server further counts the field arrangement length covered by this overlapping segment. For example, if it continuously covers three field positions, the corresponding field overlap coverage length data is generated.
[0086] Subsequently, the server calculates the message field reuse similarity based on the correspondence between the field overlap length and the total field length. For example, if the total field length of the message is confirmed to be 4, and 3 of the fields remain completely overlapped after mirroring, the server generates the corresponding reuse similarity result based on the ratio between the field overlap length and the total field length. Simultaneously, the server also considers the consistency of field offset direction and the repetition rate of field content for a comprehensive calculation.
[0087] For example, during an HTTPS handshake, the server discovered that multiple consecutive acknowledgment messages returned by a client, after mirroring and realigning, showed that most of the field arrangement sections overlapped, and the field offset trajectories maintained a fixed cyclic structure. Specifically, the "Session-ID," "MAC," and "Timestamp" fields formed consecutive overlapping areas, and their contents remained consistent. Since a high degree of overlap in field arrangement is not typically maintained for an extended period during a normal TLS handshake, the server, based on the calculated high field reuse similarity, determined that the communication link was experiencing a replay attack using mirrored copies of historical acknowledgment messages, and initiated the subsequent communication link closure process.
[0088] Most importantly, using the repeated positions of fields as the mapping base point, the mirroring and alignment of field offset trajectories in different acknowledgment messages is specifically performed as follows: Extract the repeated positions of fields in different confirmation messages and mark the repeated positions of fields as trajectory mapping base points; Using the trajectory mapping base point as the center, reverse the offset direction in the corresponding field offset trajectory and generate a reverse offset trajectory; Perform trajectory overlap mapping on the turnaround offset trajectories in different confirmation messages according to the field arrangement order; Extract the overlapping offset segments after trajectory overlap mapping, and complete the field offset trajectory mirroring and alignment in different confirmation messages.
[0089] In one embodiment, an HTTPS secure access server in an enterprise data center is used as an example. This HTTPS secure access server is deployed in the enterprise's DMZ security zone and establishes encrypted communication connections with external clients through a TLS secure communication module.
[0090] The server extracts the repeated positions of fields from different acknowledgment messages and marks these repeated positions as trajectory mapping base points. For example, during the TLS handshake phase, the server continuously receives acknowledgment messages A1, A2, A3, and A4 sent by the client. The field parsing module extracts the positional arrangement of the "Session-ID," "Timestamp," and "MAC" fields from multiple acknowledgment messages and finds that the "Session-ID" field appears repeatedly in the first and fourth field positions in multiple acknowledgment messages. Based on this, these repeated field positions are marked as trajectory mapping base points for subsequent field offset trajectory alignment analysis.
[0091] Subsequently, the server uses the trajectory mapping base point as the center and performs reverse folding processing on the offset direction of the corresponding field's offset trajectory to generate a folded offset trajectory. For example, in acknowledgment message A1, the offset trajectory of the "Session-ID" field is "position 1 → position 2 → position 3 → position 4"; while in acknowledgment message A2, the corresponding field trajectory is reverse folded according to the mapping base point, transforming its trajectory into "position 4 → position 3 → position 2 → position 1". In this way, the field offset paths in different messages can be converted to a unified mirror direction.
[0092] Next, the server performs trajectory overlap mapping on the foldback offset trajectories in different acknowledgment messages according to the field arrangement order. For example, the original offset trajectory in message A1 and the foldback offset trajectory in message A2 are simultaneously projected onto the same field arrangement space, and position overlap analysis is performed according to the field appearance order. When the two field trajectories remain consistent within the same field arrangement interval, the corresponding trajectory segment is determined to be a mirrored overlapping trajectory segment.
[0093] Subsequently, the server extracts the overlapping offset segments after trajectory overlap mapping and performs mirror alignment of the field offset trajectories in different acknowledgment messages. For example, after trajectory overlap mapping, it is found that the offset trajectories of the three fields "Session-ID→Timestamp→MAC" in A1 and A2 are completely overlapping, forming a continuous mirror overlap segment. Therefore, the server extracts this continuous overlapping trajectory and performs mirror alignment of the field offset trajectories in different acknowledgment messages. At the same time, it also records the coverage length, offset direction, and associated acknowledgment message number of the corresponding overlapping segment.
[0094] For example, during an HTTPS handshake, the server discovered that although the field order of multiple consecutive acknowledgment messages returned by a client was mirrored, their field offset trajectories remained highly consistent after alignment. Specifically, the "Session-ID," "MAC," and "Timestamp" fields formed consecutive overlapping trajectories, and their contents were identical. Since field trajectories in a normal TLS handshake typically do not maintain a mirrored alignment for extended periods, the server ultimately determined that the communication link contained a suspected replay attack using mirrored copies of historical acknowledgment messages and triggered subsequent security blocking procedures.
[0095] The present invention also provides a secure communication system for a secure server, used to execute the secure communication method for a secure server as described above, the secure communication system for the secure server comprising: The handshake receiving module is used to receive handshake communication requests sent by the client and record multiple acknowledgment messages sent consecutively by the same client during the handshake phase. The offset analysis module is used to perform position offset analysis on the field arrangement order in multiple acknowledgment messages and generate the message field arrangement trajectory. The reuse detection module is used to detect and confirm the reuse pattern of fields in the message based on the arrangement trajectory of message fields, and to determine whether there is a replay attack behavior formed by copying fixed message fields. The session marking module is used to control the server to mark the corresponding communication session as a suspected mirror replay session based on the judgment result; The disturbance detection module is used to insert a position disturbance field into suspected mirror replay sessions and detect whether the client retains the corresponding position disturbance field in subsequent returned packets. The attack detection module is used to determine if a replay attack has occurred on the corresponding communication link when the client subsequently returns a message that does not synchronously retain the corresponding perturbation field, and then shuts down the corresponding communication link.
[0096] Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of the equivalents of the application are intended to be included within the invention.
[0097] The above description is merely a specific embodiment of the present invention, enabling those skilled in the art to understand or implement the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the present invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features of the invention herein.
Claims
1. A secure communication method for a secure server, characterized in that, The method, applied to a communication link between a server and a client, includes the following steps: Step S1: Receive the handshake communication request sent by the client and record multiple acknowledgment messages sent consecutively by the same client during the handshake phase; Step S2: Perform position offset analysis on the field arrangement order in multiple confirmation messages to generate the message field arrangement trajectory; Step S3: Based on the detection of the packet field arrangement trajectory, confirm the field reuse pattern in the packet, and determine whether there is a replay attack behavior formed by copying fixed packet fields; Step S4: Based on the judgment result, the control server marks the corresponding communication session as a suspected mirror replay session; Step S5: Insert a position perturbation field into the suspected mirror replay session, and check whether the client retains the corresponding position perturbation field in subsequent returned packets; Step S6: When the client returns a message that does not synchronously retain the corresponding perturbation field, it is determined that there is a replay attack on the corresponding communication link, and the corresponding communication link is closed.
2. The secure communication method for a secure server according to claim 1, characterized in that, Step S3 includes the following steps: Step S31: Extract the session identifier field, timestamp field, checksum field, and status response field from the acknowledgment message, and generate a field arrangement sequence according to the order in which the fields appear; Step S32: Obtain field position offset data based on the position changes of the same field content in the message according to the field arrangement sequence; Step S33: Based on the field position offset data, detect whether the same field content appears cyclically according to a fixed offset pattern to obtain the field reuse trajectory; Step S34: Perform message association mapping on the field multiplexing trajectory to generate mirror multiplexing analysis data; Step S35: Calculate the message field reuse similarity through mirror reuse analysis data. When the message field reuse similarity is greater than the preset similarity threshold, it is determined that there is a replay attack behavior formed by copying fixed message fields.
3. The secure communication method for a secure server according to claim 2, characterized in that, Step S32 includes the following steps: Obtain the order in which the acknowledgment messages were received; Based on the order of receipt time, confirm the position number of each field in the field arrangement sequence; Extract the target field with the same content from multiple consecutive field position numbers, and record the position changes of the target field in different acknowledgment messages; Calculate the position offset distance and offset direction of the corresponding target field based on the position change of the target field; Detect whether the target field exhibits a regular movement behavior with a fixed step size offset, and generate field offset trajectory data; Field position offset data is obtained based on field offset trajectory data.
4. The secure communication method for a secure server according to claim 3, characterized in that, The detection of whether a target field exhibits a regular movement behavior with a fixed step size offset is based on the target field's position offset distance and offset direction. Extract the position offset distance and offset direction of the target field in consecutive acknowledgment messages; The end position of the target field in the previous acknowledgment message is used as the position offset base point of the next acknowledgment message, and the cross-segment offset step size of the corresponding target field is calculated. Detect whether the cross-segment offset step size of multiple consecutive target fields remains consistent, and determine whether the corresponding offset direction always faces the same field arrangement area; When multiple consecutive target fields move towards the same field arrangement area with the same cross-segment offset step size, it is determined that the target fields have a regular movement behavior with a fixed step size offset, and the corresponding field offset trajectory data is generated.
5. The secure communication method for a secure server according to claim 2, characterized in that, Detecting whether identical field content appears cyclically according to a fixed offset pattern based on field position offset data includes: Extract the position offset distance and offset direction of the same field content in the field position offset data; Based on the order in which the acknowledgment messages are received, the positional offset distances of the same field content are arranged consecutively to generate a field offset sequence; Determine whether the content of the same field appears cyclically according to a fixed offset pattern by using the field offset sequence; Generate corresponding field reuse trajectories based on the cyclic offset order of the same field content.
6. The secure communication method for a secure server according to claim 5, characterized in that, Determining whether identical field content appears cyclically according to a fixed offset pattern by using field offset sequences includes: Window truncation is performed on consecutive offset distances in the field offset sequence to generate corresponding offset distance combinations; The various offset distance combinations are spliced together end to end according to the offset direction to generate a cyclic offset chain; Perform a loop-back mapping on the repeated offset distance combinations in the cyclic offset chain to obtain the field cyclic offset node; Based on the order in which the field cyclic offset nodes appear repeatedly in different acknowledgment messages, a fixed offset cyclic trajectory with the same field content is generated.
7. The secure communication method for a secure server according to claim 6, characterized in that, Loop closure mapping for repeated offset distance combinations in a circular offset chain includes: Extract the repeated offset distance combinations in the cyclic offset chain and record the corresponding offset directions; The end offset position of the repeated offset distance combination is associated with the beginning offset position of the next repeated offset distance combination to determine the offset loop connection relationship; Based on the offset loop connection relationship, a closed-loop path mapping is performed on the repeated offset distance combination to obtain the corresponding offset loop region; Extract the repeated intersection positions in each offset loop region and mark the repeated intersection positions as field loop offset nodes.
8. The secure communication method for a secure server according to claim 7, characterized in that, Closed-loop path mapping based on offset loop connection relationships for repeated offset distance combinations includes: Based on the offset loop connection relationship, the repeated offset distances with first and last connections are combined and the paths are concatenated. Using the starting and ending offset positions of each repeated offset distance combination as the endpoints of the path mapping, construct the corresponding offset path; The repeated locations traversed in the corresponding offset path are closed-loop merged to form the corresponding offset closed-loop path; Extract the offset coverage area enclosed by each offset closed loop path to obtain the corresponding offset loop region.
9. The secure communication method for a secure server according to claim 8, characterized in that, The specific details of extracting the offset coverage area enclosed by each offset closed-loop path are as follows: Extract continuous offset position points in each offset closed loop path, and establish corresponding connection edges according to the offset direction; When the ending offset of an adjacent connecting edge coincides with the starting offset of a subsequent connecting edge, the corresponding connecting edge will be folded back and spliced. Based on the connecting edges at each position after the back-and-forth splicing, a corresponding offset enclosing chain is formed; Extract the field position ranges within each offset bounding chain that are not crossed by the offset path, and mark the corresponding field position ranges as the offset coverage area; Generate the corresponding offset loop region based on the offset coverage area.
10. A secure communication system for a secure server, characterized in that, For executing the secure communication method of the secure server as described in claim 1, the secure communication system of the secure server includes: The handshake receiving module is used to receive handshake communication requests sent by the client and record multiple acknowledgment messages sent consecutively by the same client during the handshake phase. The offset analysis module is used to perform position offset analysis on the field arrangement order in multiple acknowledgment messages and generate the message field arrangement trajectory. The reuse detection module is used to detect and confirm the reuse pattern of fields in the message based on the arrangement trajectory of message fields, and to determine whether there is a replay attack behavior formed by copying fixed message fields. The session marking module is used to control the server to mark the corresponding communication session as a suspected mirror replay session based on the judgment result; The disturbance detection module is used to insert a position disturbance field into suspected mirror replay sessions and detect whether the client retains the corresponding position disturbance field in subsequent returned packets. The attack detection module is used to determine if a replay attack has occurred on the corresponding communication link when the client subsequently returns a message that does not synchronously retain the corresponding perturbation field, and then shuts down the corresponding communication link.
