The method can be implemented on a processor executing software instructions stored in memory. In one embodiment of the invention, the method includes receiving an ethernet frame, wherein the ethernet frame comprises a Transmission Control protocol (TCP) header, wherein the TCP header comprises a TCP header length value. When the ethernet frame is received, the TCP header length value is compared to a predetermined value.
|
1. A method comprising:
receiving an ethernet frame at a node, wherein the ethernet frame comprises an internet protocol (ip) datagram that comprises an ip header, wherein
the ip header comprises an ip datagram data length value, and
the ip datagram data length value does not match an actual ip datagram data length;
detecting whether the ip datagram data length value satisfies a length criterion, wherein
the length criterion is based on a type of transport layer protocol header;
calculating the actual ip datagram data length; and
detecting whether the actual ip datagram data length satisfies the length criterion.
23. An apparatus comprising:
means for receiving an ethernet frame wherein the ethernet frame comprises an internet protocol (ip) datagram that comprises an ip header, wherein
the ip header comprises an ip datagram data length value, and
the ip datagram data length value does not match an actual ip datagram data length;
means for detecting whether the ip datagram data length value satisfies a length criterion, wherein
the length criterion is based on a type of transport layer protocol header;
means for calculating the actual ip datagram data length; and
means for detecting whether the actual ip datagram data length satisfies the length criterion.
8. An apparatus comprising:
a circuit, the circuit comprising a first circuit, wherein the first circuit is configured to
receive an ethernet frame, wherein the ethernet frame comprises
an internet protocol (ip) datagram that comprises an ip header, wherein
the ip header comprises an ip datagram data length value, and
the ip datagram data length value does not match an actual ip datagram data length;
detect whether the ip datagram data length value satisfies a length criterion, wherein
the length criterion is based on a type of transport layer protocol header;
calculate the actual ip datagram data length; and
detect whether the actual ip datagram data length satisfies the length criterion.
16. A non-transitory computer readable medium for storing software instructions executable by a data processing circuit, wherein the data processing circuit performs a method in response to executing the instructions, the method comprising
receiving an ethernet frame, wherein the ethernet frame comprises
an internet protocol (ip) datagram that comprises an ip header, wherein
the ip header comprises an ip datagram data length value, and
the ip datagram data length value does not match an actual ip datagram data length;
detecting whether the ip datagram data length value satisfies a length criterion, wherein
the length criterion is based on a type of transport layer protocol header;
calculating the actual ip datagram data length; and
detecting whether the actual ip datagram data length satisfies the length criterion.
2. The method of
the ethernet frame comprises a Transmission Control protocol (TCP) header, and
the TCP header comprises a TCP header length value.
3. The method of
comparing the TCP header length value to a predetermined value, and
blocking the ethernet frame if the TCP header length value is less than the predetermined value, wherein
the blocking is performed by a filter.
4. The method of
an act of blocking transmission of the ethernet frame directly or indirectly to an operating system executing on a computer system if the TCP header length value is less than the predetermined value.
6. The method of
counting data bytes of the ethernet frame to generate a total number of counted bytes;
calculating a data length of an internet protocol (ip) payload of the ethernet frame, wherein the data length is calculated as a function of the total number of counted bytes; and
comparing the calculated ip payload data length to a second predetermined value.
7. The method of
calculating a second data length of the ip payload, wherein the calculated second data length of the ip payload is calculated as a function of the ip header length value and the ip datagram data length value;
comparing the calculated second data length to the second predetermined value;
blocking the ethernet frame if the calculated second data length is less than the second predetermined value.
9. The apparatus of
the ethernet frame comprises a Transmission Control protocol (TCP) header,
the TCP header comprises a TCP header length value.
10. The apparatus of
12. The apparatus of
wherein the first circuit is configured to count data bytes of the ethernet frame to generate a total number of counted bytes;
wherein the first circuit is configured to calculate a data length of an internet protocol (ip) payload of the ethernet frame, wherein the data length is calculated as a function of the total number of counted bytes;
wherein the first circuit is configured to compare the calculated ip payload data length to a second predetermined value.
13. The apparatus of
the first circuit is configured to calculate a second data length of the ip payload, wherein
the calculated second data length of the ip payload is calculated as a function of the ip header length value and the ip datagram data length value;
the first circuit is configured to compare the calculated second data length to the second predetermined value; and
the circuit is configured to block the ethernet frame if the calculated second data length is less than the second predetermined value.
14. The apparatus of
the first circuit is configured to count data bytes of a datagram contained in the ethernet frame to generate a total number of counted bytes;
the first circuit is configured to calculate a data length of an internet protocol (ip) payload of the ethernet frame, wherein the data length is calculated as a function of the total number of counted bytes;
the first circuit is configured to compare the calculated ip payload data length to a second predetermined value;
the first circuit is configured to block the ethernet frame if the calculated data length is less than the predetermined value.
15. The apparatus of
17. The non-transitory computer readable medium of
the ethernet frame comprises a Transmission Control protocol (TCP) header, and
the TCP header comprises a TCP header length value.
18. The non-transitory computer readable medium of
19. The non-transitory computer readable medium of
21. The non-transitory computer readable medium of
counting data bytes of the ethernet frame to generate a total number of counted bytes;
calculating a data length of an internet protocol (ip) payload of the ethernet frame, wherein the data length is calculated as a function of the total number of counted bytes; and
comparing the calculated ip payload data length to a second predetermined value.
22. The non-transitory computer readable medium of
calculating a second data length of the ip payload, wherein the calculated second data length of the ip payload is calculated as a function of the ip header length value and the ip datagram data length value;
comparing the calculated second data length of the ip payload to the second predetermined value;
blocking the ethernet frame if the calculated second data length of the ip payload is less than the second predetermined value.
24. The method of
25. The method of
counting data bytes of a datagram contained in the ethernet frame to generate a total number of counted bytes;
calculating a data length of an internet protocol (ip) payload of the ethernet frame, wherein the data length is calculated as a function of the total number of counted bytes;
comparing the calculated ip payload data length to a second predetermined value;
blocking the ethernet frame if the calculated data length is less than the predetermined value.
26. The method of
27. The method of
the ethernet frame is generated to facilitate an unauthorized operation.
28. The method of
the ip datagram length value is rewritten as a result of the ethernet frame being fragmented.
29. The method of
the actual ip datagram length is unchanged since a time at which the ethernet frame was transmitted to the node.
|
This application is a continuation of U.S. patent application Ser. No. 10/383,128, filed on Mar. 6, 2003, entitled, “Line-Rate Hardware Detection of RFC-3128 Attacks.”
The Transmission Control Protocol/Internet Protocol (TCP/IP) protocol suite allows computers of all sizes, from many different computer vendors, running totally different operating systems, to communicate with each other. Stevens, W. Richard, 1994, TCP/WP Illustrated, Volume 1, which is incorporated herein by reference, describes general aspects of the TCP/IP protocol suite. Request For Comment (RFC) 793, also incorporated by reference, is considered the main TCP specification. Additional RFCs that describe TCP and IP are published for informational purposes. The RFCs are provided by the Internet Engineering Task Force (IETF) at www.ietf.org.
Layers 32 and 42 of nodes 12 and 14, respectively, are commonly referred to as the transport layers. There are several distinct transport layers including TCP and User Datagram Protocol (UDP). For purposes of explanation, layers 32 and 42 will take form in either the TCP or UDP transport layers. Layers 34 and 44 are commonly referred to as the network layers. A network layer may take many forms such as Internet Control Message Protocol (ICMP) or IP. For purposes of explanation,
Most networked systems are designed such that at least one node is a client to a server node. In
As data moves down layers 30-36 of node 12, each of the layers 30-36 adds headers (and sometimes trailers) containing communication information.
The Ethernet frame is transmitted to node 14 as a stream of bits via router 16 and Ethernet communication links 20 and 22 (
Normally, an upper limit is imposed on the size of the frame that can be transmitted between nodes 12 and 14. Many IP datagrams are fragmented to meet this limit. Thus, an IP datagram may be fragmented into IP datagram fragments, each of which is provided to the Ethernet layer for transmission in a separate frame. When an IP datagram is fragmented it is not reassembled until it reaches its final destination. The IP layer at the destination performs the reassembly. The 16-bit identification field shown in
Unauthorized access (i.e., hacking) of computer systems, such as node 14 of
Filter 100 performs numerous checks on frames it receives. For example, filter 100 compares the destination port number and SYN flag values of all frames it receives. If the destination port number and SYN flag values of a received frame equal 21 and binary 1, respectively, the received frame is configured to initiate an unauthorized file transfer protocol (FTP) and will be dropped by filter 100.
As noted above, IP datagrams can be fragmented to meet the limit on the size of frames that can be transmitted between nodes 12 and 14. Fragmented IP datagrams are not reassembled until they reach their final destination, e.g., node 14. Thus, Ethernet frames containing datagram fragments can pass through router 16, and filter 100 thereof, before reaching destination node 14. Fragmentation can be used to disguise frames from filter 100. One technique for disguising frames using fragmentation is often referred to as a “tiny fragment attack.” For example,
Frames 104 and 106 shown in
The tiny fragment attack described above can be averted. More particularly, RFC 3128 describes an algorithm which may be used within filter 100 to avert the tiny fragment attack described above. The RFC 3128 algorithm provides:
if (Protocol = TCP)
if
(Fragment Offset = 0)
Check Length 1 ≧ 16 bytes
else
Check Fragment Offset ≧ 2,
where Length 1 is calculated by filter 100 for each frame according to the following equation:
In accordance with the RFC 3128 algorithm above, filter 100 will drop any frame it receives if the protocol field of the IP header is set to TCP, the fragment offset of the IP header is set to 0, and the calculated Length 1 is less than 16 bytes. Additionally, filter 100 will drop any received frame if the fragment offset of the IP header is set to 1. Frame 104 shown in
The RFC 3128 algorithm set forth above is incapable of averting certain variations of the tiny fragment attack described above. To illustrate,
Disclosed is a method and apparatus for checking Ethernet frames. The method can be implemented on a processor executing software instructions stored in memory. In one embodiment of the invention, the method includes receiving an Ethernet frame, wherein the Ethernet frame comprises a Transmission Control Protocol (TCP) header, wherein the TCP header comprises a TCP header length value. When the Ethernet frame is received, the TCP header length value is compared to a predetermined value.
The present invention may be better understood, and its numerous objects, features, and advantages made apparent to those skilled in the art by referencing the accompanying drawings.
The use of the same reference symbols in different drawings indicates similar or identical items.
Nodes 112 and 114 are shown having four communication layers 130-136 and 140-146, respectively. Layers 130-136 and 140-146 take form in software instructions executing on one or more processors in nodes 112 and 114, respectively. Layers 132-136 and 142-146 are implemented in operating systems of nodes 12 and 14, respectively. Layers 130 and 140 and nodes 112 and 114, respectively, take form in any one of many user applications including FTP, SMTP, telnet, etc.
For purposes of explanation, layers 132 and 142 will take form in either TCP or UDP transport layers, layers 134 and 144 will take form in IP network layers, while layers 136 and 146 take form in Ethernet link layers for interfacing with Ethernet communication links 120 and 122, respectively. In
Router 116 shown in
if (Protocol = TCP)
if
(Fragment Offset = 0)
Check Length 1 ≧ (P0 × 8)
Check (1)
Check Length 2 ≧ (P0 × 8)
Check (2)
Check TCP Header Length ≧ 5
Check (3)
else
Check Fragment Offset ≧ P0
Check (4)
if (Protocol = UDP)
if
(Fragment Offset = 0)
Check Length 1 ≧ (P1 × 8)
Check (5)
Check Length 2 ≧ (P1 × 8)
Check (6)
else
Check Fragment Offset ≧ P1
Check (7)
else
if
(Fragment Offset = 0)
Check Length 1 ≧ (P2 × 8)
Check (8)
Check Length 2 ≧ (P2 × 8)
Check (9)
else
check Fragment Offset ≧ P2,
Check (10)
where Length 1 and Length 2 are calculated according to the following equations:
P0, P1, and P2 in the above algorithm are programmable values stored within memory. P0, P1, and P2 may be equal to each other, or different from each other. It is noted that P0, P1, and P2 are multiplied by 8 in the above algorithms. In an alternative embodiment, P0, P1, and P2 may be multiplied by values other than 8.
Length 2 is calculated as a function of the total number of counted bytes in the received frame to be checked. The total number of counted bytes of the received frame can be generated in one of many different ways. In one embodiment, a counting variable N in memory is initially to 0. Thereafter, N is incremented by one for each byte in the received frame until all bytes in the received frame are counted. The bytes of the frame can be counted as the bytes enter the router 116, or the bytes can be counted after the received frame has been temporarily stored in memory of router 116.
In an alternative embodiment, Length 2 can be calculated as follows:
It is noted that in this alternative embodiment of calculating Length 2, only the bytes of the datagram of the received frame need be counted. The total number of counted bytes of the datagram can be generated in one of many different ways. In one embodiment, a counting variable M in memory is initially to 0. Thereafter, M is incremented by one for each byte of the datagram in the received frame until all bytes of the datagram are counted. The bytes of the datagram can be counted as the bytes of the datagram enter the router 116, or the bytes of the datagram can be counted after the datagram have been temporarily stored in memory of router 116.
In operation, filter 142 will drop any received frame if any one or more of the various checks (1)-(10) are not passed. It is noted that filter 142 need not perform all checks (1)-(10) listed above for each frame received by router 116. For example, filter 142 at one point in time, may perform only check (2) or only check (3), or filter 142 may perform only checks (2), (3) and (4) on frames received by router 116. At another point in time, filter 142 may perform all checks (1)-(10) on frames received by router 116. For purposes of explanation, it will be presumed that filter 142 performs all checks (1)-(10) on all frames received by router 116.
Thus, if router 116 receives a frame, regardless of whether its datagram contains a UDP or TCP segment as identified in the protocol field of the IP header, if the fragment offset of the IP header is set to 0, and if Lengths 1 or 2 are calculated to be less than P2×8, filter 142 will drop the frame such that it never reaches its destination (e.g., node 14) in accordance with checks (8) and (9), respectively. If router 116 receives a frame, regardless of whether its datagram contains a UDP or TCP segment as identified in the protocol field of the IP header, filter 142 will drop the frame if the fragment offset defined in the IP header is not equal to 0 but is less than P2 in accordance with check (10).
If router 116 receives a frame having a UDP segment in its datagram (as identified in the protocol field of the IP header of the received frame) and if the fragment offset set forth in the IP header of the received frame is set to 0, then filter 142 will drop the received frame if Length 1 or Length 2 is less than P1×8 in accordance with checks (5) and (6), respectively. If router 116 receives a frame having a UDP segment, filter 142 will drop the frame if the fragment offset set forth in the IP header is not set to 0 but is set to a value less than P1 in accordance with check (7).
If router 116 receives a frame having a TCP segment in its datagram (as identified in the protocol field of the IP header of the received frame), filter 142 will drop the frame if the fragment offset value set forth in the IP header is set to 0, and if Length 1 or Length 2 is less than P0x8 in accordance with checks (1) and (2), respectively. If router 116 receives a frame having a TCP segment in its datagram (as identified in the protocol field of the IP header of the received frame), filter 142 will drop the frame if the value of the TCP header length field is less than 5 in accordance with check (3). If router 116 receives a frame having a TCP segment, filter 142 will drop the frame if the fragment offset set forth in the IP header is not set to 0 but is set to a value less than P0 in accordance with check (4).
As described in the background section above Frame 108 in
As noted above, the checks (1)-(10) above can be performed by one or more processors within router 116 executing software instructions. Alternatively, the checks (1)-(10) above can be performed by one or more ASICs within router 116.
Although the present invention has been described in connection with several embodiments, the invention is not intended to be limited to the embodiments described herein. On the contrary, it is intended to cover such alternatives, modifications, and equivalents as can be reasonably included within the scope of the invention as defined by the appended claims.
Wong, Kevin C., Walker, David S., Rose, Kenneth M., He, Kaichuan, Pullela, Venkateshwar R., Ng, Yu Kwong
Patent | Priority | Assignee | Title |
Patent | Priority | Assignee | Title |
4174536, | Jan 21 1977 | Massachusetts Institute of Technology | Digital communications controller with firmware control |
6247060, | Oct 14 1997 | ALACRITECH, INC | Passing a communication control block from host to a local device such that a message is processed on the device |
6343362, | Sep 01 1998 | JPMORGAN CHASE BANK, N A ; MORGAN STANLEY SENIOR FUNDING, INC | System and method providing custom attack simulation language for testing networks |
6643710, | Sep 17 1999 | Hewlett Packard Enterprise Development LP | Architecture to fragment transmitted TCP packets to a requested window size |
6714985, | Apr 28 2000 | Cisco Technology, Inc | Method and apparatus for efficiently reassembling fragments received at an intermediate station in a computer network |
6816455, | May 09 2001 | TELECOM ITALIA S P A | Dynamic packet filter utilizing session tracking |
6925572, | Feb 28 2000 | Microsoft Technology Licensing, LLC | Firewall with two-phase filtering |
6963913, | Jun 11 2001 | Symantec Corporation | Packet filtering system and methods |
7031338, | Aug 27 2001 | HEWLETT-PACKARD DEVELOPMENT COMPANY L P | System and method for the consolidation of data packets |
7130903, | Jan 11 2000 | NEC Corporation | Multi-layer class identifying communication apparatus with priority control |
7269186, | Aug 06 2001 | Qualcomm Incorporated | Protocol for framing a payload |
7487254, | Dec 20 2001 | Nokia Technologies Oy | Fixed length filtering to filter clusters of discrete segments of data |
8370936, | Feb 08 2002 | Juniper Networks, Inc | Multi-method gateway-based network security systems and methods |
20010007560, | |||
20010050923, | |||
20030018591, | |||
20030031172, | |||
20030039248, | |||
20030135636, | |||
20030154399, | |||
20040013112, | |||
20040039940, | |||
20040156371, |
Executed on | Assignor | Assignee | Conveyance | Frame | Reel | Doc |
Apr 04 2003 | Cisco Technology, Inc. | (assignment on the face of the patent) | / |
Date | Maintenance Fee Events |
Jun 04 2018 | M1551: Payment of Maintenance Fee, 4th Year, Large Entity. |
May 31 2022 | M1552: Payment of Maintenance Fee, 8th Year, Large Entity. |
Date | Maintenance Schedule |
Dec 02 2017 | 4 years fee payment window open |
Jun 02 2018 | 6 months grace period start (w surcharge) |
Dec 02 2018 | patent expiry (for year 4) |
Dec 02 2020 | 2 years to revive unintentionally abandoned end. (for year 4) |
Dec 02 2021 | 8 years fee payment window open |
Jun 02 2022 | 6 months grace period start (w surcharge) |
Dec 02 2022 | patent expiry (for year 8) |
Dec 02 2024 | 2 years to revive unintentionally abandoned end. (for year 8) |
Dec 02 2025 | 12 years fee payment window open |
Jun 02 2026 | 6 months grace period start (w surcharge) |
Dec 02 2026 | patent expiry (for year 12) |
Dec 02 2028 | 2 years to revive unintentionally abandoned end. (for year 12) |