home *** CD-ROM | disk | FTP | other *** search
/ Windows NT Super Tune-Up Kit / PIE-WindowsNTSuperTuneUpKit-1997.iso / FIX_40 / SYN-AT~1 / Q142641.TXT next >
Text File  |  1996-10-16  |  14KB  |  342 lines

  1. DOCUMENT:Q142641  07-OCT-1996  [winnt]
  2. TITLE   :Internet Server Unavailable Because of Malicious SYN Attacks
  3. PRODUCT :Microsoft Windows NT
  4. PROD/VER:3.51 4.00
  5. OPER/SYS:WINDOWS
  6. KEYWORDS:kbnetwork
  7.  
  8. --------------------------------------------------------------------------
  9. The information in this article applies to:
  10.  
  11.  - Microsoft Windows NT Server versions 3.51 and 4.0
  12. --------------------------------------------------------------------------
  13.  
  14. SYMPTOMS
  15. ========
  16.  
  17. On your computer running the TCP/IP protocol and connected to the Internet,
  18. some or all network services are rendered unavailable and error messages
  19. such as the following appear on the network client screen:
  20.  
  21.    The connection has been reset by the remote host.
  22.  
  23. This symptom of all network services being rendered unavailable may also
  24. occur on a computer running an operating system other than Windows NT, for
  25. example, Unix.
  26.  
  27. CAUSE
  28. =====
  29.  
  30. Your computer has become the target of a malicious attack known as TCP/IP
  31. "SYN Flooding" or "SYN Attacks."
  32.  
  33. "Computer hackers" can target an entire machine, or a specific TCP service
  34. such as web services. The attack is focused on the TCP protocol used by all
  35. computers on the Internet, and is not specific to the Windows NT operating
  36. system.
  37.  
  38. How SYN Flooding Works
  39. ----------------------
  40.  
  41. SYN Flooding works as follows: (see also CERT(sm) Advisory CA-96.21 at
  42. ftp://info.cert.org/pub/cert_advisories)
  43.  
  44.  - A TCP connection request (SYN) is sent to the target computer. The
  45.    source IP address in the packet is "spoofed," or replaced with an
  46.    address that is not in use on the Internet, or that belongs to another
  47.    computer. An attacker will send many of these TCP SYNs to tie up as many
  48.    resources as possible on the target computer.
  49.  
  50.  - Upon receiving the connection request, the target computer allocates
  51.    resources to handle and track the new connection, then responds with a
  52.    "SYN-ACK". In this case, the response is sent to the "spoofed" non-
  53.    existent IP address.
  54.  
  55.  - No response is received to the SYN-ACK. A default-configured Windows NT
  56.    3.5x or 4.0 computer will retransmit the SYN-ACK 5 times, doubling the
  57.    time-out value after each retransmission. The initial time-out value is
  58.    three seconds, so retries are attempted at 3, 6, 12, 24, and 48 seconds.
  59.    After the last retransmission, 96 seconds are allowed to pass before the
  60.    computer gives up on receiving a response, and deallocates the resources
  61.    that were set aside earlier for the connection. The total elapsed time
  62.    that resources are in use is 189 seconds.
  63.  
  64. How to Verify Your Computer is Under a SYN Attack
  65. -------------------------------------------------
  66.  
  67. If you suspect that your computer is the target of a SYN attack, you can
  68. type the following command at a command prompt to view connections in the
  69. "SYN_RECEIVED" state:
  70.  
  71.    netstat -n -p tcp
  72.  
  73. This command may cause the following text to appear on your screen:
  74.  
  75.    Active Connections
  76.  
  77.       Proto  Local Address         Foreign Address       State
  78.       TCP    127.0.0.1:1030        127.0.0.1:1032        ESTABLISHED
  79.       TCP    127.0.0.1:1032        127.0.0.1:1030        ESTABLISHED
  80.       TCP    10.57.8.190:21        10.57.14.154:1256     SYN_RECEIVED
  81.       TCP    10.57.8.190:21        10.57.14.154:1257     SYN_RECEIVED
  82.       TCP    10.57.8.190:21        10.57.14.154:1258     SYN_RECEIVED
  83.       TCP    10.57.8.190:21        10.57.14.154:1259     SYN_RECEIVED
  84.       TCP    10.57.8.190:21        10.57.14.154:1260     SYN_RECEIVED
  85.       TCP    10.57.8.190:21        10.57.14.154:1261     SYN_RECEIVED
  86.       TCP    10.57.8.190:21        10.57.14.154:1262     SYN_RECEIVED
  87.       TCP    10.57.8.190:21        10.57.14.154:1263     SYN_RECEIVED
  88.       TCP    10.57.8.190:21        10.57.14.154:1264     SYN_RECEIVED
  89.       TCP    10.57.8.190:21        10.57.14.154:1265     SYN_RECEIVED
  90.       TCP    10.57.8.190:21        10.57.14.154:1266     SYN_RECEIVED
  91.       TCP    10.57.8.190:4801      10.57.14.221:139      TIME_WAIT
  92.  
  93. If a large number of connections are in the SYN_RECEIVED state, it is
  94. possible that the system is under attack. A network analyzer can be used to
  95. track the problem down further, and it may be necessary to contact your
  96. Internet Service Provider for assistance in attempting to trace the source.
  97.  
  98. The effect of tying up connection resources varies, depending upon the
  99. TCP/IP stack and applications listening on the TCP port. For most stacks,
  100. there is a limit on the number of connections that can be in the half-open
  101. (SYN_RECEIVED) state. Once the limit is reached for a given TCP port, the
  102. target computer responds with a reset to all further connection requests
  103. until resources are freed.
  104.  
  105. RESOLUTION
  106. ==========
  107.  
  108. Obtain the following update or wait for the next Service Pack.
  109.  
  110. Microsoft is committed to providing the best possible protection against
  111. these attacks from within the Windows NT operating system and has made a
  112. number of changes to its TCP/IP components available to customers in
  113. response to this threat.
  114.  
  115. The changes in the update can be applied individually, or all at once, as
  116. deemed necessary.
  117.  
  118. The changes are listed here:
  119.  
  120. *******************************************************************
  121. *  1. Tcpip.sys times out half-open connections faster            *
  122. *******************************************************************
  123.  
  124. A new version of Tcpip.sys has been produced that allows control of the
  125. number of times a response to a TCP connection request (SYN-ACK) will be
  126. retransmitted. Control is handled through a new registry parameter:
  127.  
  128.   HKEY_LOCAL_MACHINE
  129.   \SYSTEM
  130.    \CurrentControlSet
  131.     \Services
  132.      \Tcpip
  133.       \Parameters
  134.        \TcpMaxConnectResponseRetransmissions
  135.            Value Type: REG_DWORD
  136.            Valid Range: 0-0xFFFFFFFF
  137.            Default: 3
  138.  
  139. The default value for this parameter is now 3. The following table shows
  140. Windows NT 4.0 TCP/IP behavior for various values of this parameter:
  141.  
  142. Value  Retransmission Times   Elapsed Time  Comments
  143. ---------------------------------------------------------------------------
  144. 3      3, 6, and 12 seconds   45 seconds    Cleanup 24 secs after last retx
  145. 2      3, and 6 seconds       21 seconds    Cleanup 12 secs after last retx
  146. 1      3 seconds              9  seconds    Cleanup 6  secs after last retx
  147.  
  148. This parameter changes the default time that it takes to clean up a half-
  149. open TCP connection from 189 seconds to 45 seconds, and provides more
  150. granular control to the administrator. A site that is under heavy attack
  151. might set the value as low as "1". A value of "0" is also valid; however if
  152. this parameter is set to 0, SYN-ACKs will not be retransmitted at all, and
  153. will time out in 3 seconds. With the value this low, legitimate connection
  154. attempts from distant clients may fail.
  155.  
  156. *******************************************************************
  157. *  2. NetBT has a Higher, Configurable Backlog                    *
  158. *******************************************************************
  159.  
  160. NetBT (NetBIOS over TCP/IP) uses TCP port 139 and is used by Microsoft
  161. Network Services such as file and print sharing. Version 3.51 and 4.0 NetBT
  162. has a "backlog" of connection blocks available that is two plus an
  163. incremental number depending on the NetBT clients (such as the redirector,
  164. server, and any NetBIOS applications running). On a typical server, this
  165. number will be 7-11. A new version of NetBT has been produced that
  166. automatically allocates more connection blocks as needed, in a configurable
  167. manner.
  168.  
  169. On a connection event, it now checks to see if the number of free blocks is
  170. below 2, and if so, adds an "increment" number of blocks, where "increment"
  171. is configurable in the registry as shown here:
  172.  
  173.   HKEY_LOCAL_MACHINE
  174.   \SYSTEM
  175.    \CurrentControlSet
  176.     \Services
  177.      \NetBt
  178.       \Parameters
  179.        \BacklogIncrement
  180.            Value Type: REG_DWORD
  181.            Valid Range: 1-0x14  (1-20 decimal)
  182.            Default: 3
  183.  
  184. Each connection block consumes 78 bytes of memory. The total number of
  185. connection blocks that can be allocated by NetBT is also registry
  186. configurable:
  187.  
  188.   HKEY_LOCAL_MACHINE
  189.   \SYSTEM
  190.    \CurrentControlSet
  191.     \Services
  192.      \NetBt
  193.       \Parameters
  194.        \MaxConnBackLog
  195.            Value Type: REG_DWORD
  196.            Valid Range: 1-0x9c40 (1-40,000 decimal)
  197.            Default: 1000
  198.  
  199. MaxConnBackLog defaults to 1000, but can be set as high as 40,000.
  200. Connection blocks are "scavenged," or recycled, when the SYN-ACK
  201. retransmission timer expires and TCP fails the connection attempt.
  202.  
  203. *******************************************************************
  204. *  3. Afd.sys has been modified to withstand large numbers of     *
  205. *     "half-open" connections efficiently                         *
  206. *******************************************************************
  207.  
  208. Windows Sockets applications such as ftp servers and web servers have their
  209. connection attempts handled by Afd.sys. Afd.sys has been modified to
  210. support large numbers of connections in the "half-open" state without
  211. denying access to legitimate clients. This is accomplished by allowing the
  212. administrator to configure a dynamic backlog.
  213.  
  214. The new version of Afd.sys supports four new registry parameters that
  215. can be used to control the dynamic backlog behavior.
  216.  
  217. EnableDynamicBacklog is a global switch to enable or disable dynamic
  218. backlog. It defaults to 0 (off), and this setting provides no change from
  219. the existing versions. Setting it to 1 enables the new dynamic backlog
  220. feature.
  221.  
  222.   HKEY_LOCAL_MACHINE
  223.   \SYSTEM
  224.    \CurrentControlSet
  225.     \Services
  226.      \AFD
  227.       \Parameters
  228.        \EnableDynamicBacklog
  229.            Value Type: REG_DWORD
  230.            Valid Range: 0,1
  231.            Default: 0
  232.            Suggested value for a system under heavy attack: 1
  233.  
  234. MinimumDynamicBacklog controls the minimum number of free connections
  235. allowed on a listening endpoint. If the number of free connections drops
  236. below this value, then a thread is queued to create additional free
  237. connections. This value should not be made too large, as the dynamic
  238. backlog code engages whenever the number of free connections falls below
  239. this value. Too large a value may lead to a performance reduction.
  240.  
  241.   HKEY_LOCAL_MACHINE
  242.   \SYSTEM
  243.    \CurrentControlSet
  244.     \Services
  245.      \AFD
  246.       \Parameters
  247.        \MinimumDynamicBacklog
  248.            Value Type: REG_DWORD
  249.            Valid Range: 0-0xFFFFFFFF
  250.            Default: 0
  251.            Suggested value for a system under heavy attack: 20
  252.  
  253. MaximumDynamicBacklog controls the maximum number of "quasi-free"
  254. connections allowed on a listening endpoint. "Quasi-free" connections
  255. include the number of free connections plus those connections in a half-
  256. connected (SYN_RECEIVED) state. No attempt is made to create additional
  257. free connections if doing so would exceed this value.
  258.  
  259.   HKEY_LOCAL_MACHINE
  260.   \SYSTEM
  261.    \CurrentControlSet
  262.     \Services
  263.      \AFD
  264.       \Parameters
  265.        \MaximumDynamicBacklog
  266.            Value Type: REG_DWORD
  267.            Valid Range: 0-0xFFFFFFFF
  268.            Default: 0
  269.            Suggested value for a system under heavy attack: Memory dependent.
  270.            This value should not exceed 5000 per 32M of RAM installed in the
  271.            server, in order to prevent exhaustion of non-paged pool when
  272.            under attack.
  273.  
  274. DynamicBacklogGrowthDelta controls the number of free connections to create
  275. when additional connections are necessary. Be careful with this value, as a
  276. large value could lead to explosive free connection allocations.
  277.  
  278.   HKEY_LOCAL_MACHINE
  279.   \SYSTEM
  280.    \CurrentControlSet
  281.     \Services
  282.      \AFD
  283.       \Parameters
  284.        \DynamicBacklogGrowthDelta
  285.            Value Type: REG_DWORD
  286.            Valid Range: 0-0xFFFFFFFF
  287.            Default: 0
  288.            Suggested value for a system under heavy attack: 10 (0xa)
  289.  
  290. To take advantage of the changes to Afd.sys, Windows Sockets applications
  291. must specifically request a backlog greater than the value configured for
  292. MinimumDynamicBacklog when they issue their listen() call. Microsoft
  293. applications such as Internet Information Server (which has a default
  294. backlog of 25) are configurable. Application-specific details are available
  295. from the Microsoft Knowledgbase at http://www.microsoft.com/kb.
  296.  
  297. The modified drivers for Windows NT and instructions for installing them
  298. are available from Microsoft support channels or directly from the
  299. following Internet locations:
  300.  
  301. For Windows NT 3.51:
  302.  
  303.    ftp://ftp.microsoft.com/bussys/winnt/winnt-public/fixes/usa/NT351
  304.    /hotfixes-postSP5/syn-attack
  305.  
  306. For Windows NT 4.00:
  307.  
  308.    ftp://ftp.microsoft.com/bussys/winnt/winnt-public/fixes/usa/nt40
  309.    /hotfixes-preSP1/syn-attack
  310.  
  311. STATUS
  312. ======
  313.  
  314. Microsoft has confirmed the TCP/IP protocol in Windows NT versions 3.51 and
  315. 4.0 to be vulnerable to these attacks.
  316. A supported update for Windows NT versions 3.51 and 4.0 is now available,
  317. but has not been fully regression-tested and should be applied only to
  318. systems experiencing this specific problem. Unless you are severely
  319. impacted by this specific problem, Microsoft recommends that you wait for
  320. the next Service Pack that contains this update. Contact Microsoft Product
  321. Support Services for more information.
  322.  
  323. KBCategory: kbnetwork kbbug3.51 kbbug4.00
  324. KBSubcategory: nttcp ntsrv
  325. Additional reference words: prodnt 3.51 4.00 CERT hack attack flood
  326.  
  327. ============================================================================
  328. THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS
  329. PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND.  MICROSOFT DISCLAIMS
  330. ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES
  331. OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  IN NO
  332. EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR
  333. ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL,
  334. CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF
  335. MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE
  336. POSSIBILITY OF SUCH DAMAGES.  SOME STATES DO NOT ALLOW THE EXCLUSION
  337. OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES
  338. SO THE FOREGOING LIMITATION MAY NOT APPLY.
  339.  
  340. Copyright Microsoft Corporation 1996.
  341.  
  342.