Microsoft IIS — 5 vulnerability checks

noctis ships 5 vulnerability checks for Microsoft IIS, covering 6 CVEs; each one has to observe the bug on the live service before it reports a finding.

← All products · Feeds on GitHub

Microsoft IIS .IDA ISAPI filter mapped

CVECVE-2001-0500
Severitycritical · CVSS 10.0
Categoryexposure — Exposure
Serviceshttp, https
Detectionset_var, script, tcp_connect, match · highest QoD 75
Feedtests/vulnerabilities/microsoft-iis/CVE-2001-0500.yaml

Requests a random, non-existent .ida file and checks that IIS hands it to the Indexing Service ISAPI extension (idq.dll), which answers "The IDQ file <path>\<name>.ida could not be found". That DLL carries the MS01-033 buffer overflow (CVE-2001-0500, Code Red). The overflow is not sent.

How noctis detects it

  1. Parses / computes the next value with a Rhai script
  2. Raw TCP (TLS on HTTPS), sent verbatim: GET /{{ida_name}}.ida HTTP/1.0
  3. Parses / computes the next value with a Rhai script
  4. Checks ida_resp.banner for IDQ[^\r\n]*noctis[0-9a-f]+\.ida → finding QoD 75: Microsoft IIS .IDA ISAPI filter (idq.dll) mapped — CVE-2001-0500

References:

Feed source — tests/vulnerabilities/microsoft-iis/CVE-2001-0500.yaml
# Microsoft IIS .IDA ISAPI filter mapped (Indexing Service, MS01-033) — CVE-2001-0500
#
# Ported from OpenVAS/Greenbone NVT pre2008/iis_ida_isapi.nasl
# (OID 1.3.6.1.4.1.25623.1.0.10695, GPL-2.0-only).
#
# The .ida/.idq extensions are handled by idq.dll (Indexing Service ISAPI).
# MS01-033 (CVE-2001-0500, the Code Red vector) is an unchecked buffer in
# that DLL giving remote SYSTEM code execution. When the .ida mapping is
# present and "Check that file exists" is off, a request for a missing
# .ida file is handed to idq.dll, which answers with its own error:
#
#   <HTML>The IDQ file c:\inetpub\wwwroot\x.ida could not be found.
#
# The NASL asks for /NULL.ida and greps "HTML.*IDQ.*NULL\.ida".
#
# Deviations from the NASL (stronger, fewer false positives):
#  - a per-run random file name (noctis<hex>.ida) instead of the static
#    NULL.ida, and the reply must quote THAT name inside the idq.dll error
#    sentence ("IDQ file ... <name>.ida could not be found"). A static page,
#    a honeypot or a generic 404 that merely reflects the path cannot
#    produce this; the NASL's loose ".*IDQ.*NULL\.ida" would.
#  - a localized idq.dll message (IIS in another language) still matches:
#    "IDQ" plus the random name behind a Windows path backslash.
#  - the reply is not required to start with "<HTML>" (the NASL drops the
#    finding when the error body is served without it).
#
# SAFE CHECK ONLY: the overflow itself is a memory-corruption bug with no
# echo primitive — triggering it crashes or owns the worker process — so it
# is never sent. The feed proves the vulnerable component (idq.dll behind
# the .ida mapping) is reachable from the network, which is what the NASL
# reports; a host patched for MS01-033 but still mapping .ida is reported
# too (Microsoft's guidance is to unmap .ida/.idq even when patched).
uid: f5e02d3d-4891-4e0a-92df-a5eea0bfd246
name: "Microsoft IIS .IDA ISAPI filter mapped (CVE-2001-0500)"
description: |
  Requests a random, non-existent .ida file and checks that IIS hands it to
  the Indexing Service ISAPI extension (idq.dll), which answers "The IDQ file
  <path>\<name>.ida could not be found". That DLL carries the MS01-033 buffer
  overflow (CVE-2001-0500, Code Red). The overflow is not sent.
cves: [CVE-2001-0500]
cvss: 10.0
severity: critical
category: exposure
confidence_base: 0.30
tags: [iis, microsoft, isapi, ida, idq, indexing-service, ms01-033, code-red]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2001-0500"
  - "https://learn.microsoft.com/en-us/security-updates/securitybulletins/2001/ms01-033"
  - "https://seclists.org/bugtraq/2000/Jan/204"

steps:
  - id: init-hit
    action: set_var
    var_name: idq_hit
    var_value: false

  # Per-run random file name, so only a live idq.dll can quote it back.
  - id: mint-name
    action: script
    code: '"noctis" + rand_hex(6)'
    store_as: ida_name

  # Raw request, same shape as the NASL's http_get (no URL normalisation).
  - id: probe-ida
    action: tcp_connect
    port: "{{port}}"
    send: "GET /{{ida_name}}.ida HTTP/1.0\r\nHost: {{target_host}}\r\n\r\n"
    timeout_secs: 10
    store_as: ida_resp

  # The idq.dll error must name OUR random file: either the English sentence,
  # or (localized IIS) "IDQ" plus our name behind a Windows path backslash —
  # the physical path idq.dll quotes; a 404 page reflecting the URL has "/".
  - id: check-idq-error
    action: script
    code: |
      let b = ida_resp.banner;
      if type_of(b) != "string" { false } else {
        let l = tolower(b);
        let name = tolower(ida_name) + ".ida";
        (l.contains("the idq file ") && l.contains(name + " could not be found"))
          || (l.contains("idq") && l.contains("\\" + name))
      }
    store_as: idq_hit

  - id: confirm-ida-mapping
    action: match
    source: ida_resp.banner
    pattern: "IDQ[^\\r\\n]*noctis[0-9a-f]+\\.ida"
    case_insensitive: true
    condition: "idq_hit == true"
    on_match:
      finding:
        title: "Microsoft IIS .IDA ISAPI filter (idq.dll) mapped — CVE-2001-0500"
        description: "IIS passed a request for a random, non-existent .ida file to the Indexing Service ISAPI extension (idq.dll), which answered with its own 'IDQ file ... could not be found' error. idq.dll is affected by the MS01-033 unchecked buffer (CVE-2001-0500, exploited by Code Red) giving remote SYSTEM code execution on unpatched hosts. The overflow was not sent: the patch level is not proven."
        remediation: "Apply MS01-033 and remove the .ida and .idq script mappings (or enable 'Check that file exists' on them) unless the Indexing Service web query feature is required; migrate off end-of-life IIS 4.0/5.0."
        confidence_delta: 0.55
        qod: 75
        evidence: "idq.dll answered for GET /{{ida_name}}.ida: {{ida_resp.banner}}"
      stop: true

