Microsoft IIS WebDAV Unicode Request Directory Security Bypass - Nessus

High   Plugin ID: 38808

This page contains detailed information about the Microsoft IIS WebDAV Unicode Request Directory Security Bypass Nessus plugin including available exploits and PoCs found on GitHub, in Metasploit or Exploit-DB for verifying of this vulnerability.

Plugin Overview


ID: 38808
Name: Microsoft IIS WebDAV Unicode Request Directory Security Bypass
Filename: webdav_iis6_flaw.nasl
Vulnerability Published: N/A
This Plugin Published: 2009-05-18
Last Modification Time: 2018-11-15
Plugin Version: 1.21
Plugin Type: remote
Plugin Family: Web Servers
Dependencies: DDI_Directory_Scanner.nasl, http_version.nasl, no404.nasl, webdav_enabled.nasl, webmirror.nasl
Excluded KB Items [?]: Settings/disable_cgi_scanning

Vulnerability Information


Severity: High
Vulnerability Published: N/A
Patch Published: N/A
CVE [?]: CVE-2009-1535
CPE [?]: N/A

Synopsis

It is possible to access protected resources through WebDAV.

Description

IIS 6.0 does not properly sanitize WebDAV requests. It is possible to access protected resources by inserting a Unicode / (%c0%af) in the URL.

Depending on the remote server configuration, protected resources may be browsed, read and/or modified.

Solution

Disable WebDAV or update the server.

Public Exploits


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

Here's the list of publicly known exploits and PoCs for verifying the Microsoft IIS WebDAV Unicode Request Directory Security Bypass vulnerability:

  1. Exploit-DB: exploits/windows/remote/8704.txt
    [EDB-8704: Microsoft IIS 6.0 - WebDAV Remote Authentication Bypass (1)]
  2. GitHub: https://github.com/Al1ex/WindowsElevation
    [CVE-2009-1535]
  3. GitHub: https://github.com/ycdxsb/WindowsPrivilegeEscalation
    [CVE-2009-1535]
  4. GitHub: https://github.com/offensive-security/exploitdb-bin-sploits/blob/master/bin-sploits/8704.pdf
    [EDB-8704]

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:POC/RL:OF/RC:C
CVSS Base Score:7.5 (High)
Impact Subscore:6.4
Exploitability Subscore:10.0
CVSS Temporal Score:5.9 (Medium)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:5.9 (Medium)

Go back to menu.

Plugin Source


This is the webdav_iis6_flaw.nasl nessus plugin source code. This script is Copyright (C) 2009-2018 Tenable Network Security, Inc.

#
# (C) Tenable Network Security, Inc.
#

include("compat.inc");

