(19)
(11)EP 3 432 533 B1

(12)EUROPEAN PATENT SPECIFICATION

(45)Mention of the grant of the patent:
22.07.2020 Bulletin 2020/30

(21)Application number: 16913982.1

(22)Date of filing:  31.10.2016
(51)International Patent Classification (IPC): 
H04L 29/06(2006.01)
H04L 12/26(2006.01)
H04L 12/807(2013.01)
H04L 12/801(2013.01)
(86)International application number:
PCT/CN2016/104103
(87)International publication number:
WO 2018/035962 (01.03.2018 Gazette  2018/09)

(54)

METHOD AND SYSTEM FOR PROCESSING FORGED TCP DATA PACKET

VERFAHREN UND SYSTEM ZUR VERARBEITUNG EINES GEFÄLSCHTEN TCP-DATENPAKETS

PROCÉDÉ ET SYSTÈME DE TRAITEMENT DE PAQUET DE DONNÉES TCP FALSIFIÉ


(84)Designated Contracting States:
AL AT BE BG CH CY CZ DE DK EE ES FI FR GB GR HR HU IE IS IT LI LT LU LV MC MK MT NL NO PL PT RO RS SE SI SK SM TR

(30)Priority: 26.08.2016 CN 201610743506

(43)Date of publication of application:
23.01.2019 Bulletin 2019/04

(73)Proprietor: Wangsu Science & Technology Co., Ltd.
Shanghai 200030 (CN)

(72)Inventor:
  • CHEN, Hong
    Shanghai 200030 (CN)

(74)Representative: Hanna Moore + Curley 
Garryard House 25/26 Earlsfort Terrace
Dublin 2, D02 PX51
Dublin 2, D02 PX51 (IE)