Microsoft IIS 6.0 WebDAV ScStoragePathFromUrl RCE

CVECVE-2017-7269
Severitycritical · CVSS 9.8
Categoryrce — Remote code execution
Serviceshttp, https
Detectionset_var, tcp_connect, match · highest QoD 75
Feedtests/vulnerabilities/microsoft-iis/CVE-2017-7269.yaml

Safe differential fingerprint for the IIS 6.0 WebDAV buffer overflow. Confirms a Microsoft-IIS/6.0 server with WebDAV enabled (PROPFIND -> 207 Multi-Status) while a plain OPTIONS control does not return 207, without sending the overflow payload.

How noctis detects it

  1. Raw TCP (TLS on HTTPS), sent verbatim: OPTIONS / HTTP/1.1
  2. Checks ctrl_resp.banner for Server:\s*Microsoft-IIS/6\.0
  3. Checks ctrl_resp.banner for HTTP/1\.[01]\s+207
  4. Raw TCP (TLS on HTTPS), sent verbatim: PROPFIND / HTTP/1.1
  5. Checks dav_resp.banner for HTTP/1\.[01]\s+207\s+Multi-Status
  6. Checks dav_resp.banner for multistatus → finding QoD 75: Microsoft IIS 6.0 WebDAV enabled — vulnerable to CVE-2017-7269

References:

Feed source — tests/vulnerabilities/microsoft-iis/CVE-2017-7269.yaml
# Microsoft IIS 6.0 WebDAV ScStoragePathFromUrl Buffer Overflow RCE — CVE-2017-7269
#
# Windows Server 2003 R2 / IIS 6.0 ships a WebDAV service whose
# ScStoragePathFromUrl() mishandles an over-long header on a PROPFIND
# request, yielding unauthenticated remote code execution (CISA KEV,
# EPSS ~1.0, CVSS 9.8). Actively exploited in the wild.
#
# SAFE DETECTION ONLY — this is a memory-corruption bug with no echo
# primitive, so we DO NOT send the overflow / shellcode. Instead we
# fingerprint the *vulnerable configuration* with a tight, differential
# response-analysis check (QoD 75):
#
#   Signal A — Server banner reports "Microsoft-IIS/6.0"
#   Signal B — WebDAV is ENABLED: a normal PROPFIND returns 207
#              Multi-Status with a DAV multistatus body (patched / WebDAV
#              disabled hosts answer 403 / 501 instead).
#
# Guard: a plain OPTIONS control request must NOT itself return 207 — this
# rules out a server that answers 207 to everything, and a non-IIS host or
# an IIS host with WebDAV disabled both fail the combined condition.
# Only a benign, normal-length If: header is sent to reach the WebDAV code
# path; never an oversized value and never shellcode.
uid: 47e02d86-12bc-4bcb-b96e-c0294aca922f
name: "Microsoft IIS 6.0 WebDAV ScStoragePathFromUrl RCE (CVE-2017-7269)"
description: |
  Safe differential fingerprint for the IIS 6.0 WebDAV buffer overflow.
  Confirms a Microsoft-IIS/6.0 server with WebDAV enabled (PROPFIND -> 207
  Multi-Status) while a plain OPTIONS control does not return 207, without
  sending the overflow payload.
cves: [CVE-2017-7269]
cvss: 9.8
severity: critical
category: rce
confidence_base: 0.25
tags: [iis, microsoft, webdav, propfind, rce, kev]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2017-7269"
  - "https://github.com/zcgonvh/cve-2017-7269"
  - "https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2017/CVE-2017-7269.yaml"

