Skip to main content
XenonStack

Security Intelligence

XenonStack Insights Code Red Worm (CodeRed Virus): How It Spread and Stopped

and | Published | Updated

Code Red Worm (CodeRed Virus): How It Spread and Stopped
10:34
Code Red Worm Explained: stack from the MS01-033 IIS flaw, worm behaviour by day and CERT advice up to lessons for today.

Key takeaway

  • Code Red worm explained: the 2001 IIS exploit (MS01-033), how it spread, what CERT/CC advised, and the patching lessons for security leaders.

What was the Code Red worm?

Code Red was a self-propagating worm that began spreading on 13 July 2001 by exploiting a buffer overflow in the Indexing Service of Microsoft Internet Information Services (IIS). According to CERT Advisory CA-2001-19, it scanned for hosts listening on TCP port 80, sent a crafted HTTP GET request, and, on English-language systems, defaced web pages with the text "HELLO! Welcome to http://www.worm.com! Hacked By Chinese!".

The vulnerability had a patch before the worm appeared: Microsoft Security Bulletin MS01-033 was published on 18 June 2001. Code Red is therefore remembered less for its code than for what it showed about unpatched, internet-facing servers. This guide covers what the worm did, how it spread, what CERT/CC and Microsoft advised, and what enterprise security leaders can still take from it. For a current view of controls, see our guides on zero trust security architecture and agentic AI cybersecurity.

Which vulnerability did Code Red exploit?

Microsoft describes the flaw as an unchecked buffer in the idq.dll ISAPI extension, which handles input URLs for Index Server and the Indexing Service. According to Microsoft Security Bulletin MS01-033, an attacker with a web session to an affected server could cause a buffer overrun before any credential check, and run code in the Local System context, which gives full control of the server. The bulletin lists the CVE identifier as CAN-2001-0500 and credits eEye Digital Security with reporting it.

ItemWhat the official source saysSource
Affected productsMicrosoft Index Server 2.0 (Windows NT 4.0 Option Pack), Indexing Service in Windows 2000, and Windows XP beta versions before Release Candidate 1MS01-033
Default exposureWindows 2000 Server default installations are vulnerable; Windows NT 4.0 and Windows 2000 Professional defaults are not, but IIS installed manually makes them vulnerableMS01-033
Needs the service running?No. The flaw is exploitable while the .idq or .ida script mappings exist and IIS is runningMS01-033
WorkaroundRemove the .ida and .idq script mappings in IIS. Microsoft notes that adding or removing Windows components can restore them, so it recommends applying the patch regardlessMS01-033
FixPatch Q300972 for Windows NT 4.0 and Windows 2000; the fix is included in Windows 2000 Service Pack 3MS01-033

How did Code Red spread and what did it do?

On infection, the worm checks for the file c:\notworm and stops if it exists. Otherwise it starts threads that scan random IP addresses for vulnerable hosts (CERT Advisory CA-2001-19). Because every instance used the same random number generator seed, infected hosts scanned the same list of addresses, which CERT/CC warned could cause a denial of service against the addresses earliest in the list. CERT/CC's follow-up advisory on the continued threat of Code Red also notes that the defacement text exists only in memory, so searching the file system may not reveal a compromise.

Two-column diagram pairing Code Red worm stages (unpatched IIS, scanning, flood phase, memory-only presence) with controls: patch, ingress filtering, egress filtering, reboot and isolate.

Behaviour followed the day of the month, as described by CERT/CC:

Day of monthBehaviourSource
1st to 19thInfected hosts scan random IP addresses on TCP port 80 to spreadCERT/CC follow-up advisory
20th to 27thInfected hosts launch a packet-flooding denial-of-service attack against a specific IP address embedded in the codeCERT/CC follow-up advisory
After the 27thThe worm stays in memory but is inactiveCERT/CC follow-up advisory

Scale: the same CERT/CC follow-up advisory reports more than 250,000 systems infected in about nine hours on 19 July 2001 and at least 280,000 hosts in the first wave. The CAIDA case study of the worm counts more than 359,000 internet-connected computers infected on 19 July 2001. Counts differ because they come from different measurements. CERT/CC also expected the worm to resume spreading on 1 August 2001 because some infected systems had incorrect clocks. The target address of the flood is described only as a specific IP address in these advisories; confirm on the official page before naming a host.

Side effects reached beyond IIS. CERT/CC reports that unpatched Cisco 600-series DSL routers stopped forwarding packets after processing the worm's request, and that non-IIS web servers on port 80 would typically answer with HTTP 400 Bad Request and might log it.

What did the Code Red variants change?

CERT/CC reports at least two variants in the first wave: the earlier one defaced pages on English-language hosts, while the later one did not change page content. A separate worm, Code Red II, exploited the same IIS Indexing Service flaw; CERT/CC covered it in incident note IN-2001-09, titled "Code Red II: Another Worm Exploiting Buffer Overflow in IIS Indexing Service DLL". Its backdoor behaviour and any other variant names (for example "CodeBlue" or "CodeGreen") are not covered by the advisories we read in full, so confirm them on the official CERT/CC page before relying on them.

End-to-end proactive solutions for advanced threat protection and intelligence with real-time analytics: Cyber Security Services

How was Code Red stopped, and which controls still matter?

