MS01-026 / MS01-044: Microsoft IIS Remote Command Execution (uncredentialed check) - Nessus

High   Plugin ID: 10671

This page contains detailed information about the MS01-026 / MS01-044: Microsoft IIS Remote Command Execution (uncredentialed check) Nessus plugin including available exploits and PoCs found on GitHub, in Metasploit or Exploit-DB for verifying of this vulnerability.

Plugin Overview


ID: 10671
Name: MS01-026 / MS01-044: Microsoft IIS Remote Command Execution (uncredentialed check)
Filename: iis_decode_bug.nasl
Vulnerability Published: 2001-05-15
This Plugin Published: 2001-05-15
Last Modification Time: 2022-04-11
Plugin Version: 1.63
Plugin Type: remote
Plugin Family: Web Servers
Dependencies: find_service1.nasl, http_version.nasl, www_fingerprinting_hmap.nasl

Vulnerability Information


Severity: High
Vulnerability Published: 2001-05-15
Patch Published: 2001-05-15
CVE [?]: CVE-2001-0333, CVE-2001-0507
CPE [?]: cpe:/a:microsoft:iis

Synopsis

Arbitrary commands can be executed on the remote web server.

Description

When IIS receives a user request to run a script, it renders the request in a decoded canonical form, and then performs security checks on the decoded request. A vulnerability results because a second, superfluous decoding pass is performed after the initial security checks are completed. Thus, a specially crafted request could allow an attacker to execute arbitrary commands on the IIS Server.

Solution

Microsoft has released a set of patches for IIS 4.0 and 5.0.

Public Exploits


Target Network Port(s): 80
Target Asset(s): Services/www
Exploit Available: True (Metasploit Framework, Exploit-DB, Immunity Canvas)
Exploit Ease: Exploits are available

Here's the list of publicly known exploits and PoCs for verifying the MS01-026 / MS01-044: Microsoft IIS Remote Command Execution (uncredentialed check) vulnerability:

  1. Metasploit: exploit/windows/iis/ms01_026_dbldecode
    [MS01-026 Microsoft IIS/PWS CGI Filename Double Decode Command Execution]
  2. Exploit-DB: exploits/windows/remote/16467.rb
    [EDB-16467: Microsoft IIS/PWS - CGI Filename Double Decode Command Execution (MS01-026) (Metasploit)]
  3. Immunity Canvas: CANVAS

Before running any exploit against any system, make sure you are authorized by the owner of the target system(s) to perform such activity. In any other case, this would be considered as an illegal activity.

WARNING: Beware of using unverified exploits from sources such as GitHub or Exploit-DB. These exploits and PoCs could contain malware. For more information, see how to use exploits safely.

Risk Information


CVSS V2 Vector [?]: AV:N/AC:L/Au:N/C:P/I:P/A:P/E:F/RL:OF/RC:C
CVSS Base Score:7.5 (High)
Impact Subscore:6.4
Exploitability Subscore:10.0
CVSS Temporal Score:6.2 (Medium)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:6.2 (Medium)

Go back to menu.

Plugin Source


This is the iis_decode_bug.nasl nessus plugin source code. This script is Copyright (C) 2001-2022 Matt Moore / H D Moore

#%NASL_MIN_LEVEL 70300
#
# This script was modified Matt Moore ([email protected])
# from the NASL script to test for the UNICODE directory traversal
# vulnerability, originally written by Renaud Deraison.
#
# Then Renaud took Matt's script and used H D Moore modifications
# to iis_dir_traversal.nasl ;)
#

# Changes by Tenable:
# - Touched up description (11/04/10)
# - Add MSKB script_xref (8/29/17)

include('deprecated_nasl_level.inc');
include('compat.inc');

