home *** CD-ROM | disk | FTP | other *** search
/ Hacks & Cracks / Hacks_and_Cracks.iso / hackersclub / km / library / hack / pingodeath.txt < prev    next >
Text File  |  1998-03-25  |  6KB  |  94 lines

  1.             Large Packet Attacks
  2.             (AKA Ping of Death)
  3.            ---------------------------------
  4.  
  5.  
  6.     [ Introduction ]
  7.  
  8.     Recently, the Internet has seen a large surge in denial of service
  9. attacks.  A denial of service attack in this case is simply an action of some 
  10. kind that prevents the normal functionality of the network.  It denies service.
  11. This trend began a few months back with TCP SYN flooding and continues with the
  12. "large packet attack".  In comparison with SYN flooding, the large packet attack 
  13. is a much more simple attack in both concept (explained below) and execution 
  14. (the attack can be carried out by anyone with access to a Windows 95 machine).  
  15. TCP SYN flooding is more complex in nature and does not exploit a flaw so much 
  16. as it exploits an implementation weakness.  
  17.     The large packet attack is also much more devastating then TCP SYN 
  18. flooding.  It can quite simply cause a machine to crash, whereas SYN flooding 
  19. may just deny access to mail or web services of a machine for the duration of 
  20. the attack.  For more information on TCP SYN flooding see Phrack 49, article 13.
  21. (NOTE:  The large packet attack is somewhat misleadingly referred to as 'Ping of 
  22. Death` because it is often delivered as a ping packet.  Ping is a program that 
  23. is used to test a machine for reachablity to see if it alive and accepting 
  24. network requests.  Ping also happens to be a convenient way of sending the 
  25. large packet over to the target.)
  26.     The large packet attack has caused no end of problems to countless 
  27. machines across the Internet.  Since its discovery, *dozens* of operating 
  28. system kernels have been found vulnerable, along with many routers, terminal 
  29. servers, X-terminals, printers, etc.  Anything with a TCP/IP stack is in fact,
  30. potentially vulnerable.  The effects of the attack range from mild to 
  31. devastating.  Some vulnerable machines will hang for a relatively short period
  32. time then recover, some hang indefinitely, others dump core (writing a huge 
  33. file of current memory contents, often followed by a crash), some lose 
  34. all network connectivity, many rebooted or simply gave up the ghost.
  35.     
  36.     [ Relevant IP Basics ]    
  37.  
  38.     Contrary to popular belief, the problem has nothing to do with the
  39. `ping` program.  The problem lies in the IP module.  More specifically,
  40. the problem lies the in the fragmentation/reassembly portion of the IP module.
  41. This is portion of the IP protocol where the packets are broken into smaller 
  42. pieces for transit, and also where they are reassembled for processing.  An IP
  43. packet has a maximum size constrained by a 16-bit header field (a header is a 
  44. portion of a packet that contains information about the packet, including
  45. where it came from and where it is going).  The maximum size of an IP packet 
  46. is 65,535 (2^16-1) bytes.  The IP header itself is usually 20 bytes so this 
  47. leaves us with 65,515 bytes to stuff our data into.  The underlying link layer
  48. (the link layer is the network logically under IP, often ethernet) can seldom 
  49. handle packets this large (ethernet for example, can only handle packets up to 
  50. 1500 bytes in size).  So, in order for the link layer to be able to digest a 
  51. large packet, the IP module must fragment (break down into smaller pieces) 
  52. each packet it sends to down to the link layer for transmission on the network.
  53. Each individual fragment is a portion of the original packet, with its own 
  54. header containing information on exactly how the receiving end should put it 
  55. back together.  This putting the individual packets back together is called 
  56. reassembly.  When the receiving end has all of the fragments, it reassembles 
  57. them into the original IP packet, and then processes it.
  58.  
  59.     [ The attack ]
  60.  
  61.     The large packet attack is quite simple in concept.  A malicious user  
  62. constructs a large packet and sends it off.  If the destination host is
  63. vulnerable, something bad happens (see above).  The problem lies in the
  64. reassembly of these large packets.  Recall that we have 65,515 bytes of space 
  65. in which to stuff data into.  As it happens, a few misbehaved applications
  66. (and some specially crafted evil ones) will allow one to place slightly more 
  67. data into the payload (say 65,520 bytes).  This, along with a 20 byte IP
  68. header, violates the maximum packet size of 65,535 bytes.  The IP module will 
  69. then simply break this oversized packet into fragments and eschew them to 
  70. their intended destination (target).  The receiving host will queue all of the 
  71. fragments until the last one arrives, then begin the process of reassembly.  
  72. The problem will surface when the IP module finds that the packet is in
  73. fact larger than the maximum allowable size as an internal buffer is 
  74. overflowed.  This is where something bad happens (see above).
  75.     
  76.     [ Vulnerability Testing and Patching ]
  77.  
  78.     Testing to see if a network device is vulnerable is quite easy. 
  79. Windows NT and Windows 95 will allow construction of these oversized
  80. packets without complaining.  Simply type: `ping -l 65508 targethost`.  In
  81. this case, we are delivering an oversized IP packet inside of a ping packet, 
  82. which has a header size of 8 bytes.  If you add up the totals, 20 bytes of IP 
  83. header + 8 bytes of ping header + 65,508 bytes of data, you get a 65,536 byte 
  84. IP packet.  This is enough to cause affected systems to have problems.
  85.     Defense is preventative.  The only way to really be safe from this
  86. attack is to either ensure your system is patched, or unplug its network tap.
  87. There are patches available for just about every vulnerable system.  For
  88. a copious list of vulnerable systems and patches, check out a 'Ping of Death'
  89. webpage near you.
  90.  
  91.             daemon9
  92.             Editor, Phrack Magazine
  93.             (daemon9@netcom.com)
  94.