I. Description
The Nimda worm has the potential to affect both user workstations (clients)
running Windows 95, 98, ME, NT, or 2000 and servers running Windows NT and 2000.
Email Propagation
This worm propagates through email arriving as a MIME "multipart/alternative"
message consisting of two sections. The first section is defined as MIME type
"text/html", but it
contains no text, so the email appears to have no content. The second
section is defined as MIME type "audio/x-wav", but it contains a
base64-encoded attachment named "readme.exe", which is a binary executable.
Due to a vulnerability described in CA-2001-06
(Automatic Execution of Embedded MIME Types), any mail software running on an
x86 platform that uses
Microsoft Internet Explorer 5.5 SP1 or earlier (except IE 5.01 SP2) to render the HTML mail automatically
runs the enclosed attachment and, as result, infects the machine with the worm.
Thus, in vulnerable configurations, the worm
payload will automatically be triggered by simply opening (or previewing) this
mail message. As an executable binary, the
payload can also be triggered by simply running the attachment.
The email message delivering the Nimda worm appears to also have the
following characteristics:
- The text in the subject line of the mail message appears to be variable.
- There appear to be many slight variations in the attached binary file,
causing the MD5 checksum to be different when one compares different attachments
from different email messages. However, the file length of the attachment
appears to consistently be 57344 bytes.
The worm also contains code that will attempt to resend the
infected email messages every 10 days.
Payload
The email addresses targeted for receiving the worm are harvested from
two sources
- the .htm and .html files in the user's web cache folder
- the contents of the user's email messages retrieved via the MAPI service
These files are passed through a simple pattern matcher which collects
strings that look like email addresses. These addresses then receive
a copy of the worm as a MIME-encoded email attachment. Nimda stores
the time the last batch of emails were sent in the Windows registry,
and every 10 days will repeat the process of harvesting addresses and
sending the worm via email.
Likewise, the client machines begin scanning for vulnerable IIS
servers. Nimda looks for backdoors left by previous IIS worms: Code
Red II [IN-2001-09]
and sadmind/IIS worm [CA-2001-11].
It also attempts to exploit various IIS Directory Traversal
vulnerabilities (VU#111677
and CA-2001-12).
The selection of potential target IP addresses follows these rough
probabilities:
- 50% of the time, an address with the same first two octets will be chosen
- 25% of the time, an address with the same first octet will be chosen
- 25% of the time, a random address will be chosen
The infected client machine attempts to transfer a copy of the Nimda
code via tftp (69/UDP) to any IIS server that it scans and finds to be vulnerable.
Once running on the server machine, the worm traverses each
directory in the system (including all those accessible through file
shares) and writes a MIME-encoded copy of itself to disk using file
names with .eml or .nws extensions (e.g., readme.eml). When a
directory containing web content (e.g., HTML or ASP files) is found,
the following snippet of Javascript code is appended to every one of
these web-related files:
This modification of web content allows further propagation of the
worm to new clients through a web browser or through the browsing of a
network file system.
In order to further expose the machine, the worm
- enables the sharing
of the c: drive as C$
- creates a "Guest" account on Windows NT and
2000 systems
- adds this account to the "Administrator" group.
Furthermore, the Nimda worm infects existing binaries on the system by creating
Trojan horse copies of legitimate applications. These Trojan horse
versions of the applications will first execute the Nimda code
(further infecting the system and potentially propagating the worm),
and then complete their intended function.
Browser Propagation
As part of the infection process, the Nimda worm modifies all
web content files it finds (including, but not limited to, files with
.htm, .html, and .asp extensions). As a result, any user browsing web
content on the system, whether via the file system or via a web
server, may download a copy of the worm. Some browsers may
automatically execute the downloaded copy, thereby infecting the
browsing system.
File System Propagation
The Nimda worm creates numerous MIME-encoded copies of itself (using
file names with .eml and .nws extensions) in all writable directories
(including those found on a network share) to which the user has
access. If a user on another system subsequently selects the copy of
the worm file on the shared network drive in Windows Explorer with the
preview option enabled, the worm may be able to compromise that
system.
Additionally, by creating Trojan horse versions of legitimate
applications already installed on the system, users may unknowingly
trigger the worm when attempting to make use of these programs.
System FootPrint
The scanning activity of the Nimda worm produces the following log entries
for any web server listing on port 80/tcp:
GET /scripts/root.exe?/c+dir
GET /MSADC/root.exe?/c+dir
GET /c/winnt/system32/cmd.exe?/c+dir
GET /d/winnt/system32/cmd.exe?/c+dir
GET /scripts/..%5c../winnt/system32/cmd.exe?/c+dir
GET /_vti_bin/..%5c../..%5c../..%5c../winnt/system32/cmd.exe?/c+dir
GET /_mem_bin/..%5c../..%5c../..%5c../winnt/system32/cmd.exe?/c+dir
GET /msadc/..%5c../..%5c../..%5c/..\xc1\x1c../..\xc1\x1c../..\xc1\x1c../winnt/system32/cmd.exe?/c+dir
GET /scripts/..\xc1\x1c../winnt/system32/cmd.exe?/c+dir
GET /scripts/..\xc0/../winnt/system32/cmd.exe?/c+dir
GET /scripts/..\xc0\xaf../winnt/system32/cmd.exe?/c+dir
GET /scripts/..\xc1\x9c../winnt/system32/cmd.exe?/c+dir
GET /scripts/..%35c../winnt/system32/cmd.exe?/c+dir
GET /scripts/..%35c../winnt/system32/cmd.exe?/c+dir
GET /scripts/..%5c../winnt/system32/cmd.exe?/c+dir
GET /scripts/..%2f../winnt/system32/cmd.exe?/c+dir
Note: The first four entries in these sample logs denote attempts to
connect to the backdoor left by Code Red II, while the remaining log
entries are examples of exploit attempts for the Directory Traversal
vulnerability.