Novell NetWare — 2 vulnerability checks

noctis ships 2 vulnerability checks for Novell NetWare, covering 2 CVEs; each one has to observe the bug on the live service before it reports a finding.

← All products · Feeds on GitHub

Novell NetWare Perl Web Handler POST Perl Code Execution

CVECVE-2002-1436
Severityhigh · CVSS 7.5
Categoryrce — Remote code execution
Serviceshttp, https
Detectionscript, set_var, http_request, match · highest QoD 97
Feedtests/vulnerabilities/novell-netware/CVE-2002-1436.yaml

Detects the Novell NetWare 5.1 / 6.0 web server whose Perl 5.003 web handler executes the body of an HTTP POST request as Perl code (CVE-2002-1436), giving any unauthenticated client code execution on the server. The feed sends a POST to /perl and, if needed, to /perl/ with a one-line Perl program that prints a plain-text CGI header followed by NOCTIS, the product of two per-run random numbers, and END. It reports the target only when the reply contains that computed product, which only a server that ran the posted code can return; the request itself carries only the two operands. The program performs nothing but the multiplication: no file is read or written and no command is run.

How noctis detects it

  1. Parses / computes the next value with a Rhai script
  2. HTTP(S) request POST {{url}} with a crafted body
  3. Checks perl_resp.body for NOCTIS[0-9]+END → finding QoD 97: Novell NetWare Perl web handler executes POSTed Perl code

References:

Feed source — tests/vulnerabilities/novell-netware/CVE-2002-1436.yaml
# Novell NetWare 5.1 (<= SP4) / 6.0 (<= SP1) — Perl 5.003 web handler runs Perl code
# sent in an HTTP POST body (CVE-2002-1436, Novell TID 2963307, BID 5520)
#
# NetWare's Enterprise Web Server (Netscape/iPlanet) maps /perl to the Perl 5.003
# handler (PERL.NLM). A POST to that handler is not tied to a script file: the request
# body itself is interpreted as Perl and its output is sent back as the CGI reply, so any
# unauthenticated client runs arbitrary Perl (file read/write, commands) on the server.
# Perl 5.6 and the Novell fixes (5.1 SP5, 6.0 SP2) no longer accept it.
#
# Detection (QoD 97, in-band, benign): the feed POSTs a one-line Perl program that prints
# a CGI header then "NOCTIS" <a*b> "END" for two per-run random 4/5-digit numbers, and
# reports only when the reply carries the computed product. The request holds only the
# two operands, so an echoing page or a static page cannot produce it; nothing is read,
# written or executed beyond the multiplication.
#
# Improvements over the source NVT:
#   - per-run random operands instead of the fixed 42+42 / "VT-Test=84" marker (a page
#     containing that literal string, e.g. a honeypot or a copy of the advisory, was
#     reported);
#   - both handler mappings are probed, /perl (NVT) and /perl/ (the public exploit,
#     EDB-21731, RFP / Novacoast), stopping at the first hit;
#   - the product must be followed by "END" so a longer number cannot match.
#
# Not covered: CVE-2002-1437 ("..%5c" traversal through the same handler) and
# CVE-2002-1438 (Perl version disclosure via "-v"): no public request format exists
# for either; the code-execution proof above is the stronger finding on the same
# handler.
#
# CVSS: NVD has only a v2 score for CVE-2002-1436 (7.5, AV:N/AC:L/Au:N/C:P/I:P/A:P).
#
# Ported from OpenVAS/Greenbone NVT pre2008/netware_post_perl.nasl
# (OID 1.3.6.1.4.1.25623.1.0.11158, GPL-2.0-only).
uid: 067f5a1e-7285-431b-b878-97a132958633
name: "Novell NetWare Perl Web Handler POST Perl Code Execution"
description: |
  Detects the Novell NetWare 5.1 / 6.0 web server whose Perl 5.003 web handler
  executes the body of an HTTP POST request as Perl code (CVE-2002-1436), giving
  any unauthenticated client code execution on the server. The feed sends a POST
  to /perl and, if needed, to /perl/ with a one-line Perl program that prints a
  plain-text CGI header followed by NOCTIS, the product of two per-run random
  numbers, and END. It reports the target only when the reply contains that
  computed product, which only a server that ran the posted code can return; the
  request itself carries only the two operands. The program performs nothing but
  the multiplication: no file is read or written and no command is run.