(56)References cited: : 
WO-A1-2009/059545
CN-A- 102 655 509
CN-A- 106 101 161
US-B2- 8 811 419
CN-A- 101 989 985
CN-A- 105 847 283
US-B2- 7 607 170
US-B2- 9 253 104
  
      
    Note: Within nine months from the publication of the mention of the grant of the European patent, any person may give notice to the European Patent Office of opposition to the European patent granted. Notice of opposition shall be filed in a written reasoned statement. It shall not be deemed to have been filed until the opposition fee has been paid. (Art. 99(1) European Patent Convention).


    Description

    FIELD OF THE DISCLOSURE



    [0001] The present disclosure generally relates to the technical field of network safety and, more particularly, relates to a method and a system for processing forged TCP packets.

    BACKGROUND



    [0002] TCP (Transmission Control Protocol) is a connection-oriented and reliable transport layer communication protocol based on byte stream. TCP may be the most basic protocol of the Internet, and is the basis of the Internet. As the network technology develops, for various purposes, more and more attackers have started to utilize vulnerabilities of the TCP protocol to attack the network. For example, a common attacking approach is to forge the TCP packet. As an example, the client may establish a connection with the server after the TCP three-way handshake; later, the client may send a request packet to the server; a hijacking device may listen for the request packet via a listening device and send a forged acknowledgement packet to the client; if no process is performed, the forged acknowledgement packet may arrive at the client earlier than a valid acknowledgement packet from the server, thereby replacing the server to communicate with the client. In such way, hijacking of the client is realized, which makes the client to believe it is communicating with the server while, in fact, communication is between the client and the hijacking device.

    [0003] To improve the network safety and avoid the occurrence of the hijacking situations, the user requests higher requirements on the detection of network attacking by the forged TCP packet. In existing technology, methods such as examining whether the TTL (time to live) field of the IP packet header is reasonable, or whether the identification field is regular, are often used to find and discard the forged TCP packet. However, such methods are either too complicated to implement because detection is needed to improve the accuracy, or they show a low accuracy due to the simplified processing, which easily leads to misjudgment or omission of judgment. Thus, there is a need for developing a method that rapidly and conveniently processes the forged TCP packet with high accuracy. US patent US8811419B2 is further prior art.

    BRIEF SUMMARY OF THE DISCLOSURE



    [0004] The present disclosure provides an improved method for processing forged TCP packet, comprising:

    receiving a to-be-processed TCP packet, where a header of the to-be-processed TCP packet includes a window size field;

    based on the to-be-processed TCP packet, searching a TCP receive window reference table to find out whether a record related to the to-be-processed TCP packet exists;

    if a record related to the to-be-processed TCP packet exists in the TCP receive window reference table, calculating a receive window value of the to-be-processed TCP packet from the window size field in the header of the to-be-processed TCP packet and a receive window scaling factor field in the record related to the to-be-processed TCP packet;

    comparing the receive window value of the to-be-processed TCP packet and an actual receive window value in the record related to the to-be-processed TCP packet to obtain a deviation therebetween; and

    comparing the deviation with a preset threshold to determine whether the to-be-processed TCP packet is a forged packet.



    [0005] In another aspect of the present disclosure, a system for processing forged TCP packet is provided, comprising:

    a device for receiving a to-be-processed TCP packet, where a header of the to-be-processed TCP packet includes a window size field;

    a device for, based on the to-be-processed TCP packet, searching a TCP receive window reference table to find out whether a record related to the to-be-processed TCP packet exists;

    a device for, if a record related to the to-be-processed TCP packet exists in the TCP receive window reference table, calculating a receive window value of the to-be-processed TCP packet from the window size field in the header of the to-be-processed TCP packet and a receive window scaling factor field in the record related to the to-be-processed TCP packet;

    a device for comparing the receive window value of the to-be-processed TCP packet and an actual receive window value in the record related to the to-be-processed TCP packet to obtain a deviation therebetween; and

    a device for comparing the deviation with a preset threshold, where via a comparison result of the device, whether the TCP packet is a forged packet is determined.



    [0006] The key of the present disclosure lies in the utilization of the window size field in the header of the to-be-processed TCP packet and the window scaling factor to calculate the receive window value of the to-be-processed TCP packet, and in the comparison of the calculated receive window value of the to-be-processed TCP packet with the actual receive window. If a relatively large deviation exists between the receive window value of the to-be-processed TCP packet and the actual receive window value, the to-be-processed TCP packet is determined to be a forged TCP packet and is correspondingly processed.

    BRIEF DESCRIPTION OF THE DRAWINGS



    [0007] From a reading of the following detailed descriptions of embodiments illustrated using non-limiting examples, the present disclosure may be better understood and advantages of the present disclosure may be better reflected. In the accompanying drawings:

    FIG. 1 illustrates a structural schematic view of a header of a TCP packet;

    FIG. 2 illustrates a schematic view showing a process of TCP three-way handshake that establish a connection;

    FIG. 3 illustrates a structural schematic view of a window scaling factor option carried by a SYN packet (may also referred to as "<SYN> packet") sent during TCP three-way handshake;

    FIG. 4 illustrates a structural schematic view of data recorded in a TCP receive window reference table according to embodiments of the present disclosure;

    FIG. 5 illustrates a flowchart of a method for establishing and/or updating a TCP receive window reference table according to embodiments of the present disclosure; and

    FIG. 6 illustrates a flowchart of a method for processing a forged TCP packet according to embodiments of the present disclosure.


    DETAILED DESCRIPTION



    [0008] To more clearly describe the objectives, technical solutions and advantages of the present disclosure, the present disclosure is further illustrated in detail with reference to the accompanying drawings in conjunction with embodiments.

    [0009] The present disclosure provides improved method and system for processing forged TCP packets. More specifically, the key point of the present disclosure lies in the utilization of the window size field in the header of the to-be-processed TCP packet and the window scaling factor to calculate the receive window value of the to-be-processed TCP packet, and in comparing the receive window value of the to-be-processed TCP packet with an actual receive window value. Further, based on a degree of deviation between the comparison result and the threshold, whether the to-be-processed TCP packet is forged is determined, thereby improving the probability of finding and further discarding the forged TCP packet. More specifically, in the present disclosure, a TCP receive window reference table that at least includes information of TCP connection tetrad (source IP, source port, destination IP, destination port), actual TCP receive window 'RCV.WND', and TCP receive window scaling factor 'Rcv.Wind.Scale' is established. By ensuring the accuracy of the RCV.WND value corresponding to the TCP connection and utilizing the TCP receive window reference table, the forged TCP packets may have a higher chance to be found (and discarded). Accordingly, the device may receive as few attacks from the forged TCP packets as possible.

    [0010] First, as shown in FIG. 1, a structural schematic view of a header of a TCP packet is illustrated. In particular, the 16-bit source port number identifies an application program sent out for transmission on a host, and the 16-bit destination port number identifies an application program transmitted for arrival on the host. The source port number and the destination port number are configured to find application processes at a sending end and a receiving end. Such two values (i.e., the source port number and the destination port number), together with the source IP address and the destination IP address in an IP header, determine a TCP connection. The TCP protocol uses 'ports' to identify the application processes at the source end and the destination end. The port number may use any digit varying from 0 to 65535. When sending a service request, the operating system dynamically allocates a port number for the application program of the client. At the server end, each kind of service provides service to the user at the "Well-Know Port".

    [0011] The 32-bit sequence number field is configured to identify data byte stream sent by a TCP source end to a TCP destination end, and represents the sequence number of the first data byte in a segment.

    [0012] For the 32-bit acknowledgement number field, only when the ACK bit is 1, the acknowledgement number field is valid. The 32-bit acknowledgement number field includes the sequence number of a next data byte expected by the destination end to receive from the source end.

    [0013] The 4-bit header length field gives how many 32 bits (4 bytes) the header includes. The length of the TCP header without any option field is 20 bytes, and the TCP header may have up to 60 bytes.

    [0014] The 6-bit reserved field includes 6 bits following the data offset field, and the reserved bit is often 0.

    [0015] The flag field (URG, ACK, PSH, RST, SYN, FIN) occupies 6 bits, and each bit has the following meaning:

    URG: the urgent pointer is valid

    ACK: the acknowledgement sequence number is valid

    PSH: the receiver needs to push the segment to the application layer as soon as possible

    RST: reset connection

    SYN: initiate a connection

    FIN: release a connection



    [0016] The 16-bit receive window size field is used for traffic control, where the unit is byte, and its value is the number of bytes that the host expects to receive at a time.

    [0017] The 16-bit checksum field is to validate and calculate the entire TCP segment (i.e., TCP header and TCP data), and the validation is performed by the destination end.

    [0018] The 16-bit urgent pointer field is an offset, and may represent a sequence number of the last byte of the urgent data if added with the value in the sequence number field.

    [0019] The option field can be up to 40 bytes and may include options such as "window scaling factor", and "timestamp".

    [0020] In technical solutions of the present disclosure, the receive window size field is labeled as SEG.WND, which represents the receive window of the sending end. TCP completes initialization of the receive windows of the two communication participators through the three-way handshake.

    [0021] In FIG. 2, a schematic view showing a process of TCP three-way handshake is illustrated.

    [0022] First, in the first handshake, the client generates a <SYN> packet, sets a SYN bit to 1 (i.e.. SYN=1), randomly generates a sequence number SEQ=X, and sends the <SYN> packet to the server. Further, the client enters a status of SYN_SENT and waits for acknowledge from the server.

    [0023] In the second handshake: after receiving the <SYN> packet, the server is informed by SYN=1 that the client requests to establish a connection. The server thus generates a <SYN, ACK> packet, sets a SYN bit to 1, configures an acknowledgement number ACKnum=X+1, and randomly generates a sequence number SEQ=Y. Further, the server sends the <SYN, ACK> packet to the client for acknowledgement of the connection request, and the server enters a status of SYN_RCVD.

    [0024] In the third handshake: after receiving the acknowledgement (i.e.. the <SYN, ACK> packet), the client examines whether the acknowledgement number ACKnum is X+1. If the acknowledgement number ACKnum is X+1, the client generates an <ACK> packet, sets an ACK bit to 1, configures an acknowledgement number ACKnum=Y+1, sets a SYN bit to 0, and randomly generates a sequence number SEQ=Z. Further, the client sends the <ACK> packet to the server, and the server checks whether ACKnum is Y+1. If ACKnum in the <ACK> packet is Y+1, the connection is successful, and the client and the server go into the ESTABLISHED status.

    [0025] Through the TCP connection established by the three-way handshake, data can be transmitted between the client and the server.

    [0026] With reference to the aforementioned descriptions of FIG. 2, the process of TCP three-way handshake may be clearly understood.

    [0027] In FIG. 3, a structural schematic view of a window scaling factor option carried by a SYN packet (the SYN bit in a header of the TCP packet being set) sent during TCP three-way handshake is illustrated. In the option structure, the first field "Kind" in the option indicates the type of the option. When Kind=3, the option is indicated to be the window scaling factor option. When the TCP connection is initialized, the two communication participators use such option to negotiate the scaling factor of the receive window. In the header of the TCP, the receive window size is represented by 16 bits, and thus the maximum receive window size is 65535 bytes. In fact, the receive window size allowable by TCP may need to be far greater than 65535 bytes (to improve the throughput of the TCP communication). The window scaling factor solves such issue. Assume the receive window size in the TCP header is N and the window scaling factor (bit-shifting number) is M, the actual receive window size is equal to N multiplied by 2M, namely, N being shifted to the left by M bits. It should be noted that, the value range of M is 0∼14.

    [0028] The second field "Length" in the option structure refers to the total length of the option structure, and the total length include the two bytes occupied by the "Kind" field and the "Length" field.

    [0029] The option structure further includes a "shift.cnt" field, and the value of the receive window scaling factor (Rcv. Wind. Scale) is the value of the "shift.cnt" field. The value range of shift.cnt is 0∼14, that is, the maximum TCP sequence number is defined by 216∗214=230<231. Such definition is applied to prevent the byte sequence number from overflowing. Further, the receive window scaling factor is an option, and its value may be determined through the SYN packet in the TCP three-way handshake stage. The window scaling factor option carried in a TCP packet whose header is not configured with a SYN bit may be ignored. If the two communication participators both launch window scaling, other than the SYN packet (with a receive window RCV.WND equal to the window size field SEG.WND), RCV.WND values of other TCP packets may be calculated by left shifting the window size field SEG.WND by Rcv.Wind. Scale bits, namely:



    [0030] For example, as described previously, assume the receive window size in the TCP header is N and the window scaling factor (bit-shifting number) is M, the actual receive window size of the TCP segment is thus N multiplied by 2M, namely, N left shifted by M bits.

    [0031] Often, the variation of the RCV.WND value of the TCP connection is smooth, and a jump may not occur (the so-called "jump" means a new value being 1.5 times or more greater than a previous value). By utilizing such feature, a TCP receive window reference table recording an actual RCV.WND may be established, and by determining whether a receive window of a TCP packet satisfies the table, whether the TCP packet is a forged TCP packet may be determined. It should be noted that, the actual RCV.WND here is the RCV.WND of the packet corresponding to the TCP second handshake <SYN, ACK>.

    [0032] The TCP receive window reference table is often configured in a gateway device. It should be understood that, the gateway device here may be a safety device such as a safety detection device or a firewall. In one implementation, the TCP receive window reference table may be established based on the RCV.WND obtained in the TCP second handshake <SYN, ACK>. The TCP receive window reference table may include major information such as a TCP connection tetrad (source IP, source port, destination IP, destination port), an actual TCP receive window 'RCV.WND', and a TCP receive window scaling factor 'Rcv.Wind.Scale'. It should be noted that the information stored in the receive window reference table is information related to the actual host.

    [0033] In FIG. 4, a structural schematic view of data recorded in a TCP receive window reference table is specifically illustrated according to embodiments of the present disclosure. As shown in FIG. 4, the reference table includes the following fields:

    the "Key value" field (optional), representing a hash value calculated based on the TCP connection tetrad for convenient and rapid search;

    the "connection tetrad" field, including the source IP, the source port, the destination IP, and the destination port;

    the "actual receive window" field, representing that the actual RCV.WND value of the TCP connection, where such value may be obtained from the window size field SEG.WND of the packet corresponding to the TCP second handshake <SYN, ACK>;

    the "receive window scaling factor" field, representing the receive window scaling factor (Rcv.Wind.Scale) of the TCP connection, which may be obtained from the field "shift.cnt" in the window scaling factor option carried by the packet corresponding to the TCP second handshake <SYN, ACK>; and

    the "creation time" field (optional), representing the creation time of the table.



    [0034] After a detailed introduction of the structure of the data recorded in the TCP receive window reference table, how to establish and update a record in the TCP receive window reference table will be illustrated in detail hereinafter with reference to FIG. 5 according to embodiments of the present disclosure.

    [0035] FIG. 5 illustrates a flowchart of a method for establishing and/or updating a TCP receive window reference table according to embodiments of the present disclosure. It should be understood that, the method may be applied to network devices such as a gateway device, a firewall, and a router. Further, it should be understood that updating the TCP receive window reference table includes operations such as adding, deleting, and modifying records in the reference table. The method may include the following steps:

    Step 502, from a received packet corresponding to a TCP second handshake <SYN, ACK>, extracting an actual TCP connection tetrad, a receive window value (i.e., RCV.WND value, obtained from a window size field SEG.WND), and a receive window scaling factor (i.e., Rcv.Wind.Scale, obtained from a "shift.cnt" field in a window scaling factor option, and if there is no window scaling factor option, the default value is 0);

    Step 504, based on the extracted connection tetrad, searching a TCP receive window reference table to determine whether a related record exists in the TCP receive window reference table;

    Step 506, if no record comprising the connection tetrad is found in the TCP receive window reference table, based on the obtained TCP connection tetrad, the receive window, and the receive window scaling factor, establishing a related record in the TCP receive window reference table; and

    Step 508, if a record comprising the connection tetrad exists in the TCP receive window reference table, using the obtained receive window and the receive window scaling factor to update content of corresponding fields in the record, where, optionally, the field of "creation time" may be updated.



    [0036] Further, in another embodiment, to save the storage space, old records showing a creation time relatively long time ago with respect to current time may be periodically deleted in the TCP receive window reference table.

    [0037] Further, in another embodiment, to speed up a searching rate, the key value calculated from the TCP connection tetrad may be applied to search through the TCP receive window reference table.

    [0038] After establishment of the TCP receive window reference table is completed, when a gateway device receives a TCP packet (excluding the SYN packet), a TCP receive window reference table may be searched based on the connection tetrad of the TCP packet. If a record comprising the same connection tetrad exists, the RCV.WND of the TCP packet may be compared with the receive window in the related record to obtain a deviation therebetween. If the deviation exceeds a preset threshold, the TCP packet may be suspected to be a forged TCP packet. Hereinafter, such process is illustrated in detail with reference to FIG. 6.

    [0039] As shown in FIG. 6, a flowchart of a method for processing a forged TCP packet is illustrated according to embodiments of the present disclosure, and the method comprises the following steps:

    Step 602, receiving a to-be-processed TCP packet (excluding the SYN packet), where a header of the to-be-processed TCP packet includes a window size field SEG.WND;

    Step 604, based on the to-be-processed TCP packet (e.g., a connection tetrad in the to-be-processed TCP packet), searching a TCP receive window reference table to find out whether a record related to the to-be-processed TCP packet, such as a related record comprising the same connection tetrad, exists;

    Step 606, if no related record comprising the same connection tetrad exists in the TCP receive window reference table, the process is terminated;

    Step 608, if a related record including the same connection tetrad exists in the TCP receive window reference table, calculating a receive window (RCV.WND) value of the to-be-processed TCP packet from the window size field SEG.WND in the header of the to-be-processed TCP packet and from a receive window scaling factor field Rcv.Wind.Scale in the related record, where, more specifically, the receive window value RCV.WND of the to-be- processed TCP packet is calculated from the window size field SEG.WND in the header of the to-be-processed TCP packet and the receive window scaling factor field Rcv.Wind. Scale in the related record according to equation 1;

    Step 610, comparing the RCV.WND value of the to-be-processed TCP packet with an actual RCV.WND value in the related record to obtain a deviation therebetween, where, more specifically, the deviation is calculated by dividing the RCV.WND value of the to-be-processed TCP packet by the actual RCV.WND value in the related record; and

    Step 612, comparing the deviation with a preset threshold.



    [0040] If the deviation exceeds the preset threshold, the to-be-processed TCP packet may highly likely be a forged TCP packet, and the method is jumped to Step 614 to execute a corresponding process on the to-be-processed TCP packet, for example, the to-be-processed packet may be discarded directly, or a related notice may be provided to a user to ask the user to further determine whether the to-be-processed TCP packet is true or forged, etc.

    [0041] If the deviation does not exceed the preset threshold, the to-be-processed TCP packet is regarded as a true TCP packet. Thus, Step 616 is entered to allow the to-be-processed TCP packet to pass the gateway device directly.

    [0042] It should be noted that, to avoid discarding an effective TCP packet as the forged TCP packet, optionally, "the preset threshold" refers to the times of the RCV.WND of the TCP packet with respect to the actual RCV.WND in the related record. Based on tests, the value range of the "preset threshold" may be ≧1.5. For example, the preset threshold may be 1.5, and when the deviation exceeds 1.5, the TCP packet may be preliminarily determined to be a forged TCP packet. In some embodiments, the "preset threshold" may be 4. Correspondingly, when the deviation exceeds 4, the TCP packet may be determined to be a forged TCP packet. As such, the "preset threshold" may allow the determination of the TCP forged packet to be more accurate. The aforementioned times is for illustrative purposes only, and is not intended to be limiting. The user may adjust the standard of the "preset threshold" based on actual situations, thereby adapting to different context environmental demands.

    [0043] As such, in solutions of the present disclosure, by determining whether a relatively large deviation exists between the receive window of the to-be-processed TCP packet and the actual receive window of the related record in the TCP receive window reference table, there is a higher chance to find (and further discard) the forged TCP packets. Accordingly, the device may receive as few attacks from the forged TCP packets as possible.

    [0044] Solutions of the present disclosure may not only be applied to firewall, DDoS (distributed denial of service) gateway system, and by-passed detection system such as IDS (intrusion detection system), but may also be applicable for use in a router.

    [0045] The foregoing are merely some preferred embodiments of the present disclosure, and are not intended to limit the protection scope of the present disclosure. Without departing from the principles of the present disclosure, any modifications, equivalent substitutions, and improvements, etc. shall fall within the scope of the present disclosure.


    Claims

    1. A method for processing forged TCP packets, comprising following steps:

    receiving a to-be-processed TCP packet, wherein a header of the to-be-processed TCP packet includes a window size field;

    based on the to-be-processed TCP packet, searching a TCP receive window reference table to find out whether a record related to the to-be-processed TCP packet exists;

    when the record related to the to-be-processed TCP packet exists in the TCP receive window reference table, calculating a receive window value of the to-be-processed TCP packet from the window size field in the header of the to-be-processed TCP packet and a receive window scaling factor field in the record related to the to-be-processed TCP packet;

    comparing the receive window value of the to-be-processed TCP packet with an actual receive window value in the record related to the to-be-processed TCP packet to obtain a deviation therebetween; and

    comparing the deviation with a preset threshold to determine whether the to-be-processed TCP packet is a forged TCP packet.


     
    2. The method according to claim 1, wherein a step of comparing the deviation with the preset threshold to determine whether the to-be-processed TCP packet is a forged TCP packet comprises:

    when the deviation exceeds the preset threshold, executing a corresponding process on the to-be-processed TCP packet; and

    when the deviation does not exceed the preset threshold, allowing the to-be-processed TCP packet to pass through.


     
    3. The method according to claim 1, wherein the receive window value RCV.WND of the to-be-processed TCP packet is calculated by using a following equation:

    wherein SEG.WND represents a window size field, and Rcv.Wind.Scale represents a receive window scaling factor field.
     
    4. The method according to claim 1, wherein records in the TCP receive window reference table comprise:

    a "connection tetrad" field, including a source IP, a source port, a destination IP, and a destination port;

    an "actual receive window" field, representing an actual receive window value of a TCP connection, wherein the actual receive window value is obtained from a window size field of a packet corresponding to a TCP second handshake; and

    a "receive window scaling factor" field, representing a receive window scaling factor of the TCP connection, wherein the receive window scaling factor is obtained from a "shift.cnt" field in a window scaling factor option carried by the packet corresponding to the TCP second handshake.


     
    5. The method according to claim 4, wherein the records in the TCP receive window reference table further includes following fields:

    an optional "Key value" field, representing a hash value calculated based on the connection tetrad of the TCP connection, for convenient and rapid search; and

    an optional "creation time" field, representing a creation time of a corresponding record.


     
    6. The method according to claim 4, wherein a step of based on the to-be-processed TCP packet, searching the TCP receive window reference table to find out whether the record related to the to-be-processed TCP packet exists comprises:
    based on a connection tetrad of the to-be-processed TCP packet, searching the TCP receive window reference table to find out whether the record related to the to-be-processed TCP packet exists.
     
    7. The method according to claim 5, wherein a step of based on the to-be-processed TCP packet, searching the TCP receive window reference table to find out whether the record related to the to-be-processed TCP packet exists comprises:
    using a harsh value calculated by the connection tetrad of the to-be-processed TCP packet as a query condition to compare with a key value in the TCP receive window reference table to find out whether the record related to the to-be-processed TCP packet exists.
     
    8. The method according to claim 4 or 5, wherein the records in the TCP receive window reference table is established through following steps:

    from a received packet corresponding to the TCP second handshake, extracting connection tetrad, receive window value, and receive window scaling factor, wherein when there is no window scaling factor option, default value of the window scaling factor is 0; and

    based on the connection tetrad of the received packet, searching the TCP receive window reference table to find out whether a record related to the received packet exists in the TCP receive window reference table,

    wherein when the record comprising the connection tetrad does not exist in the TCP receive window reference table, based on the connection tetrad, the receive window value, and the receive window scaling factor of the received packet, establishing the record related to the received packet in the TCP receive window reference table, and

    when the record comprising the connection tetrad exists in the TCP receive window reference table, using the receive window value and the receive window scaling factor of the received packet to update content of corresponding fields in the record, and updating the creation time field.


     
    9. The method according to claim 1, wherein when the deviation exceeds the preset threshold, a step of executing a corresponding process on the to-be-processed TCP packet further comprises:

    directly discarding the to-be-processed TCP packet; or

    providing a related notice, to help a user further determine whether the to-be-processed TCP packet is a forged packet or not.


     
    10. The method according to claim 1, wherein:

    the deviation is defined by times, which is obtained by dividing the receive window value of the to-be-processed TCP packet by the actual receive window value in the record related to the to-be-processed TCP packet; and

    the preset threshold refers to times of the receive window value of the to-be-processed packet with respect to the actual receive window value in the record related to the to-be-processed TCP packet, wherein a value range of the preset threshold is ≧1.5, and preferably, ≧4.


     
    11. The method according to claim 5, wherein:
    based on the creation time field in the TCP receive window reference table, an old record showing a creation time relatively long time ago with respect to a current moment is periodically deleted in the TCP receive window reference table.
     
    12. The method according to claim 1, wherein when the record related to the to-be-processed TCP packet does not exist in the TCP receive window reference table, the to-be-processed packet is allowed to pass through.
     
    13. A system for processing forged TCP packets, comprising:

    a device for receiving a to-be-processed TCP packet, wherein a header of the to-be-processed TCP packet includes a window size field;

    a device for, based on the to-be-processed TCP packet, searching a TCP receive window reference table to find out whether a record related to the to-be-processed TCP packet exists;

    a device for, when the record related to the to-be-processed TCP packet exists in the TCP receive window reference table, calculating a receive window value of the to-be-processed TCP packet from the window size field in the header of the to-be-processed TCP packet and a receive window scaling factor field in the record related to the to-be-processed TCP packet;

    a device for comparing the receive window value of the to-be-processed TCP packet and an actual receive window value in the record related to the to-be-processed TCP packet to obtain a deviation therebetween; and

    a device for comparing the deviation with a preset threshold to determine whether the to-be-processed TCP packet is a forged TCP packet.


     
    14. The system according to claim 13, wherein a step of using a comparison result obtained by the device for comparing the deviation with the preset threshold to determine whether the to-be-processed TCP packet is a forged TCP packet comprises:

    when the deviation exceeds the preset threshold, executing a corresponding process on the to-be-processed TCP packet;

    when the deviation does not exceed the preset threshold, allowing the to-be-processed TCP packet to pass through.


     


    Ansprüche

    1. Verfahren zur Verarbeitung gefälschter TCP-Pakete, folgende Schritte umfassend:

    Empfangen eines zu verarbeitenden TCP-Pakets, wobei ein Header des zu verarbeitenden TCP-Pakets ein Fenstergrößenfeld enthält;

    basierend auf dem zu verarbeitenden TCP-Paket, Durchsuchen einer Referenztabelle des TCP-Empfangsfensters, um herauszufinden, ob ein Datensatz in Bezug auf das zu verarbeitende TCP-Paket vorhanden ist;

    wenn der Datensatz, der sich auf das zu verarbeitende TCP-Paket bezieht, in der Referenztabelle des TCP-Empfangsfensters vorhanden ist, Berechnen eines Empfangsfensterwertes des zu verarbeitenden TCP-Pakets aus dem Fenstergrößenfeld im Header des zu verarbeitenden TCP-Pakets und einem Empfangsfenster-Skalierungsfaktorfeld im Datensatz, der sich auf das zu verarbeitende TCP-Paket bezieht;

    Vergleichen des Empfangsfensterwertes des zu verarbeitenden TCP-Pakets mit einem tatsächlichen Empfangsfensterwert in dem Datensatz, der sich auf das zu verarbeitende TCP-Paket bezieht, um eine Abweichung dazwischen zu erhalten; und

    Vergleich der Abweichung mit einem voreingestellten Schwellenwert, um festzustellen, ob das zu verarbeitende TCP-Paket ein gefälschtes TCP-Paket ist.


     
    2. Verfahren nach Anspruch 1, wobei ein Schritt des Vergleichens der Abweichung mit dem voreingestellten Schwellenwert zur Bestimmung, ob das zu verarbeitende TCP-Paket ein gefälschtes TCP-Paket ist, Folgendes umfasst:

    wenn die Abweichung den voreingestellten Schwellenwert überschreitet, Ausführen eines entsprechenden Prozesses auf dem zu verarbeitenden TCP-Paket; und

    wenn die Abweichung den voreingestellten Schwellenwert nicht überschreitet, Zulassen, dass das zu verarbeitende TCP-Paket passiert.


     
    3. Verfahren nach Anspruch 1, wobei der Empfangsfensterwert RCV.WND des zu verarbeitenden TCP-Pakets unter Verwendung einer folgenden Gleichung berechnet wird:

    wobei SEG.WND für ein Fenstergrößenfeld und Rcv.Wind.Scale für ein Empfangsfenster-Skalierungsfaktorfeld steht.
     
    4. Verfahren nach Anspruch 1, wobei die Datensätze in der Referenztabelle des TCP-Empfangsfensters Folgendes umfassen:

    ein "Verbindungs-Tetraden"-Feld, umfassend eine Quell-IP, einen Quell-Port, eine Ziel-IP und einen Ziel-Port;

    ein "tatsächliches Empfangsfenster"-Feld, das einen tatsächlichen Empfangsfensterwert einer TCP-Verbindung repräsentiert, wobei der tatsächliche Empfangsfensterwert aus einem Fenstergrößenfeld eines Pakets erhalten wird, das einem zweiten TCP-Handshake entspricht; und

    ein "Empfangsfenster-Skalierungsfaktor"-Feld, das einen Empfangsfenster-Skalierungsfaktor der TCP-Verbindung darstellt, wobei der Empfangsfenster-Skalierungsfaktor aus einem ""shift.cnt"-Feld in einer Fenster-Skalierungsfaktor-Option erhalten wird, die in dem Paket enthalten ist, das dem zweiten TCP-Handshake entspricht.


     
    5. Verfahren nach Anspruch 4, wobei die Datensätze in der Referenztabelle des TCP-Empfangsfensters weiterhin folgende Felder enthalten:

    ein optionales "Schlüsselwert"-Feld, das einen Hash-Wert repräsentiert, der auf der Basis der Verbindungs-Tetrade der TCP-Verbindung berechnet wird, für eine bequeme und schnelle Suche; und

    ein optionales "Erstellungszeit"-Feld, das eine Erstellungszeit eines entsprechenden Datensatzes repräsentiert.


     
    6. Verfahren nach Anspruch 4, wobei ein Schritt des Durchsuchens der Referenztabelle des TCP-Empfangsfensters auf der Grundlage des zu verarbeitenden TCP-Pakets, um herauszufinden, ob der auf das zu verarbeitende TCP-Paket bezogene Datensatz vorhanden ist, Folgendes umfasst:

    basierend auf einer Verbindungs-Tetrade des zu verarbeitenden TCP-Pakets,

    Durchsuchen der Referenztabelle des TCP-Empfangsfensters, um herauszufinden, ob der Datensatz, der sich auf das zu verarbeitende TCP-Paket bezieht, vorhanden ist.


     
    7. Verfahren nach Anspruch 5, wobei ein Schritt des Durchsuchens der Referenztabelle des TCP-Empfangsfensters auf der Grundlage des zu verarbeitenden TCP-Pakets, um herauszufinden, ob der auf das zu verarbeitende TCP-Paket bezogene Datensatz vorhanden ist, Folgendes umfasst:
    Verwenden eines von der Verbindungs-Tetrade des zu verarbeitenden TCP-Pakets berechneten harten Werts als Abfragebedingung zum Vergleich mit einem Schlüsselwert in der Referenztabelle des TCP-Empfangsfensters, um herauszufinden, ob der Datensatz, der sich auf das zu verarbeitende TCP-Paket bezieht, vorhanden ist.
     
    8. Verfahren nach Anspruch 4 oder 5, wobei die Datensätze in der Referenztabelle des TCP-Empfangsfensters durch folgende Schritte festgelegt werden:

    aus einem empfangenen Paket entsprechend dem zweiten TCP-Handshake, Extrahieren der Verbindungs-Tetrade, Empfangsfensterwert und Empfangsfenster-Skalierungsfaktor, wobei, wenn keine Option für den Fensterskalierungsfaktor vorhanden ist, der Standardwert des Fensterskalierungsfaktors 0 ist; und

    basierend auf der Verbindungs-Tetrade des empfangenen Pakets, Durchsuchen der Referenztabelle des TCP-Empfangsfensters, um herauszufinden, ob in der Referenztabelle des TCP-Empfangsfensters ein Datensatz vorhanden ist, der sich auf das empfangene Paket bezieht,

    wobei, wenn der Datensatz, der die Verbindungs-Tetrade umfasst, nicht in der Referenztabelle des TCP-Empfangsfensters vorhanden ist, basierend auf der Verbindungs-Tetrade, dem Empfangsfensterwert und dem Empfangsfenster-Skalierungsfaktor des empfangenen Pakets, Erstellen des Datensatzes, der sich auf das empfangene Paket bezieht, in der Referenztabelle des TCP-Empfangsfensters, und wenn der Datensatz, der die Verbindungs-Tetrade umfasst, in der Referenztabelle des TCP-Empfangsfensters vorhanden ist, Verwenden des Empfangsfensterwertes und des Empfangsfenster-Skalierungsfaktors des empfangenen Pakets, um den Inhalt der entsprechenden Felder im Datensatz zu aktualisieren, und Aktualisieren des Erstellungszeitfeldes.


     
    9. Verfahren nach Anspruch 1, wobei, wenn die Abweichung den voreingestellten Schwellenwert überschreitet, ein Schritt des Ausführens eines entsprechenden Prozesses auf dem zu verarbeitenden TCP-Paket weiterhin Folgendes umfasst:

    direktes Verwerfen des zu verarbeitenden TCP-Pakets; oder

    Bereitstellen eines entsprechenden Hinweises, um einem Benutzer beim weiteren Bestimmen zu helfen, ob das zu verarbeitende TCP-Paket ein gefälschtes Paket ist oder nicht.


     
    10. Verfahren nach Anspruch 1, wobei:

    die Abweichung durch Zeiten definiert ist, die erhalten wird, indem der Empfangsfensterwert des zu verarbeitenden TCP-Pakets durch den tatsächlichen Empfangsfensterwert in dem Datensatz, der sich auf das zu verarbeitende TCP-Paket bezieht, dividiert wird; und

    wobei sich der voreingestellte Schwellenwert auf Zeiten des Empfangsfensterwertes des zu verarbeitenden Pakets in Bezug auf den tatsächlichen Empfangsfensterwert in dem Datensatz bezieht, der sich auf das zu verarbeitende TCP-Paket bezieht, wobei ein Wertebereich des voreingestellten Schwellenwertes ≧1,5, und vorzugsweise, ≧4 ist.


     
    11. Verfahren nach Anspruch 5, wobei:
    basierend auf dem Erstellungszeitfeld in der Referenztabelle des TCP-Empfangsfensters ein alter Datensatz, der eine Erstellungszeit vor relativ langer Zeit in Bezug auf einen aktuellen Zeitpunkt zeigt, regelmäßig in der Referenztabelle des TCP-Empfangsfensters gelöscht wird.
     
    12. Verfahren nach Anspruch 1, wobei, wenn der Datensatz, der sich auf das zu verarbeitende TCP-Paket bezieht, nicht in der Referenztabelle des TCP-Empfangsfensters vorhanden ist, das zu verarbeitende Paket durchgelassen wird.
     
    13. System zur Verarbeitung gefälschter TCP-Pakete, umfassend:

    eine Vorrichtung zum Empfangen eines zu verarbeitenden TCP-Pakets, wobei ein Header des zu verarbeitenden TCP-Pakets ein Fenstergrößenfeld umfasst;

    eine Vorrichtung zum Durchsuchen einer Referenztabelle des TCP-Empfangsfensters auf der Grundlage des zu verarbeitenden TCP-Pakets, um herauszufinden, ob ein Datensatz bezüglich des zu verarbeitenden TCP-Pakets vorhanden ist;

    eine Vorrichtung zum Berechnen eines Empfangsfensterwertes des zu verarbeitenden TCP-Pakets aus dem Fenstergrößenfeld im Header des zu verarbeitenden TCP-Pakets und einem Empfangsfenster-Skalierungsfaktorfeld im Datensatz, der sich auf das zu verarbeitende TCP-Paket bezieht, wenn der Datensatz, der sich auf das zu verarbeitende TCP-Paket bezieht, in der Referenztabelle des TCP-Empfangsfensters vorhanden ist;

    eine Vorrichtung zum Vergleichen des Empfangsfensterwertes des zu verarbeitenden TCP-Pakets und eines tatsächlichen Empfangsfensterwertes in dem Datensatz, der sich auf das zu verarbeitende TCP-Paket bezieht, um eine Abweichung dazwischen zu erhalten; und

    eine Vorrichtung zum Vergleichen der Abweichung mit einem voreingestellten Schwellenwert, um zu bestimmen, ob das zu verarbeitende TCP-Paket ein gefälschtes TCP-Paket ist.


     
    14. System nach Anspruch 13, wobei ein Schritt des Verwendens eines Vergleichsergebnisses, das durch die Vorrichtung zum Vergleichen der Abweichung mit dem voreingestellten Schwellenwert erhalten wird, um zu bestimmen, ob das zu verarbeitende TCP-Paket ein gefälschtes TCP-Paket ist, Folgendes umfasst:

    wenn die Abweichung den voreingestellten Schwellenwert überschreitet, Ausführen eines entsprechenden Prozesses auf dem zu verarbeitenden TCP-Paket;

    wenn die Abweichung den voreingestellten Schwellenwert nicht überschreitet, Zulassen, dass das zu verarbeitende TCP-Paket passiert.


     


    Revendications

    1. Procédé de traitement de paquets TCP falsifiés, comprenant les étapes suivantes :

    la réception d'un paquet TCP à traiter, un en-tête du paquet TCP à traiter comportant un champ de taille de fenêtre ;

    sur la base du paquet TCP à traiter, la recherche dans une table de référence de fenêtre de réception TCP pour découvrir s'il existe un enregistrement lié au paquet TCP à traiter ;

    lorsque l'enregistrement relatif au paquet TCP à traiter existe dans la table de référence de la fenêtre de réception TCP, le calcul d'une valeur de fenêtre de réception du paquet TCP à traiter à partir du champ de taille de fenêtre dans l'en-tête du paquet TCP à traiter et d'un champ de facteur de mise à l'échelle de fenêtre de réception dans l'enregistrement lié au paquet TCP à traiter ;

    la comparaison de la valeur de fenêtre de réception du paquet TCP à traiter avec une valeur de fenêtre de réception réelle dans l'enregistrement lié au paquet TCP à traiter pour obtenir un écart entre eux ; et

    la comparaison de l'écart avec un seuil prédéfini pour déterminer si le paquet TCP à traiter est un paquet TCP falsifié.


     
    2. Procédé selon la revendication 1, une étape de comparaison de l'écart avec le seuil prédéfini pour déterminer si le paquet TCP à traiter est un paquet TCP falsifié comprenant :

    lorsque l'écart dépasse le seuil prédéfini, l'exécution d'un processus correspondant sur le paquet TCP à traiter ; et

    lorsque l'écart ne dépasse pas le seuil prédéfini, la permission d'accès au paquet TCP à traiter.


     
    3. Procédé selon la revendication 1, la valeur de fenêtre de réception RCV.WND du paquet TCP à traiter étant calculée en utilisant une équation suivante :

    SEG.WND représentant un champ de taille de fenêtre et Rcv.Wind.Scale représentant un champ de facteur d'échelle de fenêtre de réception.
     
    4. Procédé selon la revendication 1, les enregistrements de la table de référence de la fenêtre de réception TCP comprenant :

    un champ « tétrade de connexion », comportant une adresse IP source, un port source, une adresse IP de destination et un port de destination ;

    un champ « fenêtre de réception réelle », représentant une valeur de fenêtre de réception réelle d'une connexion TCP, la valeur de fenêtre de réception réelle étant obtenue à partir d'un champ de taille de fenêtre d'un paquet correspondant à un second établissement de connexion TCP ; et

    un champ « facteur de mise à l'échelle de la fenêtre de réception », représentant un facteur de mise à l'échelle de la fenêtre de réception de la connexion TCP, le facteur de mise à l'échelle de la fenêtre de réception étant obtenu à partir d'un champ « shift.cnt » dans une option de facteur de mise à l'échelle de la fenêtre portée par le paquet correspondant au second établissement de connexion TCP.


     
    5. Procédé selon la revendication 4, les enregistrements dans la table de référence de la fenêtre de réception TCP comportant en outre les champs suivants :

    un champ optionnel « Valeur clé », représentant une valeur de hachage calculée sur la base de la tétrade de connexion de la connexion TCP, pour une recherche pratique et rapide ; et

    un champ optionnel « heure de création », représentant une heure de création d'un enregistrement correspondant.


     
    6. Procédé selon la revendication 4, une étape consistant, sur la base du paquet TCP à traiter, à rechercher dans la table de référence de la fenêtre de réception TCP pour découvrir si l'enregistrement lié au paquet TCP à traiter existe, comprenant :
    sur la base d'une tétrade de connexion du paquet TCP à traiter, la recherche dans la table de référence de la fenêtre de réception TCP pour découvrir si l'enregistrement lié au paquet TCP à traiter existe.
     
    7. Procédé selon la revendication 5, une étape consistant, sur la base du paquet TCP à traiter, à rechercher dans la table de référence de la fenêtre de réception TCP pour découvrir si l'enregistrement lié au paquet TCP à traiter existe, comprenant :
    en utilisant une valeur de hachage calculée par la tétrade de connexion du paquet TCP à traiter comme condition de requête pour comparer avec une valeur clé dans la table de référence de la fenêtre de réception TCP pour découvrir si l'enregistrement lié au paquet TCP à traiter existe.
     
    8. Procédé selon la revendication 4 ou 5, les enregistrements dans la table de référence de la fenêtre de réception TCP étant établis par les étapes suivantes :

    à partir d'un paquet reçu correspondant au second établissement de connexion TCP, l'extraction de la tétrade de connexion, de la valeur de fenêtre de réception et du facteur de mise à l'échelle de la fenêtre de réception, lorsqu'il n'y a pas d'option de facteur de mise à l'échelle de fenêtre, la valeur par défaut du facteur de mise à l'échelle de fenêtre étant 0 ; et

    sur la base de la tétrade de connexion du paquet reçu, la recherche dans la table de référence de la fenêtre de réception TCP pour découvrir si un enregistrement lié au paquet reçu existe dans la table de référence de la fenêtre de réception TCP,

    lorsque l'enregistrement comprenant la tétrade de connexion n'existe pas dans la table de référence de la fenêtre de réception TCP, sur la base de la tétrade de connexion, de la valeur de la fenêtre de réception et du facteur de mise à l'échelle de la fenêtre de réception du paquet reçu, l'établissement de l'enregistrement lié au paquet reçu dans la table de référence de fenêtre de réception TCP, et

    lorsque l'enregistrement comprenant la tétrade de connexion existe dans la table de référence de fenêtre de réception TCP, l'utilisation de la valeur de fenêtre de réception et du facteur d'échelle de fenêtre de réception du paquet reçu pour mettre à jour le contenu des champs correspondants dans l'enregistrement, et la mise à jour du champ de l'heure de création.


     
    9. Procédé selon la revendication 1, lorsque l'écart dépasse le seuil prédéfini, une étape d'exécution d'un processus correspondant sur le paquet TCP à traiter comprenant en outre :

    le rejet direct du paquet TCP à traiter ; ou

    la fourniture d'un avis connexe, pour aider un utilisateur à déterminer en outre si le paquet TCP à traiter est un paquet falsifié ou non.


     
    10. Procédé selon la revendication 1 :

    l'écart étant défini par des temps, qui sont obtenus en divisant la valeur de la fenêtre de réception du paquet TCP à traiter par la valeur réelle de la fenêtre de réception dans l'enregistrement lié au paquet TCP à traiter ; et

    le seuil prédéfini faisant référence aux temps de la valeur de la fenêtre de réception du paquet à traiter par rapport à la valeur réelle de la fenêtre de réception dans l'enregistrement lié au paquet TCP à traiter, une plage de valeurs du seuil prédéfini étant ≧ 1,5, et de préférence, ≧ 4.


     
    11. Procédé selon la revendication 5 :
    sur la base du champ de l'heure de création dans la table de référence de la fenêtre de réception TCP, un ancien enregistrement affichant une heure de création relativement plus ancienne par rapport à un moment actuel étant périodiquement supprimé dans la table de référence de la fenêtre de réception TCP.
     
    12. Procédé selon la revendication 1, lorsque l'enregistrement relatif au paquet TCP à traiter n'existe pas dans la table de référence de la fenêtre de réception TCP, l'accès au paquet à traiter étant autorisé.
     
    13. Système de traitement de paquets TCP falsifiés, comprenant :

    un dispositif pour recevoir un paquet TCP à traiter, un en-tête du paquet TCP à traiter comportant un champ de taille de fenêtre ;

    un dispositif pour, sur la base du paquet TCP à traiter, rechercher dans une table de référence de fenêtre de réception TCP pour découvrir s'il existe un enregistrement lié au paquet TCP à traiter ;

    un dispositif pour, lorsque l'enregistrement relatif au paquet TCP à traiter existe dans la table de référence de fenêtre de réception TCP, calculer une valeur de fenêtre de réception du paquet TCP à traiter à partir du champ de taille de fenêtre dans l'en-tête du paquet TCP à traiter et d'un champ de facteur d'échelle de fenêtre de réception dans l'enregistrement lié au paquet TCP à traiter ;

    un dispositif pour comparer la valeur de fenêtre de réception du paquet TCP à traiter et une valeur de fenêtre de réception réelle dans l'enregistrement lié au paquet TCP à traiter pour obtenir un écart entre eux ; et

    un dispositif pour comparer l'écart avec un seuil prédéfini pour déterminer si le paquet TCP à traiter est un paquet TCP falsifié.


     
    14. Système selon la revendication 13, une étape d'utilisation d'un résultat de comparaison obtenu par le dispositif pour comparer l'écart avec le seuil prédéfini pour déterminer si le paquet TCP à traiter est un paquet TCP falsifié comprenant :

    lorsque l'écart dépasse le seuil prédéfini, l'exécution d'un processus correspondant sur le paquet TCP à traiter ;

    lorsque l'écart ne dépasse pas le seuil prédéfini, la permission d'accès au paquet TCP à traiter.


     




    Drawing

















    Cited references

    REFERENCES CITED IN THE DESCRIPTION



    This list of references cited by the applicant is for the reader's convenience only. It does not form part of the European patent document. Even though great care has been taken in compiling the references, errors or omissions cannot be excluded and the EPO disclaims all liability in this regard.

    Patent documents cited in the description