if(description)
{
 script_id(38808);
 script_version ("1.21");

 script_cve_id("CVE-2009-1535");
 script_bugtraq_id(34993);
 script_xref(name: "AUSCERT", value: "AL-2009.0041");
 script_xref(name: "CERTA", value: "CERTA-2009-ALE-007");
 script_xref(name: "CERT-FI", value: "038/2009");
 script_xref(name: "EDB-ID", value: "8704");

 script_name(english:"Microsoft IIS WebDAV Unicode Request Directory Security Bypass");
 script_summary(english: "Circumvent IIS 6.0 access control with WebDAV");

 script_set_attribute(attribute:"synopsis", value:
"It is possible to access protected resources through WebDAV." );
 script_set_attribute(attribute:"description", value:
"IIS 6.0 does not properly sanitize WebDAV requests.  It is possible
to access protected resources by inserting a Unicode / (%c0%af) in the
URL. 

Depending on the remote server configuration, protected resources may
be browsed, read and/or modified." );
 script_set_attribute(attribute:"see_also", value: "http://blog.zoller.lu/2009/05/iis-6-webdac-auth-bypass-and-data.html");
 script_set_attribute(attribute:"see_also", value: "http://www.nessus.org/u?36818b28");
 script_set_attribute(attribute:"see_also", value: "http://www.nessus.org/u?5fefdfc0");
 script_set_attribute(attribute:"see_also", value: "https://isc.sans.edu/diary/IIS6.0+WebDav+Remote+Auth+Bypass/6397");
 script_set_attribute(attribute:"see_also", value: "https://docs.microsoft.com/en-us/security-updates/SecurityAdvisories/2009/971492");
 script_set_attribute(attribute:"see_also", value: "http://unixwiz.net/techtips/ms971492-webdav-vuln.html");
 script_set_attribute(attribute:"see_also", value: "https://forums.iis.net/t/1149348.aspx");
 script_set_attribute(attribute:"solution", value:
"Disable WebDAV or update the server.");
  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:POC/RL:OF/RC:C");
  script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available");
  script_set_attribute(attribute:"exploit_available", value:"true");
script_cwe_id(287);
 script_set_attribute(attribute:"plugin_publication_date", value: "2009/05/18");
 script_cvs_date("Date: 2018/11/15 20:50:26");
 script_set_attribute(attribute:"plugin_type", value:"remote");
 script_end_attributes();

 script_category(ACT_ATTACK); 
 script_copyright(english:"This script is Copyright (C) 2009-2018 Tenable Network Security, Inc.");
 script_family(english: "Web Servers");

 script_dependencie("http_version.nasl", 
  "webmirror.nasl", 
  "http_version.nasl", 
  "DDI_Directory_Scanner.nasl", 
  "no404.nasl", 
  "webdav_enabled.nasl"
 );
 script_exclude_keys("Settings/disable_cgi_scanning");
 script_require_ports("Services/www", 80);
 exit(0);
}

#

include("global_settings.inc");
include("misc_func.inc");
include("http.inc");

port = get_http_port(default:80);

if (report_paranoia < 1)
{
  banner = get_http_banner(port: port);
  if ("Microsoft-IIS/" >!< banner) exit(0);
}

# We could check www/PORT/webdav but WebDAV may be enabled only for some directories

prot_url_l = get_kb_list("www/"+port+"/content/basic_auth/url/*");

if (! isnull(prot_url_l))
{
  prot_url_l = make_list(prot_url_l);
  for (i = 0; ! isnull(prot_url_l[i]); i ++)
  {
    # Make sure that the page requires authentication
    r = http_send_recv3(method: "GET", item: prot_url_l[i], port: port);
    if (isnull(r)) exit(0);
    if (r[0] !~ "^HTTP/1\.[01] 401 ") continue;

    h = make_array("Translate", "f");
    u = "/..%c0%af" + prot_url_l[i];

    r = http_send_recv3(method: "GET", port: port, item: u);
    if (isnull(r)) exit(0);
    if (r[0] =~ "^HTTP/1\.[01] 200 ") break;

    r = http_send_recv3(method: "GET", port: port, item: u, add_headers: h);
    if (isnull(r)) exit(0);
    if (r[0] =~ "^HTTP/1\.[01] 200 ")
    {
      security_hole(port);
      exit(0);
    }
    break;
  }
}

prot_dir_l = get_kb_list("www/"+port+"/content/directories/auth_required");
if (! isnull(prot_dir_l))
{
  xml = 
'<?xml version="1.0" encoding="utf-8"?>\r\n'+
'<propfind xmlns="DAV:"><prop>\r\n' +
'<getcontentlength xmlns="DAV:"/>\r\n'+
'<getlastmodified xmlns="DAV:"/>\r\n' +
'<executable xmlns="http://apache.org/dav/props/"/>\r\n' +
'<resourcetype xmlns="DAV:"/>\r\n' +
'<checked-in xmlns="DAV:"/>\r\n' +
'<checked-out xmlns="DAV:"/>\r\n' +
'</prop></propfind>\r\n';

  h = make_array( "Depth", "1", 
      		  "Connection", "TE", 
		  "TE", "trailers",
		  "Content-Type", "application/xml" );

  prot_dir_l = make_list(prot_dir_l);
  dir = NULL;
  for (i = 0; ! isnull(prot_dir_l[i]); i ++)
    if (strlen(prot_dir_l[i]) > 2)
    {
      # Make sure the page requires authentication
      r = http_send_recv3(method: "PROPFIND", item: prot_dir_l[i], port: port,
      	add_headers: h, data: xml);
      if (isnull(r)) exit(0);
      if (r[0] !~ "^HTTP/1\.[01] 401 ") continue;

      dir = strcat(substr(prot_dir_l[i], 0, 1), "%c0%af", substr(prot_dir_l[i], 2));
      break;
    }
  if (isnull(dir)) exit(0);

  r = http_send_recv3(port: port, method: "PROPFIND", item: dir,
    add_headers: h, data: xml );
  if (isnull(r)) exit(0);

  if ( r[0] =~ "^HTTP/1\.[01] 200 " ||
      (r[0] =~ "^HTTP/1\.[01] 207 " && "<a:status>HTTP/1.1 200 OK</a:status>" >< r[2]))
  {
    if (report_verbosity < 1)
      security_hole(port);
    else
    {
      if (report_verbosity == 1)
        extra = strcat('The following HTTP request got a 20x code instead of 401 :\n\n', http_last_sent_request());
      else
        extra = strcat('The following HTTP request :\n----------\n\n', http_last_sent_request(), '\n--------\nproduced this output :\n\n', r[0], r[1], '\n', r[2], '\n');
      security_hole(port:port, extra: extra);
    }
  }
}

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

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

Go back to menu.

How to Run


Here is how to run the Microsoft IIS WebDAV Unicode Request Directory Security Bypass 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 Microsoft IIS WebDAV Unicode Request Directory Security Bypass plugin ID 38808.
  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 webdav_iis6_flaw.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

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

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

/opt/nessus/bin/nasl -T - webdav_iis6_flaw.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 webdav_iis6_flaw.nasl -t <IP/HOST>

Go back to menu.

References


BID | SecurityFocus Bugtraq ID: CWE | Common Weakness Enumeration:
  • CWE-287 (Weakness) Improper Authentication
See also: Similar and related Nessus plugins:
  • 39342 - MS09-020: Vulnerabilities in Internet Information Services (IIS) Could Allow Elevation of Privilege (970483)
  • 64589 - Microsoft ASP.NET MS-DOS Device Name DoS (PCI-DSS check)
  • 64588 - Microsoft ASP.NET MS-DOS Device Name DoS
  • 153474 - Microsoft Open Management Infrastructure < 1.6.8.1 Multiple Vulnerabilities
  • 11923 - Microsoft FrontPage Server Extensions (fp30reg.dll) Debug Function Remote Overflow (MS03-051 / 813360)
  • 10497 - Microsoft FrontPage Extensions MS-DOS Device Request DoS
  • 10405 - Microsoft IIS FrontPage Server Extensions (FPSE) shtml.exe Path Disclosure
  • 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)
  • 108808 - Microsoft IIS 7.0 Vulnerabilities (uncredentialed) (PCI/DSS)
  • 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
  • 10685 - Microsoft IIS ISAPI Filter Multiple Vulnerabilities (MS01-044)
  • 11412 - Microsoft IIS WebDAV ntdll.dll Remote Overflow (MS03-007)
  • 10357 - Microsoft IIS MDAC RDS (msadcs.dll) Arbitrary Remote Command Execution
  • 11161 - Microsoft Data Access Components RDS Data Stub Remote Overflow
  • 11664 - Microsoft Media Services ISAPI nsiislog.dll Multiple Overflows
  • 153486 - Microsoft Open Management Infrastructure RCE (CVE-2021-38647)
  • 88648 - MS16-016: Security Update for WebDAV to Address Elevation of Privilege (3136041)

Version


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

Go back to menu.