cves: [CVE-2002-1436]
cvss: 7.5
severity: high
category: rce
confidence_base: 0.30
tags: [novell, netware, perl, code-injection, rce, unauthenticated, intrusive]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2002-1436"
  - "https://seclists.org/bugtraq/2002/Aug/att-298/NOVL-2002-2963307_-_PERL_Handler_Vulnerability.txt"
  - "https://www.exploit-db.com/exploits/21731"
  - "http://www.securityfocus.com/bid/5520"

steps:
  # a: 4 digits, b: 5 digits -> product of 7-9 digits, never equal to an operand.
  - id: gen-proof
    action: script
    code: |
      let a = rand_int(1000, 9999);
      let b = rand_int(10000, 99999);
      #{ a: a, b: b, want: "NOCTIS" + (a * b) + "END" }
    store_as: pv

  # ── Per handler mapping: this step and the following ones ────────────────
  # Pre-initialised so a failed request leaves no undefined variable behind.
  - id: init-resp
    action: set_var
    var_name: perl_resp
    var_value: {status: 0, body: ""}
    loop:
      var: url
      over: ["/perl", "/perl/"]

  - id: post-perl
    action: http_request
    method: POST
    path: "{{url}}"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    headers:
      Content-Type: "application/octet-stream"
    body: "print(\"Content-Type: text/plain\\r\\n\\r\\n\", \"NOCTIS\", {{pv.a}}*{{pv.b}}, \"END\");"
    store_as: perl_resp

  - id: confirm
    action: match
    source: perl_resp.body
    pattern: "NOCTIS[0-9]+END"
    condition: "type_of(perl_resp.body) == \"string\" && perl_resp.body.contains(pv.want)"
    on_match:
      finding:
        title: "Novell NetWare Perl web handler executes POSTed Perl code"
        confidence_delta: 0.67
        qod: 97
        evidence: "POST {{url}} with the Perl body print(\"NOCTIS\", {{pv.a}}*{{pv.b}}, \"END\") returned {{pv.want}}: the server executed the posted code"
        remediation: "Upgrade the NetWare Perl handler to Perl 5.6 or later (NetWare 5.1 SP5 / 6.0 SP2), or remove the /perl handler mapping from the web server."
      stop: true

Novell Web Server NDS Tree Browsing Without Authentication

CVECVE-1999-1020
Severityhigh · CVSS 7.5
Categoryexposure — Exposure
Serviceshttp, https
Detectionset_var, http_request, script, match · highest QoD 75
Feedtests/vulnerabilities/novell-netware/CVE-1999-1020.yaml

Detects a Novell Web Server whose NDS browser (the NDSOBJ.NLM LCGI module) lets unauthenticated clients browse the NDS directory tree (CVE-1999-1020): its first page lists the available NDS trees, from which users, groups and other directory objects can be enumerated. The check first requests a random path that does not exist, to rule out servers that answer every URL with the same page. It then sends a plain GET to the browser's usual URLs (/lcgi, /lcgi-bin, /LCGI, /apage/lcgi-bin, /lcgi/ndsobj.nlm and /nds/) and reports the first one that answers 200 with the "Available NDS Trees" listing, while the random path did not. The requests are read-only and no directory content is copied into the finding.

How noctis detects it

  1. HTTP(S) request GET /lcgi-noctis-{{oob_token}}/ndsobj.nlm
  2. Parses / computes the next value with a Rhai script
  3. HTTP(S) request GET {{url}}
  4. Parses / computes the next value with a Rhai script
  5. Checks hit for ^/ → finding QoD 75: Novell Web Server NDS Tree Browsing Without Authentication (CVE-1999-1020)

References:

Feed source — tests/vulnerabilities/novell-netware/CVE-1999-1020.yaml
# Novell Web Server (NetWare 4.x / 5.x) — NDS tree browsing without authentication
# through the NDSOBJ.NLM LCGI module (CVE-1999-1020)
#
# The Novell Web Server ships an NDS browser (SYS:WEB/DOCS/CGI/NDSOBJ/NDSOBJ.NLM),
# reachable through the LCGI mapping (/lcgi, /lcgi-bin, /LCGI, /apage/lcgi-bin, and
# the module URL /lcgi/ndsobj.nlm cited in Bugtraq, 2001-08-15) or the /nds/ mapping
# of the Novell documentation. With the default [Public] Browse/Read rights on the
# tree, its first page lists "Available NDS Trees" to any unauthenticated client, who
# can then walk the tree and enumerate users, groups and other objects.
#
# Detection (QoD 75, read-only): GET of each candidate URL, reported at the first one
# that answers 200 with the "Available NDS Trees" tree list. Nothing is changed and the
# tree content is not copied into the finding (only the URL).
#
# Improvements over the source NVT:
#   - also probes /lcgi/ndsobj.nlm (Bugtraq) and /nds/ (Novell documentation), the two
#     documented URLs of the browser, which the NVT does not request;
#   - requires a direct 200 reply (an error page quoting the marker, or a redirect to
#     a page that carries it, no longer counts);
#   - a control request to a random non-existent path must NOT carry the marker, so a
#     catch-all page or honeypot that answers every URL with the same text is not
#     reported.
#
# CVSS: NVD has only a v2 score for CVE-1999-1020 (7.5, AV:N/AC:L/Au:N/C:P/I:P/A:P).
#
# Ported from OpenVAS/Greenbone NVT pre2008/nds_web_based_browsing.nasl
# (OID 1.3.6.1.4.1.25623.1.0.10739, GPL-2.0-only).
uid: a8775f01-16ad-46d5-a4fe-ff651d5aa989
name: "Novell Web Server NDS Tree Browsing Without Authentication"
description: |
  Detects a Novell Web Server whose NDS browser (the NDSOBJ.NLM LCGI module) lets
  unauthenticated clients browse the NDS directory tree (CVE-1999-1020): its first
  page lists the available NDS trees, from which users, groups and other directory
  objects can be enumerated. The check first requests a random path that does not
  exist, to rule out servers that answer every URL with the same page. It then sends
  a plain GET to the browser's usual URLs (/lcgi, /lcgi-bin, /LCGI, /apage/lcgi-bin,
  /lcgi/ndsobj.nlm and /nds/) and reports the first one that answers 200 with the
  "Available NDS Trees" listing, while the random path did not. The requests are
  read-only and no directory content is copied into the finding.
cves: [CVE-1999-1020]
cvss: 7.5
severity: high
category: exposure
confidence_base: 0.30
tags: [novell, netware, nds, edirectory, information-disclosure, unauthenticated]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-1999-1020"
  - "http://www.securityfocus.com/bid/484"
  - "https://diswww.mit.edu/menelaus.mit.edu/bt/22257"
  - "https://www.zx.net.nz/netware/server/411-kvm-2/webdoc/nds.html"

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

  - id: init-ctl
    action: set_var
    var_name: ctl
    var_value: {status: 0, body: ""}

  # Control: a path that cannot exist must not carry the marker.
  - id: control
    action: http_request
    method: GET
    path: "/lcgi-noctis-{{oob_token}}/ndsobj.nlm"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    store_as: ctl

  - id: control-check
    action: script
    code: |
      let body = if type_of(ctl.body) == "string" { ctl.body } else { "" };
      body.contains("Available NDS Trees")
    store_as: catchall

  # Loop group: every step below runs once per candidate URL.
  - id: init-probe
    action: set_var
    var_name: probe
    var_value: {status: 0, body: ""}
    loop:
      var: url
      over: ["/lcgi", "/lcgi-bin", "/LCGI", "/apage/lcgi-bin", "/lcgi/ndsobj.nlm", "/nds/"]

  - id: fetch
    action: http_request
    method: GET
    path: "{{url}}"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    condition: 'hit == "" && catchall == false'
    store_as: probe

  - id: check
    action: script
    condition: 'hit == "" && catchall == false'
    code: |
      let body = if type_of(probe.body) == "string" { probe.body } else { "" };
      if probe.status == 200 && body.contains("Available NDS Trees") { url } else { "" }
    store_as: hit

  # Second loop group: the report runs once, after the URL loop.
  - id: after-loop
    action: set_var
    var_name: loop_done
    var_value: true
    loop:
      var: pass
      over: ["once"]

  - id: report
    action: match
    source: hit
    pattern: "^/"
    on_match:
      finding:
        title: "Novell Web Server NDS Tree Browsing Without Authentication (CVE-1999-1020)"
        description: "The Novell Web Server NDS browser (NDSOBJ.NLM) answers unauthenticated clients with the list of available NDS trees. Anyone can browse the directory tree and enumerate its users, groups and other objects, which helps password guessing and further attacks."
        remediation: "Unload or remove the NDS browser (NDSOBJ.NLM and its LoadableModule mapping in SRM.CFG) if it is not needed, or require authentication for it and remove the Browse/Read rights of [Public] on the tree."
        confidence_delta: 0.50
        qod: 75
        evidence: "GET {{hit}} answered 200 with the \"Available NDS Trees\" listing; a random non-existent path did not carry it"

View these feeds on GitHub