steps:
  # Guard vars — initialise before use (undefined var in a condition throws).
  - id: init-iis
    action: set_var
    var_name: iis_banner
    var_value: false

  - id: init-webdav
    action: set_var
    var_name: webdav_enabled
    var_value: false

  - id: init-control207
    action: set_var
    var_name: control_is_207
    var_value: false

  # ── Control: a plain OPTIONS request ─────────────────────────────────────
  # Used both to read the Server banner and as a differential baseline: a
  # genuine WebDAV server answers OPTIONS with 200 (never 207), so a host
  # that returns 207 here is answering 207 to everything -> not a real
  # WebDAV PROPFIND handler.
  - id: control-options
    action: tcp_connect
    port: "{{port}}"
    send: "OPTIONS / HTTP/1.1\r\nHost: {{target_host}}\r\nConnection: close\r\n\r\n"
    timeout_secs: 10
    store_as: ctrl_resp

  - id: match-iis-banner
    action: match
    source: ctrl_resp.banner
    pattern: "Server:\\s*Microsoft-IIS/6\\.0"
    case_insensitive: true
    on_match:
      set_vars:
        iis_banner: true

  - id: match-control-207
    action: match
    source: ctrl_resp.banner
    pattern: "HTTP/1\\.[01]\\s+207"
    on_match:
      set_vars:
        control_is_207: true

  # ── Probe: a normal PROPFIND (reaches the WebDAV code path) ──────────────
  # tcp_connect is required: the PROPFIND method and the If: header carry
  # characters reqwest would mangle. The If: value is a benign, normal-length
  # lock token — NOT an overflow. Depth: 0 keeps the request minimal.
  - id: probe-propfind
    action: tcp_connect
    port: "{{port}}"
    send: "PROPFIND / HTTP/1.1\r\nHost: {{target_host}}\r\nDepth: 0\r\nIf: (<locktoken:noctis-probe>)\r\nContent-Length: 0\r\nConnection: close\r\n\r\n"
    timeout_secs: 10
    store_as: dav_resp

  - id: match-webdav-207
    action: match
    source: dav_resp.banner
    pattern: "HTTP/1\\.[01]\\s+207\\s+Multi-Status"
    case_insensitive: true
    condition: "iis_banner == true"
    on_match:
      set_vars:
        webdav_enabled: true

  # ── Finding: both signals present, control did not false-positive ────────
  - id: confirm-vulnerable-config
    action: match
    source: dav_resp.banner
    pattern: "multistatus"
    case_insensitive: true
    condition: "iis_banner == true && webdav_enabled == true && control_is_207 == false"
    on_match:
      finding:
        title: "Microsoft IIS 6.0 WebDAV enabled — vulnerable to CVE-2017-7269"
        description: "Microsoft-IIS/6.0 with WebDAV enabled (PROPFIND -> 207 Multi-Status). This configuration is affected by the ScStoragePathFromUrl buffer overflow RCE."
        remediation: "Disable the WebDAV extension in IIS 6.0, or migrate off end-of-life Windows Server 2003 / IIS 6.0."
        confidence_delta: 0.50
        qod: 75
        evidence: "IIS/6.0 banner + WebDAV PROPFIND 207 (OPTIONS control not 207): {{dav_resp.banner}}"
      stop: true

Microsoft W3Who ISAPI (w3who.dll) reflected XSS and buffer overflow

CVECVE-2004-1133, CVE-2004-1134
Severitycritical · CVSS 10.0
Categoryxss — XSS
Serviceshttp, https
Detectionscript, tcp_connect, match · highest QoD 75
Feedtests/vulnerabilities/microsoft-iis/w3who-dll-xss-overflow.yaml

Checks for the W3Who ISAPI extension (w3who.dll) from the Windows 2000/XP Resource Kit, which discloses the caller's access token and the server environment, echoes invalid parameters unescaped in its error page (CVE-2004-1133) and overflows a stack buffer on a long query string (CVE-2004-1134). No fixed version was ever released. The test requests /scripts/w3who.dll and expects an HTTP 200 page listing the access token and its security identifiers (SIDs), then sends an invalid parameter carrying a random, inert HTML tag and reports the cross-site scripting as confirmed when the tag comes back unescaped. If the tag is not echoed, the exposed extension is reported at a lower confidence. The long query string that triggers the overflow is never sent, because it crashes the web server worker process.