if (description)
{
  script_id(10671);
  script_version("1.63");
  script_set_attribute(attribute:"plugin_modification_date", value:"2022/04/11");

  script_cve_id("CVE-2001-0333", "CVE-2001-0507");
  script_bugtraq_id(2708, 3193);
  script_xref(name:"MSFT", value:"MS01-026");
  script_xref(name:"MSFT", value:"MS01-044");
  script_xref(name:"MSKB", value:"288855");
  script_xref(name:"MSKB", value:"293826");
  script_xref(name:"MSKB", value:"294370");
  script_xref(name:"MSKB", value:"294774");
  script_xref(name:"MSKB", value:"295534");
  script_xref(name:"MSKB", value:"297860");
  script_xref(name:"MSKB", value:"298340");
  script_xref(name:"MSKB", value:"301625");
  script_xref(name:"MSKB", value:"304867");
  script_xref(name:"MSKB", value:"305359");

  script_name(english:"MS01-026 / MS01-044: Microsoft IIS Remote Command Execution (uncredentialed check)");

  script_set_attribute(attribute:"synopsis", value:
"Arbitrary commands can be executed on the remote web server.");
  script_set_attribute(attribute:"description", value:
"When IIS receives a user request to run a script, it renders the
request in a decoded canonical form, and then performs security checks
on the decoded request.  A vulnerability results because a second,
superfluous decoding pass is performed after the initial security checks
are completed.  Thus, a specially crafted request could allow an
attacker to execute arbitrary commands on the IIS Server.");
  script_set_attribute(attribute:"see_also", value:"https://docs.microsoft.com/en-us/security-updates/SecurityBulletins/2001/ms01-026");
  script_set_attribute(attribute:"see_also", value:"https://docs.microsoft.com/en-us/security-updates/SecurityBulletins/2001/ms01-044");
  script_set_attribute(attribute:"solution", value:
"Microsoft has released a set of patches for IIS 4.0 and 5.0.");
  script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:P/I:P/A:P");
  script_set_cvss_temporal_vector("CVSS2#E:F/RL:OF/RC:C");

  script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available");
  script_set_attribute(attribute:"exploit_available", value:"true");
  script_set_attribute(attribute:"metasploit_name", value:'MS01-026 Microsoft IIS/PWS CGI Filename Double Decode Command Execution');
  script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");
  script_set_attribute(attribute:"exploit_framework_canvas", value:"true");
  script_set_attribute(attribute:"canvas_package", value:"CANVAS");

  script_set_attribute(attribute:"vuln_publication_date", value:"2001/05/15");
  script_set_attribute(attribute:"patch_publication_date", value:"2001/05/15");
  script_set_attribute(attribute:"plugin_publication_date", value:"2001/05/15");

  script_set_attribute(attribute:"plugin_type", value:"remote");
  script_set_attribute(attribute:"cpe", value:"cpe:/a:microsoft:iis");
  script_set_attribute(attribute:"thorough_tests", value:"true");
  script_end_attributes();

  script_category(ACT_GATHER_INFO);
  script_family(english:"Web Servers");

  script_copyright(english:"This script is Copyright (C) 2001-2022 Matt Moore / H D Moore");

  script_dependencies("find_service1.nasl", "http_version.nasl", "www_fingerprinting_hmap.nasl");
  script_require_ports("Services/www", 80);

  exit(0);
}

include("global_settings.inc");
include("http_func.inc");
include("http_keepalive.inc");


port = get_http_port(default:80, embedded:TRUE);

banner = get_http_banner(port:port);
if ( "IIS" >!< banner ) exit(0);

if ( banner =~ "Microsoft-IIS/[6-9]" ) exit(0);

if(!get_port_state(port))exit(0);


dir[0] = "/scripts/";
dir[1] = "/msadc/";
dir[2] = "/iisadmpwd/";
dir[3] = "/_vti_bin/";		# FP
dir[4] = "/_mem_bin/";		# FP
dir[5] = "/exchange/";		# OWA
dir[6] = "/pbserver/";		# Win2K
dir[7] = "/rpc/";		# Win2K
dir[8] = "/cgi-bin/";
dir[9] = "/";

uni[0] = "%255c";  	dots[0] = "..";
uni[1] = "%%35c";	dots[1] = "..";
uni[2] = "%%35%63";	dots[2] = "..";
uni[3] = "%25%35%63";   dots[3] = "..";
uni[4] = "%252e";	dots[4] = "/.";




function check(req)
{
 local_var	r, pat, pat2;
 r = http_keepalive_send_recv(port:port, data:http_get(item:req, port:port));
 if(r == NULL)
 {
  exit(0);
 }

 pat = "<DIR>";
 pat2 = "Directory of C";

 if((pat >< r) || (pat2 >< r)){
   	security_hole(port:port, extra:
strcat('\n Requesting\n ', build_url(port: port, qs: req), '\n produces :\n\n', r));
	return(1);
 	}
 return(0);
}


cmd = "/winnt/system32/cmd.exe?/c+dir+c:\\+/OG";
for(d=0;dir[d];d=d+1)
{
	for(i=0;uni[i];i=i+1)
	{
		url = string(dir[d], dots[i], uni[i], dots[i], uni[i], dots[i], uni[i], dots[i], uni[i], dots[i], uni[i], dots[i], cmd);
		if(check(req:url))exit(0);
	}
}


# Slight variation- do the same, but don't put dots[i] in front
# of cmd (reported on vuln-dev)

for(d=0;dir[d];d=d+1)
{
	for(i=0;uni[i];i=i+1)
	{
		url = string(dir[d], dots[i], uni[i], dots[i], uni[i], dots[i], uni[i], dots[i], uni[i], dots[i], uni[i], cmd);
		if(check(req:url))exit(0);
	}
}


The latest version of this script can be found in these locations depending on your platform:

  • Linux / Unix:
    /opt/nessus/lib/nessus/plugins/iis_decode_bug.nasl
  • Windows:
    C:\ProgramData\Tenable\Nessus\nessus\plugins\iis_decode_bug.nasl
  • Mac OS X:
    /Library/Nessus/run/lib/nessus/plugins/iis_decode_bug.nasl

Go back to menu.

How to Run


Here is how to run the MS01-026 / MS01-044: Microsoft IIS Remote Command Execution (uncredentialed check) as a standalone plugin via the Nessus web user interface (https://localhost:8834/):

  1. Click to start a New Scan.
  2. Select Advanced Scan.
  3. Navigate to the Plugins tab.
  4. On the top right corner click to Disable All plugins.
  5. On the left side table select Web Servers plugin family.
  6. On the right side table select MS01-026 / MS01-044: Microsoft IIS Remote Command Execution (uncredentialed check) plugin ID 10671.
  7. Specify the target on the Settings tab and click to Save the scan.
  8. Run the scan.

Here are a few examples of how to run the plugin in the command line. Note that the examples below demonstrate the usage on the Linux / Unix platform.

Basic usage:

/opt/nessus/bin/nasl iis_decode_bug.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

/opt/nessus/bin/nasl -a iis_decode_bug.nasl -t <IP/HOST>

Run the plugin with trace script execution written to the console (useful for debugging):

/opt/nessus/bin/nasl -T - iis_decode_bug.nasl -t <IP/HOST>

Run the plugin with using a state file for the target and updating it (useful for running multiple plugins on the target):

/opt/nessus/bin/nasl -K /tmp/state iis_decode_bug.nasl -t <IP/HOST>

Go back to menu.

References


BID | SecurityFocus Bugtraq ID: MSKB | Microsoft Knowledge Base: MSFT | Microsoft Security Bulletin:
  • MS01-026, MS01-044
See also: Similar and related Nessus plugins:
  • 10685 - Microsoft IIS ISAPI Filter Multiple Vulnerabilities (MS01-044)
  • 108808 - Microsoft IIS 7.0 Vulnerabilities (uncredentialed) (PCI/DSS)
  • 10492 - MS00-006: Microsoft IIS IDA/IDQ Multiple Vulnerabilities (uncredentialed check)
  • 10116 - Microsoft IIS ISM.DLL HTR Request Remote Overflow
  • 10932 - Microsoft IIS .HTR ISAPI Filter Enabled
  • 11028 - Microsoft IIS .HTR Filter Multiple Overflows (MS02-028)
  • 31648 - Microsoft IIS webhits.dll Hit-Highlighting Authentication Bypass
  • 10759 - Web Server HTTP Header Internal IP Disclosure
  • 11412 - Microsoft IIS WebDAV ntdll.dll Remote Overflow (MS03-007)
  • 51956 - MS11-004: Vulnerability in Internet Information Services (IIS) FTP Service Could Allow Remote Code Execution (2489256) (uncredentialed check)
  • 59817 - Microsoft IIS 6.0 PHP NTFS Stream Authentication Bypass
  • 10657 - MS01-023: Microsoft IIS 5.0 Malformed HTTP Printer Request Header Remote Buffer Overflow (953155) (uncredentialed check)
  • 11370 - Microsoft IIS fpcount.exe CGI Remote Overflow
  • 10405 - Microsoft IIS FrontPage Server Extensions (FPSE) shtml.exe Path Disclosure
  • 40825 - MS09-053: Microsoft IIS FTPd NLST Command Remote Buffer Overflow (975191) (uncredentialed check)
  • 99523 - Microsoft Windows Server 2003 IIS 6.0 WebDAV PROPFIND Request Handling RCE (EXPLODINGCAN)
  • 99281 - Microsoft Windows Server 2003 R2 IIS 6.0 WebDAV PROPFIND Request Handling RCE (EXPLODINGCAN)
  • 10357 - Microsoft IIS MDAC RDS (msadcs.dll) Arbitrary Remote Command Execution
  • 10564 - Microsoft IIS Phone Book Service /pbserver/pbserver.dll Remote Overflow
  • 34407 - MS08-062: Microsoft IIS IPP Service Unspecified Remote Overflow (953155)
  • 39342 - MS09-020: Vulnerabilities in Internet Information Services (IIS) Could Allow Elevation of Privilege (970483)
  • 49223 - MS10-065: Vulnerabilities in Microsoft Internet Information Services (IIS) Could Allow Remote Code Execution (2267960)
  • 51904 - MS11-004: Vulnerability in Internet Information Services (IIS) FTP Service Could Allow Remote Code Execution (2489256)
  • 62905 - MS12-073: Vulnerabilities in Microsoft Internet Information Services (IIS) Could Allow Information Disclosure (2733829)
  • 79135 - MS14-076: Vulnerability in Internet Information Services (IIS) Could Allow Security Feature Bypass (2982998)
  • 38808 - Microsoft IIS WebDAV Unicode Request Directory Security Bypass
  • 119777 - GPON ONT Home Gateway Router is vulnerable to authenticated remote command execution (CVE-2018-10562)

Version


This page has been produced using Nessus Professional 10.1.2 (#68) LINUX, Plugin set 202205072148.
Plugin file iis_decode_bug.nasl version 1.63. For more plugins, visit the Nessus Plugin Library.

Go back to menu.