home *** CD-ROM | disk | FTP | other *** search
/ The Hacker's Encyclopedia 1998 / hackers_encyclopedia.iso / hacking / general / cert0126.txt < prev    next >
Encoding:
Text File  |  2003-06-11  |  21.2 KB  |  512 lines

  1.  
  2. -----BEGIN PGP SIGNED MESSAGE-----
  3.  
  4. =============================================================================
  5. CERT(sm) Advisory CA-96.21
  6. Original issue date: September 19, 1996
  7. Last revised: May 8, 1997
  8.               Updates - updated vendor information for Hewlett-Packard.
  9.  
  10.               A complete revision history is at the end of this file.
  11.  
  12. Topic: TCP SYN Flooding and IP Spoofing Attacks
  13. - -----------------------------------------------------------------------------
  14.            *** This advisory supersedes the IP spoofing
  15.                portion of CA-95:01. ***
  16.  
  17. Two "underground magazines" have recently published code to conduct
  18. denial-of-service attacks by creating TCP "half-open" connections. This code
  19. is actively being used to attack sites connected to the Internet. There is,
  20. as yet, no complete solution for this problem, but there are steps that can be
  21. taken to lessen its impact. Although discovering the origin of the attack is
  22. difficult, it is possible to do; we have received reports of attack origins
  23. being identified.
  24.  
  25. Any system connected to the Internet and providing TCP-based network services
  26. (such as a Web server, FTP server, or mail server) is potentially subject to
  27. this attack. Note that in addition to attacks launched at specific hosts,
  28. these attacks could also be launched against your routers or other network
  29. server systems if these hosts enable (or turn on) other TCP services (e.g.,
  30. echo). The consequences of the attack may vary depending on the system;
  31. however, the attack itself is fundamental to the TCP protocol used by all
  32. systems.
  33.  
  34. If you are an Internet service provider, please pay particular attention to
  35. Section III and Appendix A, which describes step we urge you to take to
  36. lessen the effects of these attacks. If you are the customer of an Internet
  37. service provider, please encourage your provider to take these steps.
  38.  
  39. This advisory provides a brief outline of the problem and a partial solution.
  40. We will update this advisory as we receive new information. If the change in
  41. information warrants, we may post an updated advisory on comp.security.announce
  42. and redistribute an update to our cert-advisory mailing list. As always, the
  43. latest information is available at the URLs listed at the end of this advisory.
  44.  
  45. - -----------------------------------------------------------------------------
  46.  
  47. I.  Description
  48.  
  49.      When a system (called the client) attempts to establish a TCP connection
  50.      to a system providing a service (the server), the client and server
  51.      exchange a set sequence of messages. This connection technique applies
  52.      to all TCP connections--telnet, Web, email, etc.
  53.  
  54.      The client system begins by sending a SYN message to the server. The
  55.      server then acknowledges the SYN message by sending SYN-ACK message to
  56.      the client. The client then finishes establishing the connection by
  57.      responding with an ACK message. The connection between the client and
  58.      the server is then open, and the service-specific data can be exchanged
  59.      between the client and the server. Here is a view of this message flow:
  60.  
  61.                 Client                  Server
  62.                 ------                  ------
  63.                 SYN-------------------->
  64.  
  65.                    <--------------------SYN-ACK
  66.  
  67.                 ACK-------------------->
  68.  
  69.                      Client and server can now
  70.                      send service-specific data
  71.  
  72.      The potential for abuse arises at the point where the server system has
  73.      sent an acknowledgment (SYN-ACK) back to client but has not yet received
  74.      the ACK message. This is what we mean by half-open connection. The
  75.      server has built in its system memory a data structure describing all
  76.      pending connections. This data structure is of finite size, and it can be
  77.      made to overflow by intentionally creating too many partially-open
  78.      connections.
  79.  
  80.      Creating half-open connections is easily accomplished with IP
  81.      spoofing. The attacking system sends SYN messages to the victim server
  82.      system; these appear to be legitimate but in fact reference a client
  83.      system that is unable to respond to the SYN-ACK messages. This means that
  84.      the final ACK message will never be sent to the victim server system.
  85.  
  86.      The half-open connections data structure on the victim server system
  87.      will eventually fill; then the system will be unable to accept any new
  88.      incoming connections until the table is emptied out. Normally there is a
  89.      timeout associated with a pending connection, so the half-open
  90.      connections will eventually expire and the victim server system will
  91.      recover. However, the attacking system can simply continue sending
  92.      IP-spoofed packets requesting new connections faster than the victim
  93.      system can expire the pending connections.
  94.  
  95.      In most cases, the victim of such an attack will have difficulty in
  96.      accepting any new incoming network connection. In these cases, the
  97.      attack does not affect existing incoming connections nor the ability to
  98.      originate outgoing network connections.
  99.  
  100.      However, in some cases, the system may exhaust memory, crash, or be
  101.      rendered otherwise inoperative.
  102.  
  103.      The location of the attacking system is obscured because the source
  104.      addresses in the SYN packets are often implausible. When the packet
  105.      arrives at the victim server system, there is no way to determine its
  106.      true source. Since the network forwards packets based on destination
  107.      address, the only way to validate the source of a packet is to use input
  108.      source filtering (see Appendix A).
  109.  
  110. II.  Impact
  111.  
  112.      Systems providing TCP-based services to the Internet community may
  113.      be unable to provide those services while under attack and for some
  114.      time after the attack ceases. The service itself is not harmed by the
  115.      attack; usually only the ability to provide the service is impaired.
  116.      In some cases, the system may exhaust memory, crash, or be rendered
  117.      otherwise inoperative.
  118.  
  119. III. Solution
  120.  
  121.      There is, as yet, no generally accepted solution to this problem with
  122.      the current IP protocol technology. However, proper router configuration
  123.      can reduce the likelihood that your site will be the source of one of
  124.      these attacks.
  125.  
  126.      Appendix A contains details about how to filter packets to reduce the
  127.      number of IP-spoofed packets entering and exiting your network. It also
  128.      contains a list of vendors that have reported support for this type of
  129.      filtering.
  130.  
  131.      NOTE to Internet Service Providers:
  132.         We STRONGLY urge you to install these filters in your routers to
  133.         protect your customers against this type of an attack. Although these
  134.         filters do not directly protect your customers from attack, the
  135.         filters do prevent attacks from originating at the sites of any of your
  136.         customers. We are aware of the ramifications of these filters on some
  137.         current Mobile IP schemes and are seeking a position statement from
  138.         the appropriate organizations.
  139.  
  140.      NOTE to customers of Internet service providers:
  141.         We STRONGLY recommend that you contact your service provider to verify
  142.         that the necessary filters are in place to protect your network.
  143.  
  144.      Many networking experts are working together to devise improvements to
  145.      existing IP implementations to "harden" kernels to this type of attack.
  146.      When these improvements become available, we suggest that you install
  147.      them on all your systems as soon as possible. This advisory will be
  148.      updated to reflect changes made by the vendor community.
  149.  
  150. IV.  Detecting an Attack
  151.  
  152.      Users of the attacked server system may notice nothing unusual since the
  153.      IP-spoofed connection requests may not load the system noticeably. The
  154.      system is still able to establish outgoing connections. The problem will
  155.      most likely be noticed by client systems attempting to access one of the
  156.      services on the victim system.
  157.  
  158.      To verify that this attack is occurring, check the state of the server
  159.      system's network traffic. For example, on SunOS this may be done by the
  160.      command:
  161.  
  162.               netstat -a -f inet
  163.  
  164.     Note that use of the above command depends on the OS version, for
  165.     example for a FreeBSD system use
  166.  
  167.               netstat -s |grep "listenqueue overflows"
  168.  
  169.      Too many connections in the state "SYN_RECEIVED" could indicate that the
  170.      system is being attacked.
  171.  
  172. ^L
  173. ...........................................................................
  174.  
  175. Appendix A - Reducing IP Spoofed Packets
  176.  
  177.  
  178. 1. Filtering Information
  179. - ------------------------
  180.  
  181. With the current IP protocol technology, it is impossible to eliminate
  182. IP-spoofed packets. However, you can take steps to reduce the number of
  183. IP-spoofed packets entering and exiting your network.
  184.  
  185. Currently, the best method is to install a filtering router that restricts
  186. the input to your external interface (known as an input filter) by not
  187. allowing a packet through if it has a source address from your internal
  188. network. In addition, you should filter outgoing packets that have a source
  189. address different from your internal network to prevent a source IP spoofing
  190. attack from originating from your site.
  191.  
  192. The combination of these two filters would prevent outside attackers from
  193. sending you packets pretending to be from your internal network. It would also
  194. prevent packets originating within your network from pretending to be from
  195. outside your network. These filters will *not* stop all TCP SYN attacks, since
  196. outside attackers can spoof packets from *any* outside network, and internal
  197. attackers can still send attacks spoofing internal addresses.
  198.  
  199. We STRONGLY urge Internet service providers to install these filters in your
  200. routers.
  201.  
  202. In addition, we STRONGLY recommend customers of Internet service providers to
  203. contact your service provider to verify that the necessary filters are in
  204. place to protect your network.
  205.  
  206.  
  207. 2. Vendor Information
  208. - ---------------------
  209.  
  210. The following vendor(s) have reported support for the type of filtering we
  211. recommend and provided pointers to additional information that describes how
  212. to configure your router. If you need more information about your router or
  213. about firewalls, please contact your vendor directly.
  214.  
  215.    Cisco
  216.    -----
  217.         Refer to the section entitled "ISP Security Advisory"
  218.         on http://www.cisco.com for an up-to-date explanation of
  219.         how to address TCP SYN flooding on a Cisco router.
  220.  
  221.  
  222. NOTE to vendors:
  223. If you are a router vendor who has information on router capabilities and
  224. configuration examples and you are not represented in this list, please
  225. contact the CERT Coordination Center at the addresses given in the Contact
  226. Information section below. We will update the advisory after we hear from you.
  227.  
  228.  
  229. 3. Alternative for routers that do not support filtering on the inbound side
  230. - ----------------------------------------------------------------------------
  231.  
  232. If your vendor's router does not support filtering on the inbound side of the
  233. interface or if there will be a delay in incorporating the feature into your
  234. system, you may filter the spoofed IP packets by using a second router
  235. between your external interface and your outside connection. Configure this
  236. router to block, on the outgoing interface connected to your original router,
  237. all packets that have a source address in your internal network. For this
  238. purpose, you can use a filtering router or a UNIX system with two interfaces
  239. that supports packet filtering.
  240.  
  241. Note: Disabling source routing at the router does not protect you from this
  242. attack, but it is still good security practice to follow.
  243.  
  244. On the input to your external interface, that is coming from the Internet to
  245. your network, you should block packets with the following addresses:
  246.  
  247. * Broadcast Networks: The addresses to block here are network 0 (the all zeros
  248.   broadcast address) and network 255.255.255.255 (the all ones broadcast
  249.   network).
  250.  
  251. * Your local network(s): These are your network addresses
  252.  
  253. * Reserved private network numbers: The following networks are defined
  254.   as reserved private networks, and no traffic should ever be received
  255.   from or transmitted to these networks through a router:
  256.  
  257.         10.0.0.0    - 10.255.255.255    10/8            (reserved)
  258.         127.0.0.0   - 127.255.255.255   127/8           (loopback)
  259.         172.16.0.0  - 172.31.255.255    172.16/12       (reserved)
  260.         192.168.0.0 - 192.168.255.255   192.168/16      (reserved)
  261.  
  262. - -----------------------------------------------------------------------------
  263. The CERT Coordination Center staff thanks the team members of NASIRC
  264. for contributing much of the text for this advisory and thanks the many
  265. experts who are devoting time to addressing the problem and who provided input
  266. to this advisory.
  267. - -----------------------------------------------------------------------------
  268.  
  269. If you believe that your system has been compromised, contact the CERT
  270. Coordination Center or your representative in the Forum of Incident Response
  271. and Security Teams (see ftp://info.cert.org/pub/FIRST/first-contacts).
  272.  
  273.  
  274. CERT/CC Contact Information
  275. - ---------------------------
  276. Email    cert@cert.org
  277.  
  278. Phone    +1 412-268-7090 (24-hour hotline)
  279.                 CERT personnel answer 8:30-5:00 p.m. EST(GMT-5) / EDT(GMT-4)
  280.                 and are on call for emergencies during other hours.
  281.  
  282. Fax      +1 412-268-6989
  283.  
  284. Postal address
  285.          CERT Coordination Center
  286.          Software Engineering Institute
  287.          Carnegie Mellon University
  288.          Pittsburgh PA 15213-3890
  289.          USA
  290.  
  291. Using encryption
  292.    We strongly urge you to encrypt sensitive information sent by email. We can
  293.    support a shared DES key or PGP. Contact the CERT/CC for more information.
  294.    Location of CERT PGP key
  295.          ftp://info.cert.org/pub/CERT_PGP.key
  296.  
  297. Getting security information
  298.    CERT publications and other security information are available from
  299.         http://www.cert.org/
  300.         ftp://info.cert.org/pub/
  301.  
  302.    CERT advisories and bulletins are also posted on the USENET newsgroup
  303.         comp.security.announce
  304.  
  305.    To be added to our mailing list for advisories and bulletins, send your
  306.    email address to
  307.         cert-advisory-request@cert.org
  308.  
  309. - ---------------------------------------------------------------------------
  310. Copyright 1996 Carnegie Mellon University
  311. This material may be reproduced and distributed without permission provided
  312. it is used for noncommercial purposes and the copyright statement is
  313. included.
  314.  
  315. CERT is a service mark of Carnegie Mellon University.
  316. - ---------------------------------------------------------------------------
  317.  
  318. This file: ftp://info.cert.org/pub/cert_advisories/CA-96.21.tcp_syn_flooding
  319.            http://www.cert.org
  320.                click on "CERT Advisories"
  321.  
  322. ==============================================================================
  323. UPDATES
  324.  
  325. 3COM
  326. ====
  327.  
  328.   Please refer to the "Network Security Advisory" link on
  329.   http://www.3com.com/ for a thorough discussion of
  330.   how to address TCP SYN flooding attacks on a 3Com router.
  331.  
  332.  
  333. Berkeley Software Design, Inc.
  334. =============================
  335. BSDI has patches available.
  336.  
  337. PATCH:
  338.     K210-021 (ftp://ftp.bsdi.com/bsdi/patches/patches-2.1/K210-021)
  339.     md5 checksum: c386e72f41d0e409d91b493631e364dd K210-021
  340.  
  341.         This patch adds two networking features that can help defeat
  342.         and detect some types of denial of service attacks.
  343.         This patch requires U210-025 which provides new copies of
  344.         sysctl(8) and netstat(1) for configuration and monitoring of
  345.         these new features.
  346.  
  347. PATCH:
  348.     K210-022 (ftp://ftp.bsdi.com/bsdi/patches/patches-2.1/K210-22)
  349.     md5 checksum: 9ec62b5e9cc424b9b42089504256d926 K210-022
  350.  
  351.         This patch adds a TCP SYN cache which reduces and/or
  352.         eliminates the effects of SYN-type denial of service attacks
  353.         such as those discussed in CERT advisory CA 96.21.
  354.  
  355. PATCH:
  356.     U210-025 (ftp://ftp.bsdi.com/bsdi/patches/patches-2.1/U210-025)
  357.     md5 checksum: d2ee01238ab6040e9b7a1bd2c3bf1016 U210-025
  358.  
  359.         This patch should be installed in conjunction with IP source
  360.         address check and IP fragmentation queue limit patch
  361.         (K210-021) and SYN flooding patch (K210-022).
  362.  
  363. Additional details about these patches are available from
  364.         http://www.bsdi.com
  365.         ftp://ftp.bsdi.com
  366.  
  367. Hewlett-Packard Company
  368. =======================
  369.  
  370.   HPSBUX9704-060
  371.   Description: SYN Flooding Security Vulnerability in HP-UX
  372.  
  373.   HEWLETT-PACKARD SECURITY BULLETIN: #00060
  374.  
  375.   Security Bulletins are available from the HP Electronic
  376.   Support Center via electronic mail.
  377.  
  378.   User your browser to get to the HP Electronic Support
  379.   Center page at:
  380.  
  381.            http://us-support.external.hp.com
  382.            (for US, Canada, Asia-Pacific, & Latin-America)
  383.  
  384.            http://europe-support.external.hp.com
  385.            (for Europe)
  386.  
  387.  
  388. IBM Corporation
  389. ===============
  390.  
  391. Any system that is connected to a TCP/IP-based network (Internet or
  392. intranet) and offers TCP-based services is vulnerable to the SYN flood
  393. attack.  The attack does not distinguish between operating systems,
  394. software version levels, or hardware platforms; all systems are
  395. vulnerable. IBM has released AIX operating system fixes for the SYN
  396. flood vulnerability.
  397.  
  398. NOTE: If you are using the IBM Internet Connection Secured Network Gateway
  399.       (SNG) firewall software, you must also apply the fixes listed in
  400.       the next section.
  401.  
  402. The following Automated Program Analysis Reports (APARs) for IBM AIX
  403. are now available to address the SYN flood attack:
  404.  
  405.           AIX 3.2.5
  406.           ---------
  407.               No APAR available; upgrade to AIX 4.x recommended
  408.  
  409.           AIX 4.1.x
  410.           ---------
  411.               APAR - IX62476
  412.  
  413.           AIX 4.2.x
  414.           ---------
  415.               APAR - IX62428
  416.  
  417.  
  418. Fixes for IBM SNG Firewall
  419. - -------------------------
  420.  
  421. The following Automated Program Analysis Reports (APARs) for the IBM
  422. Internet Connection Secured Network Gateway firewall product are now
  423. available to address the SYN flood and "Ping o' Death" attacks:
  424.  
  425. NOTE: The fixes in this section should ONLY be applied to systems running
  426.           the IBM Internet Connection Secured Network Gateway (SNG)
  427.           firewall software.  They should be applied IN ADDITION TO the
  428.           IBM AIX fixes listed in the previous section.
  429.  
  430.           IBM SNG V2.1
  431.           ------------
  432.               APAR - IR33376 PTF UR46673
  433.  
  434.           IBM SNG V2.2
  435.           ------------
  436.  
  437.               APAR - IR33484 PTF UR46641
  438.  
  439. Obtaining Fixes
  440. - ---------------
  441.  
  442. IBM AIX APARs may be ordered using Electronic Fix Distribution (via the
  443. FixDist program), or from the IBM Support Center.  For more information on
  444. FixDist, and to obtain fixes via the Internet, please reference
  445.  
  446.         http://service.software.ibm.com/aixsupport/
  447.  
  448. or send electronic mail to "aixserv@austin.ibm.com" with the word "FixDist"
  449. in the "Subject:" line.
  450.  
  451. Livingston Enterprises, Inc.
  452. ============================
  453.  
  454. Refer to the following Applications Note for more information on
  455. configuring a Livingston IRX or PortMaster to help block outgoing SYN
  456. attacks from an ISP's users:
  457.  
  458.         ftp://ftp.livingston.com/pub/le/doc/notes/filters.syn-attack
  459.  
  460.  
  461. Silicon Graphics, Inc.
  462. =====================
  463.  
  464. Updated Silicon Graphics information concerning SYN attacks
  465. can be found in SGI advisory number 19961202-01-PX.
  466.  
  467. SGI advisories are available from
  468.  
  469.          ftp://sgigate.sgi.com/security/
  470.  
  471. Sun Microsystems, Inc.
  472. ======================
  473. Sun published a bulletin on October 9, 1996--Sun security bulletin number
  474. 00136. Sun Security Bulletins are available via the security-alert@sun.com
  475. alias and on SunSolve.
  476.  
  477.  
  478. Note: Advisories from vendors listed in this section can also be found at
  479.          ftp://info.cert.org/pub/vendors/
  480.  
  481. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  482. Revision history
  483.  
  484. May 8, 1997    Updates - updated vendor information for Hewlett-Packard.
  485. Jan. 2, 1997   Updates - added or modified vendor information for SGI,
  486.                Livingston, HP, 3COM.
  487. Dec. 19, 1996  Updates - corrected Sun Microsystems security-alert email
  488.                address.
  489. Dec. 10, 1996  Appendix A, #3 - corrected next to last reserved private
  490.                network number entry.
  491. Dec. 09, 1996  Updates - added IBM patch information.
  492. Nov. 12, 1996  Introduction, paragraph 2 - added some clarification.
  493. Oct. 10, 1996  Updates - added a pointer to Sun Microsystems advisory.
  494.                          added a pointer to the CERT /pub/vendors directory.
  495. Oct. 08, 1996  Appendix A, #3 - revised the last item, reserved private
  496.                  network numbers
  497.                Updates - added BSDI patch information.
  498. Oct. 07, 1996  Updates - added a pointer to Silicon Graphics advisory.
  499. Sep. 24, 1996  Modified the supersession statement.
  500.  
  501.  
  502. -----BEGIN PGP SIGNATURE-----
  503. Version: 2.6.2
  504.  
  505. iQCVAwUBM3HVw3VP+x0t4w7BAQGwvgQAm/0HvEVlxY5K++H0bveMPo2b+LQ6VFoF
  506. bCJZmZdJ6gd/nyklzuh/op/IH+vWwaEvXPOuH8CC9Lceh1cqg4bRnzvg8bDpMFOe
  507. PbiXkLFnSFHw9ntWyl75cZ1mE3EZTeoxqvgK9CneETUEvD84gQjEYPQggSRhGMQq
  508. OrG4C3qCEv0=
  509. =QqnH
  510. -----END PGP SIGNATURE-----
  511.  
  512.