How noctis detects it

  1. Parses / computes the next value with a Rhai script
  2. Raw TCP (TLS on HTTPS), sent verbatim: GET /scripts/w3who.dll HTTP/1.0
  3. Checks page.banner for \AHTTP/1\.[01] 200[^\r\n]*\r?\n(?s:.*)(?:Access Token(?s:.*)\bS-1-\d+…
  4. Raw TCP (TLS on HTTPS), sent verbatim: GET /scripts/w3who.dll?bogus=<{{tag}}> HTTP/1.0
  5. Parses / computes the next value with a Rhai script
  6. Checks verdict for ^W3WHO_XSS_CONFIRMED$ → finding QoD 75: Microsoft W3Who ISAPI (w3who.dll) reflected XSS confirmed — CVE-2004-1133, CVE-2004-1134
  7. Checks verdict for ^W3WHO_EXPOSED$ → finding QoD 70: Microsoft W3Who ISAPI (w3who.dll) exposed — CVE-2004-1133, CVE-2004-1134

References:

Feed source — tests/vulnerabilities/microsoft-iis/w3who-dll-xss-overflow.yaml
# Microsoft W3Who ISAPI (w3who.dll) — reflected XSS + buffer overflow
# (CVE-2004-1133, CVE-2004-1134)
#
# Ported from OpenVAS/Greenbone NVT pre2008/w3who_dll.nasl
# (OID 1.3.6.1.4.1.25623.1.0.15910, GPL-2.0-only).
#
# w3who.dll is a Windows 2000/XP Resource Kit ISAPI extension that dumps the
# caller's access token (user, SIDs, groups, privileges) and the server
# environment variables. Exaprobe ESA-2004-1206 (6 Dec 2004) reported:
#   - CVE-2004-1133: reflected XSS — invalid query parameters are echoed
#     unescaped in the DLL's error page (PoC: /scripts/w3who.dll?bogus=<script>…),
#     and so are some request headers (Connection);
#   - CVE-2004-1134: stack buffer overflow on a long query string (519+ chars).
# Microsoft withdrew the download and never shipped a fixed build, so every
# reachable w3who.dll carries both flaws.
#
# The NASL GETs /scripts/w3who.dll, greps "Access Token", and — with safe
# checks off — sends a 600-byte query and looks for an HTTP 500 "Error" page,
# i.e. it fires the overflow itself.
#
# Deviations from the NASL (stronger, and never sends the overflow):
#  - the page must come back HTTP 200 with "Access Token" (the NASL greps the
#    whole reply, status line included);
#  - the XSS is proven in-band: a per-run inert tag <noctis<hex>> is sent in an
#    invalid parameter, exactly like the advisory PoC, and must come back
#    unescaped from w3who.dll → QoD 75. A static page cannot echo a random tag;
#  - the long-query overflow probe is dropped: it crashes or hijacks the IIS
#    worker process. When the tag is not echoed (e.g. a filter in front of
#    IIS strips "<"), the exposed DLL is still reported at QoD 70, since no
#    fixed version exists;
#  - the evidence never copies the page: it lists the caller's SIDs and the
#    server environment.
uid: dcb84f52-2946-441c-99b7-fc87753d7de8
name: "Microsoft W3Who ISAPI (w3who.dll) reflected XSS and buffer overflow (CVE-2004-1133, CVE-2004-1134)"
description: |
  Checks for the W3Who ISAPI extension (w3who.dll) from the Windows 2000/XP
  Resource Kit, which discloses the caller's access token and the server
  environment, echoes invalid parameters unescaped in its error page
  (CVE-2004-1133) and overflows a stack buffer on a long query string
  (CVE-2004-1134). No fixed version was ever released. The test requests
  /scripts/w3who.dll and expects an HTTP 200 page listing the access token and its security identifiers (SIDs),
  then sends an invalid parameter carrying a random, inert HTML tag and
  reports the cross-site scripting as confirmed when the tag comes back
  unescaped. If the tag is not echoed, the exposed extension is reported at a
  lower confidence. The long query string that triggers the overflow is never
  sent, because it crashes the web server worker process.
cves: [CVE-2004-1133, CVE-2004-1134]
cvss: 10.0
severity: critical
category: xss
confidence_base: 0.30
tags: [iis, microsoft, isapi, w3who, resource-kit, xss, buffer-overflow, information-disclosure]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2004-1133"
  - "https://nvd.nist.gov/vuln/detail/CVE-2004-1134"
  - "https://seclists.org/vulnwatch/2004/q4/26"

steps:
  # Per-run inert tag, so only a live reflection can echo it back.
  - id: mint-tag
    action: script
    code: '"noctis" + rand_hex(8)'
    store_as: tag

  # Raw request, same as the NASL's http_get.
  - id: probe-page
    action: tcp_connect
    port: "{{port}}"
    send: "GET /scripts/w3who.dll HTTP/1.0\r\nHost: {{target_host}}\r\n\r\n"
    timeout_secs: 10
    store_as: page

  # HTTP 200 + the access-token dump: the "Access Token" heading AND at least
  # one Windows SID (S-1-<authority>-…), which the page always lists, so a
  # catch-all 200 page that merely mentions "Access Token" (OAuth/API docs)
  # does not count. Stored only (no finding here): the verdict below decides
  # which finding fires.
  - id: page-check
    action: match
    source: page.banner
    pattern: '\AHTTP/1\.[01] 200[^\r\n]*\r?\n(?s:.*)(?:Access Token(?s:.*)\bS-1-\d+-\d+|\bS-1-\d+-\d+(?s:.*)Access Token)'
    store_as: page_m

  # The advisory's PoC shape: an invalid parameter whose value is echoed in
  # the DLL's error page. "<" and ">" are sent raw (tcp_connect, no URL
  # normalisation), as a browser of the time did.
  - id: probe-xss
    action: tcp_connect
    condition: "page_m.matched == true"
    port: "{{port}}"
    send: "GET /scripts/w3who.dll?bogus=<{{tag}}> HTTP/1.0\r\nHost: {{target_host}}\r\n\r\n"
    timeout_secs: 10
    store_as: xss

  # Fixed verdict string as the match source: nothing from the target (SIDs,
  # environment) reaches the finding.
  - id: verdict
    action: script
    code: |
      let v = "";
      if page_m.matched == true {
        v = "W3WHO_EXPOSED";
        let b = if is_def_var("xss") { xss.banner } else { () };
        if type_of(b) == "string" && b.contains("<" + tag + ">") {
          v = "W3WHO_XSS_CONFIRMED";
        }
      }
      v
    store_as: verdict

  - id: xss-confirmed
    action: match
    source: verdict
    pattern: '^W3WHO_XSS_CONFIRMED$'
    on_match:
      finding:
        title: "Microsoft W3Who ISAPI (w3who.dll) reflected XSS confirmed — CVE-2004-1133, CVE-2004-1134"
        description: "/scripts/w3who.dll answered with the caller's access token dump and echoed a random HTML tag sent in an invalid parameter back unescaped, confirming the reflected cross-site scripting (CVE-2004-1133). The same extension discloses the caller's SIDs, privileges and the server environment, and overflows a stack buffer on a long query string (CVE-2004-1134, remote code execution); no fixed version exists. The overflow was not sent."
        remediation: "Remove w3who.dll from the web server (or at least deny anonymous and remote access to it). Microsoft withdrew the tool and will not release a fixed version; do not run Resource Kit diagnostics on production servers."
        confidence_delta: 0.55
        qod: 75
        evidence: "GET /scripts/w3who.dll returned HTTP 200 with an access token dump (SIDs); GET /scripts/w3who.dll?bogus=<{{tag}}> echoed the tag unescaped"
      stop: true

  - id: exposed-only
    action: match
    source: verdict
    pattern: '^W3WHO_EXPOSED$'
    on_match:
      finding:
        title: "Microsoft W3Who ISAPI (w3who.dll) exposed — CVE-2004-1133, CVE-2004-1134"
        description: "/scripts/w3who.dll answered with the caller's access token dump. This Resource Kit extension discloses the caller's SIDs, privileges and the server environment, is affected by a reflected cross-site scripting (CVE-2004-1133) and a stack buffer overflow on a long query string (CVE-2004-1134, remote code execution), and no fixed version exists. The random tag sent in an invalid parameter was not echoed unescaped (a filter may sit in front of IIS); the overflow was not sent."
        remediation: "Remove w3who.dll from the web server (or at least deny anonymous and remote access to it). Microsoft withdrew the tool and will not release a fixed version; do not run Resource Kit diagnostics on production servers."
        confidence_delta: 0.40
        qod: 70
        evidence: "GET /scripts/w3who.dll returned HTTP 200 with an access token dump (SIDs); the tag sent in GET /scripts/w3who.dll?bogus=<{{tag}}> was not echoed unescaped"
      stop: true

Microsoft IIS WebDAV Unicode authentication bypass

CVECVE-2009-1535
Severityhigh · CVSS 7.5
Categoryauth-bypass — Auth bypass
Serviceshttp, https
Detectionset_var, tcp_connect, script, match · highest QoD 97
Feedtests/vulnerabilities/microsoft-iis/CVE-2009-1535.yaml

Sends OPTIONS / to read the Server banner and the MS-Author-Via: DAV header, then sends PROPFIND requests to a list of common folder names. When a folder answers 401 Unauthorized, the same PROPFIND is repeated with an overlong UTF-8 slash (%c0%af) inserted after the folder's first character (for example /s%c0%afecret/). A 207 Multi-Status listing of that folder, while the plain request is refused and a random non-existent folder with the same encoding is not listed, proves that the WebDAV extension bypasses the folder's authentication. PROPFIND only reads properties: nothing is written. When no password-protected folder is found, an IIS 5.1 or 6.0 banner with WebDAV advertised is reported as a version-based finding instead; when a protected folder is found but the encoded request still answers 401, nothing is reported.

How noctis detects it

  1. Raw TCP (TLS on HTTPS), sent verbatim: OPTIONS / HTTP/1.1
  2. Parses / computes the next value with a Rhai script
  3. Raw TCP (TLS on HTTPS), sent verbatim: PROPFIND / HTTP/1.1
  4. Parses / computes the next value with a Rhai script
  5. Parses / computes the next value with a Rhai script
  6. Raw TCP (TLS on HTTPS), sent verbatim: PROPFIND /{{rnd_dir}}/ HTTP/1.1
  7. Parses / computes the next value with a Rhai script
  8. Raw TCP (TLS on HTTPS), sent verbatim: PROPFIND /{{dir}}/ HTTP/1.1
  9. Parses / computes the next value with a Rhai script
  10. Parses / computes the next value with a Rhai script
  11. Raw TCP (TLS on HTTPS), sent verbatim: PROPFIND {{byp_path}} HTTP/1.1
  12. Parses / computes the next value with a Rhai script
  13. Parses / computes the next value with a Rhai script
  14. Checks byp_resp.banner for (?i)multistatus → finding QoD 97: Microsoft IIS WebDAV Unicode authentication bypass — CVE-2009-1535
  15. … and 2 more steps — see the feed source below

References:

Feed source — tests/vulnerabilities/microsoft-iis/CVE-2009-1535.yaml
# Microsoft IIS 5.1/6.0 WebDAV Unicode authentication bypass (MS09-020) — CVE-2009-1535
#
# Ported from OpenVAS/Greenbone NVT 2009/gb_ms_iis_webdav_auth_bypass_vuln.nasl
# (OID 1.3.6.1.4.1.25623.1.0.900711, GPL-2.0-only). Exploit shape from the
# nmap http-iis-webdav-vuln.nse script / Metasploit
# auxiliary/scanner/http/wmap_dir_webdav_unicode_bypass.
#
# The IIS WebDAV extension decodes an overlong UTF-8 "/" (%c0%af) inside a
# folder name AFTER IIS has decided which access rules apply to the URL. A
# folder that answers 401 to "PROPFIND /secret/" answers 207 Multi-Status —
# its protected listing — to "PROPFIND /s%c0%afecret/".
#
# The NASL only fingerprints: OPTIONS / must carry "MS-Author-Via: DAV" and
# the IIS version must be 5.0–6.0. That also reports every MS09-020-patched
# IIS 6.0. Deviations (stronger, fewer false positives):
#  - the bypass itself is tried, read-only: a list of common folder names is
#    probed with PROPFIND; a folder that answers 401 (control) is requested
#    again with %c0%af after its first character. A 207 Multi-Status reply
#    = authentication bypassed (QoD 97). A random non-existent folder
#    with the same encoding must not answer 207 (servers that list anything).
#    PROPFIND only lists properties; nothing is written.
#  - when a protected folder WAS found and the encoded request still gets
#    401, the server behaves patched: the version fallback is suppressed.
#  - the version fallback (QoD 70, as the NASL) only fires when no protected
#    folder could be tested; it reads the Server banner + MS-Author-Via: DAV
#    header from OPTIONS / (raw request, like the NASL).
#  - the version range is 5.1–6.0 (the NASL says 5.0–6.0): IIS 5.0's WebDAV
#    bypass is a different bug, CVE-2009-1122.
#
# Note: real IIS 5.1/6.0 (Windows XP / 2003) only speaks SSLv3/TLS 1.0,
# which the scanner's TLS stack refuses, so on a real server the https
# service usually gives no result; scan its plain-HTTP port.
uid: 7761696d-a18d-47a7-9528-102040835820
name: "Microsoft IIS WebDAV Unicode authentication bypass (CVE-2009-1535)"
description: |
  Sends OPTIONS / to read the Server banner and the MS-Author-Via: DAV header,
  then sends PROPFIND requests to a list of common folder names. When a folder
  answers 401 Unauthorized, the same PROPFIND is repeated with an overlong
  UTF-8 slash (%c0%af) inserted after the folder's first character (for
  example /s%c0%afecret/). A 207 Multi-Status listing of that folder, while the
  plain request is refused and a random non-existent folder with the same
  encoding is not listed, proves that the WebDAV extension bypasses the
  folder's authentication. PROPFIND only reads properties: nothing is written.
  When no password-protected folder is found, an IIS 5.1 or 6.0 banner
  with WebDAV advertised is reported as a version-based finding instead; when a
  protected folder is found but the encoded request still answers 401, nothing
  is reported.