The primary advice in CERT Advisory CA-2001-19 was to apply the workarounds or patches from the underlying advisory on every affected host. CERT/CC's follow-up adds good-practice network controls. The table maps each to a modern equivalent.

2001 advice (source)What it addressedModern equivalent for enterprise teams
Apply the MS01-033 patch, or remove the .ida and .idq mappings (Microsoft)Known flaw on exposed web serversAsset inventory, patch service levels by exposure, and removal of unused components
Review and patch all affected hosts on your network (CERT/CC)Unpatched internal and external serversContinuous vulnerability management with named owners
Ingress filtering at the network edge (CERT/CC)Outside instances reaching internal machines not meant to be publicNetwork segmentation and default-deny exposure, as in a zero trust design
Egress filtering (CERT/CC)Compromised public servers sending worm traffic outwardOutbound traffic controls and monitoring from servers
Reboot a compromised host, take it offline, then patch (CERT/CC)The worm lives in memory, so a reboot clears it, but reinfection is likelyIsolate first, remediate the cause, then restore
Patch new software before connecting it to the network (CERT/CC)New systems exposed while unpatchedHardened build images and pre-deployment checks

What should enterprise leaders take from Code Red today?

First, the gap between a published patch and a mass infection was about a month (MS01-033 on 18 June, spread from 13 July 2001). The lesson is operational: know which systems are exposed and who owns patching them. Second, a worm that lives only in memory defeats file-based checks, so monitoring has to include network behaviour, as covered in our guide to self-healing SOC systems.

Third, the same discipline now applies to autonomous AI agents that hold credentials and call tools: each needs a defined scope, policy and an audit trail. According to its page, Elixir Govern (formerly AgentGRC) keeps AI agent actions inside policy with audit-ready records, and ElixirData Context OS keeps governed context, versioned policy and decision traces in one decision layer above AI agents. These are governance layers, not a defence against a 2001 worm.

Limits of this history: Code Red targeted a specific product line for which Microsoft issued a patch in 2001, so treat the advisories as a record of attack mechanics and response, not as a current checklist for IIS.

To map one security or patching decision your agents should make, and the context and policy it depends on, book a Context Workshop. See what happens in the workshop.

Code Red worm FAQ

What is the Code Red worm?

Code Red is a self-propagating worm that began spreading on 13 July 2001 by exploiting a buffer overflow in the Indexing Service of Microsoft IIS, according to CERT/CC advisories.

Which Microsoft bulletin covers the Code Red vulnerability?

Microsoft Security Bulletin MS01-033, published on 18 June 2001, covers the unchecked buffer in the idq.dll ISAPI extension, identified as CAN-2001-0500.

What did Code Red do to infected servers?

It scanned random IP addresses on TCP port 80 to spread, defaced pages on English-language systems with a fixed message, and, from the 20th to the 27th of the month, flooded a specific IP address, as described by CERT/CC.

How many systems did Code Red infect?

CERT/CC reports more than 250,000 systems infected in about nine hours on 19 July 2001, and CAIDA counts more than 359,000 computers that day. The figures differ because the measurements differ.

How do you stop a worm like Code Red?

CERT/CC advised patching affected hosts, ingress and egress filtering, and patching new software before connecting it to the network. For an infected host, a reboot clears the memory-resident worm but reinfection is likely until the patch is applied.

Is Code Red still a threat?

The advisories cover unpatched IIS 4.0 and 5.0 systems from 2001. Patched, supported systems are not affected by that flaw, so the main value today is the lesson on patching, exposure and monitoring.

Ready to put AI agents to work? See an ElixirClaw demo: the agentic OS to build, orchestrate and govern AI agents across your enterprise systems.

Table of Contents

navdeep-singh-gill

Navdeep Singh Gill

Global CEO and Founder of XenonStack

LinkedIn profile

Navdeep Singh Gill is serving as Chief Executive Officer and Product Architect at XenonStack. He holds expertise in building SaaS Platform for Decentralised Big Data management and Governance, AI Marketplace for Operationalising and Scaling. His incredible experience in AI Technologies and Big Data Engineering thrills him to write about different use cases and its approach to solutions.

Get the latest articles in your inbox

Subscribe Now

Interested in solving your challenges with the XenonStack team?
Get Started

Tell us about you and your priorities so we can prepare the right conversation. It takes about 2 minutes.

Please Select your Industry
Banking
Fintech
Payment Providers
Wealth Management
Discrete Manufacturing
Semiconductor
Machinery Manufacturing / Automation
Appliances / Electrical / Electronics
Elevator Manufacturing
Defense & Space Manufacturing
Computers & Electronics / Industrial Machinery
Motor Vehicle Manufacturing
Food and Beverages
Distillery & Wines
Beverages
Shipping
Logistics
Mobility (EV / Public Transport)
Energy & Utilities
Hospitality
Digital Gaming Platforms
SportsTech with AI
Public Safety - Explosives
Public Safety - Firefighting
Public Safety - Surveillance
Public Safety - Others
Media Platforms
City Operations
Airlines & Aviation
Defense Warfare & Drones
Robotics Engineering
Drones Manufacturing
AI Labs for Colleges
AI MSP / Quantum / AGI Institutes
Retail Apparel and Fashion

Continue