cves: [CVE-2009-1535]
cvss: 7.5
severity: high
category: auth-bypass
confidence_base: 0.30
tags: [iis, microsoft, webdav, propfind, unicode, ms09-020, auth-bypass]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2009-1535"
  - "https://learn.microsoft.com/en-us/security-updates/securitybulletins/2009/ms09-020"
  - "https://www.kb.cert.org/vuls/id/787932"
  - "https://nmap.org/nsedoc/scripts/http-iis-webdav-vuln.html"

steps:
  - id: init-iis-dav
    action: set_var
    var_name: iis_dav
    var_value: false

  - id: init-root-ok
    action: set_var
    var_name: root_ok
    var_value: false

  - id: init-opt
    action: set_var
    var_name: opt_resp
    var_value: {connected: false, banner: null}

  - id: init-root
    action: set_var
    var_name: root_resp
    var_value: {connected: false, banner: null}

  - id: init-rnd
    action: set_var
    var_name: rnd_resp
    var_value: {connected: false, banner: null}

  - id: init-protected-refused
    action: set_var
    var_name: protected_refused
    var_value: false

  # ── Fingerprint (same request as the NASL) ────────────────────────────────
  - id: options-root
    action: tcp_connect
    port: "{{port}}"
    send: "OPTIONS / HTTP/1.1\r\nHost: {{target_host}}\r\nConnection: close\r\n\r\n"
    timeout_secs: 10
    store_as: opt_resp

  - id: check-iis-dav
    action: script
    code: |
      let b = opt_resp.banner;
      if type_of(b) != "string" { false } else {
        ereg("(?im)^Server:[ \\t]*Microsoft-IIS/(5\\.1|6\\.0)\\b", b)
          && ereg("(?im)^MS-Author-Via:[^\\r\\n]*\\bDAV\\b", b)
      }
    store_as: iis_dav

  # WebDAV must answer on / without credentials (a protected root leaves no
  # unprotected baseline to compare against — same rule as the nmap script).
  - id: propfind-root
    action: tcp_connect
    port: "{{port}}"
    send: "PROPFIND / HTTP/1.1\r\nHost: {{target_host}}\r\nDepth: 0\r\nContent-Length: 0\r\nConnection: close\r\n\r\n"
    timeout_secs: 10
    store_as: root_resp

  - id: check-root
    action: script
    code: |
      let b = root_resp.banner;
      type_of(b) == "string" && ereg("^HTTP/1\\.[01] 207", b) && ereg("multistatus", b, true)
    store_as: root_ok

  # Control: a random, non-existent folder carrying the same %c0%af encoding
  # must NOT answer 207 (a server that lists anything is not evidence).
  - id: mint-name
    action: script
    code: '"n%c0%afoctis" + rand_hex(6)'
    store_as: rnd_dir

  - id: propfind-random
    action: tcp_connect
    condition: "root_ok == true"
    port: "{{port}}"
    send: "PROPFIND /{{rnd_dir}}/ HTTP/1.1\r\nHost: {{target_host}}\r\nDepth: 1\r\nContent-Length: 0\r\nConnection: close\r\n\r\n"
    timeout_secs: 10
    store_as: rnd_resp

  - id: check-random
    action: script
    code: |
      let b = rnd_resp.banner;
      root_ok == true && type_of(b) == "string" && !ereg("^HTTP/1\\.[01] 207", b)
    store_as: root_ok

  # ── Bypass attempt, one pass per folder name ──────────────────────────────
  - id: reset-ctrl
    action: set_var
    var_name: ctrl_resp
    var_value: {connected: false, banner: null}
    loop:
      over: ["webdav", "dav", "secret", "private", "protected", "secure", "restricted", "admin", "administrator", "internal", "intranet", "members", "staff", "upload", "uploads", "files", "docs", "documents", "backup", "data", "test"]
      var: dir

  - id: reset-byp
    action: set_var
    var_name: byp_resp
    var_value: {connected: false, banner: null}

  - id: reset-ctrl401
    action: set_var
    var_name: ctrl_401
    var_value: false

  - id: reset-bypass-ok
    action: set_var
    var_name: bypass_ok
    var_value: false

  # Control: the plain folder must demand authentication.
  - id: propfind-control
    action: tcp_connect
    condition: "root_ok == true"
    port: "{{port}}"
    send: "PROPFIND /{{dir}}/ HTTP/1.1\r\nHost: {{target_host}}\r\nDepth: 1\r\nContent-Length: 0\r\nConnection: close\r\n\r\n"
    timeout_secs: 10
    store_as: ctrl_resp

  - id: check-control
    action: script
    code: |
      let b = ctrl_resp.banner;
      type_of(b) == "string" && ereg("^HTTP/1\\.[01] 401", b)
    store_as: ctrl_401

  # /secret/ -> /s%c0%afecret/ (overlong UTF-8 "/" after the first character).
  - id: build-bypass-path
    action: script
    code: '"/" + substr(dir, 0, 0) + "%c0%af" + substr(dir, 1) + "/"'
    store_as: byp_path

  - id: propfind-bypass
    action: tcp_connect
    condition: "ctrl_401 == true"
    port: "{{port}}"
    send: "PROPFIND {{byp_path}} HTTP/1.1\r\nHost: {{target_host}}\r\nDepth: 1\r\nContent-Length: 0\r\nConnection: close\r\n\r\n"
    timeout_secs: 10
    store_as: byp_resp

  # 207 Multi-Status listing of the folder the control showed protected.
  - id: check-bypass
    action: script
    code: |
      let b = byp_resp.banner;
      if ctrl_401 != true || type_of(b) != "string" { false } else {
        ereg("^HTTP/1\\.[01] 207", b) && ereg("multistatus", b, true)
      }
    store_as: bypass_ok

  # A protected folder that stays refused with the encoding = patched behaviour.
  # Only a 401 to the encoded request counts as patched; a 403 (directory
  # listing off), 5xx or no reply leaves the version fallback in place.
  - id: note-refused
    action: script
    code: |
      let b = byp_resp.banner;
      protected_refused || (ctrl_401 == true && type_of(b) == "string" && ereg("^HTTP/1\\.[01] 401", b))
    store_as: protected_refused

  - id: confirm-bypass
    action: match
    source: byp_resp.banner
    pattern: "(?i)multistatus"
    condition: "bypass_ok == true"
    on_match:
      finding:
        title: "Microsoft IIS WebDAV Unicode authentication bypass — CVE-2009-1535"
        description: "A WebDAV folder that answers 401 Unauthorized to a plain PROPFIND returned its 207 Multi-Status listing, without credentials, when an overlong UTF-8 slash (%c0%af) was inserted in its name. The IIS WebDAV extension decodes the name after the access check (MS09-020), so password-protected WebDAV content can be listed, read and, where the folder allows it, written without authentication."
        remediation: "Apply Microsoft security bulletin MS09-020, or disable the WebDAV extension; migrate off end-of-life IIS 5.1 / 6.0."
        confidence_delta: 0.65
        qod: 97
        evidence: "PROPFIND /{{dir}}/ -> 401, PROPFIND {{byp_path}} -> 207 without credentials: {{byp_resp.banner}}"
      stop: true

  # ── Version fallback (the NASL's check) when no protected folder was found ─
  # (a bypass finding above has stop: true and ends the test).
  - id: fallback-group
    action: set_var
    var_name: fallback_ok
    var_value: false
    loop:
      over: ["once"]
      var: once

  - id: check-fallback
    action: script
    code: "iis_dav == true && protected_refused == false"
    store_as: fallback_ok

  - id: report-version
    action: match
    source: opt_resp.banner
    pattern: "(?i)Microsoft-IIS/(5\\.1|6\\.0)"
    condition: "fallback_ok == true"
    on_match:
      finding:
        title: "Microsoft IIS 5.1/6.0 with WebDAV enabled — possibly affected by CVE-2009-1535"
        description: "The server reports Microsoft IIS 5.1 or 6.0 and advertises WebDAV (MS-Author-Via: DAV). Without MS09-020, its WebDAV extension lets an overlong UTF-8 slash (%c0%af) in a URL bypass the authentication of password-protected folders. No password-protected folder was found to try the bypass, so this finding rests on the version only."
        remediation: "Apply Microsoft security bulletin MS09-020, or disable the WebDAV extension; migrate off end-of-life IIS 5.1 / 6.0."
        confidence_delta: 0.40
        qod: 70
        evidence: "OPTIONS / banner with WebDAV advertised: {{opt_resp.banner}}"

Microsoft IIS default 404 error page cross-site scripting (MS02-018, CVE-2002-0148)

CVECVE-2002-0148
Severityhigh · CVSS 7.5
Categoryxss — XSS
Serviceshttp, https
Detectionscript, http_request, match · highest QoD 75
Feedtests/vulnerabilities/microsoft-iis/CVE-2002-0148.yaml

Checks whether a Microsoft IIS 4.0, 5.0 or 5.1 server still serves the original default "page cannot be found" error page, whose inline script copies part of the requested URL into the page with document.write() without encoding it (cross-site scripting through the HTTP error page, fixed by MS02-018). The test requests a random, non-existent .htm file and reports the server when the returned error page contains that unencoded document.write() call; the fixed page, which encodes the value before writing it, is not reported. Only one harmless GET request is sent.

How noctis detects it

  1. Parses / computes the next value with a Rhai script
  2. HTTP(S) request GET /{{fname}}
  3. Parses / computes the next value with a Rhai script
  4. Checks verdict for ^IIS404_XSS_(?:ORIG|ESCAPE)$ → finding QoD 75: Microsoft IIS default 404 error page cross-site scripting (MS02-018) — CVE-2002-0148

References:

Feed source — tests/vulnerabilities/microsoft-iis/CVE-2002-0148.yaml
# Microsoft IIS 4.0/5.0/5.1 — cross-site scripting in the default HTTP 404
# error page (MS02-018, CVE-2002-0148)
#
# Ported from OpenVAS/Greenbone NVT pre2008/iis_xss_404.nasl
# (OID 1.3.6.1.4.1.25623.1.0.10936, GPL-2.0-only).
#
# IIS answers a missing file with %WINDIR%\help\iisHelp\common\404b.htm. Its
# inline Homepage() script slices the site part out of document.URL and
# writes it into the page with document.write() without encoding it, so a
# crafted URL injects script into the victim's browser (DOM-based: the server
# never reflects anything, which is why the proof is the sink in the served
# page, not an echoed payload).
#
# The exact script lines are known from the IIS servicing tool that rewrites
# them (spiisupd.cpp, inetsrv/iis/qfetools in the NT 5 source tree):
#   original  document.write('<A HREF="' + urlresult + '">' + displayresult + "</a>");
#   1st fix   document.write( '<A HREF="' + escape(urlresult) + '">' + displayresult + "</a>");
#             (still writes displayresult raw — "WinSE 26475: CSS bug in
#             custom error pages", replaced again)
#   final     InsertElementAnchor(urlresult, displayresult);  + HtmlEncode()
#
# The NASL GETs /blah.htm on a Microsoft-IIS banner and greps "urlresult" and
# "+ displayresult +". Deviations (stronger):
#  - a random file name instead of /blah.htm, so a real /blah.htm on the site
#    cannot hide the error page;
#  - the match is the sink itself — a document.write() call whose argument
#    carries urlresult and concatenates displayresult raw — so both
#    vulnerable generations match and the final fixed page never does;
#  - no Server-banner gate: an IIS behind a proxy that rewrites or strips the
#    Server header still serves the same page, and the sink is specific to
#    this error page.
#
# CVE mapping: the backlog issue copied the NVT's MS02-018 list
# (CVE-2002-0071/0072/0073/0074/0075/0079/0147/0148/0149/0150/0224). Only
# CVE-2002-0148 ("cross-site scripting … via an HTTP error page") is what the
# page proves; the others are buffer overflows, DoS, the Help search XSS, the
# redirect XSS and an MSDTC bug that this test does not observe. NVD has only
# a CVSS v2 score (7.5) for CVE-2002-0148.
uid: 0edee697-9f51-40f8-ac6a-28467ce3aa32
name: "Microsoft IIS default 404 error page cross-site scripting (MS02-018, CVE-2002-0148)"
description: |
  Checks whether a Microsoft IIS 4.0, 5.0 or 5.1 server still serves the
  original default "page cannot be found" error page, whose inline script
  copies part of the requested URL into the page with document.write()
  without encoding it (cross-site scripting through the HTTP error page,
  fixed by MS02-018). The test requests a random, non-existent .htm file and
  reports the server when the returned error page contains that unencoded
  document.write() call; the fixed page, which encodes the value before
  writing it, is not reported. Only one harmless GET request is sent.
cves: [CVE-2002-0148]
cvss: 7.5
severity: high
category: xss
confidence_base: 0.30
tags: [iis, microsoft, ms02-018, xss, error-page, dom-xss]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2002-0148"
  - "https://learn.microsoft.com/en-us/security-updates/securitybulletins/2002/ms02-018"
  - "https://www.kb.cert.org/vuls/id/886699"

steps:
  # Random missing file: IIS answers with its custom 404 page.
  - id: mint-name
    action: script
    code: '"noctis" + rand_hex(10) + ".htm"'
    store_as: fname

  - id: probe-404
    action: http_request
    method: GET
    port: "{{port}}"
    path: "/{{fname}}"
    follow_redirects: false
    tls_insecure: true
    timeout_secs: 10
    store_as: nf

  # Fixed verdict string as the match source: the page itself never reaches
  # the finding.
  - id: verdict
    action: script
    code: |
      let v = "";
      let b = if is_def_var("nf") { nf.body } else { () };
      if type_of(b) == "string"
          && ereg(`(?is)document\.write\s*\([^;]*\burlresult\b[^;]*\+\s*displayresult\s*\+`, b) {
        v = if ereg(`(?i)escape\s*\(\s*urlresult\s*\)`, b) { "IIS404_XSS_ESCAPE" } else { "IIS404_XSS_ORIG" };
      }
      v
    store_as: verdict

  - id: xss-sink
    action: match
    source: verdict
    pattern: '^IIS404_XSS_(?:ORIG|ESCAPE)$'
    on_match:
      finding:
        title: "Microsoft IIS default 404 error page cross-site scripting (MS02-018) — CVE-2002-0148"
        description: "The default IIS \"page cannot be found\" error page served for a missing file writes part of the requested URL into the page with document.write() without encoding it. A crafted link to this server makes the victim's browser run attacker-supplied script in the site's origin (CVE-2002-0148, fixed by MS02-018 and the later error-page update that encodes the value before writing it)."
        remediation: "Install the IIS cumulative security updates (MS02-018 and later) or upgrade to a supported IIS version; alternatively replace the default custom error pages (iisHelp\\common\\4xx*.htm) with static pages that contain no script."
        confidence_delta: 0.55
        qod: 75
        evidence: "GET /{{fname}} returned HTTP {{nf.status}} with the default IIS 404 page whose script writes displayresult unencoded via document.write() (variant: {{verdict}})"
      stop: true

View these feeds on GitHub