WWWBoard — 1 vulnerability check

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

← All products · Feeds on GitHub

WWWBoard passwd.txt Admin Password Hash Disclosure

CVECVE-1999-0953
Severitycritical · CVSS 10.0
Categoryexposure — Exposure
Serviceshttp, https
Detectionset_var, tcp_connect, script, match · highest QoD 75
Feedtests/vulnerabilities/wwwboard/CVE-1999-0953.yaml

WWWBoard stores the board administrator's user name and crypt() password hash in passwd.txt, next to wwwboard.html under the web root, where anyone can download it and crack it offline. For each usual board directory the feed requests wwwboard.html and passwd.txt without credentials, and reports when passwd.txt is served (HTTP 200, not an HTML page) with a user:crypt-hash line and either the board page links to wwwboard.pl or the line is the stock WebAdmin entry shipped with WWWBoard. Only the lengths of the user name and hash are reported, never their values.

How noctis detects it

  1. Raw TCP (TLS on HTTPS), sent verbatim: GET {{wb_dir}}/wwwboard.html HTTP/1.0
  2. Raw TCP (TLS on HTTPS), sent verbatim: GET {{wb_dir}}/passwd.txt HTTP/1.0
  3. Parses / computes the next value with a Rhai script
  4. Checks leak.hit for ^true$ → finding QoD 75: WWWBoard admin password file downloaded without authentication from …://…:…… — user:hash entry (user name … chars, … hash … chars, values w…

References:

Feed source — tests/vulnerabilities/wwwboard/CVE-1999-0953.yaml
# Matt's WWWBoard — passwd.txt readable under the web root (CVE-1999-0953)
#
# WWWBoard keeps its admin account (used by wwwadmin.pl to delete posts) in passwd.txt,
# installed next to wwwboard.html inside the web root, so anyone can download the user
# name and its crypt() hash and crack it offline. The stock file ships as
# "WebAdmin:aepTOqxOi4i8U" (crypt of "WebBoard").
#
# Ported from OpenVAS/Greenbone NASL pre2008/wwwboardpwd.nasl
# (OID 1.3.6.1.4.1.25623.1.0.10321, GPL-2.0-only): GET <dir>/wwwboard.html, require
# "wwwboard.pl" in it, then GET <dir>/passwd.txt and look for a user:hash line.
#
# Real exploitation, read-only: the feed downloads the password file — that IS the
# exploit. Neither the user name nor the hash goes into the finding (lengths only).
#
# Better than the NASL:
#   - the NASL's line pattern `^[A-Za-z0-9]*:[a-zA-Z0-9-_.]$` allows ONE character after
#     the colon, so it never matches a real 13-character crypt hash (the stock
#     "WebAdmin:aepTOqxOi4i8U" included, and `/` is not even in its class): false
#     negative on every real install. Here: a DES crypt hash (13 chars of [./0-9A-Za-z])
#     or a modular `$id$salt$hash` crypt string;
#   - the NASL only tries "/" and the crawled CGI dirs; the documented install directory
#     is /wwwboard/ — the feed walks "", /wwwboard, /cgi-bin/wwwboard, /board, /forum,
#     /cgi-bin;
#   - a passwd.txt that still holds the stock WebAdmin entry is reported even when
#     wwwboard.html was renamed or removed (that exact line identifies WWWBoard);
#   - the passwd.txt reply must be HTTP 200 and not an HTML page (soft-404 guard).
uid: 8913f8b8-6bee-4284-8af4-d669d5cf8fed
name: "CVE-1999-0953 — WWWBoard passwd.txt Admin Password Hash Disclosure"
description: >-
  WWWBoard stores the board administrator's user name and crypt() password hash in
  passwd.txt, next to wwwboard.html under the web root, where anyone can download it
  and crack it offline. For each usual board directory the feed requests wwwboard.html
  and passwd.txt without credentials, and reports when passwd.txt is served (HTTP 200,
  not an HTML page) with a user:crypt-hash line and either the board page links to
  wwwboard.pl or the line is the stock WebAdmin entry shipped with WWWBoard. Only the
  lengths of the user name and hash are reported, never their values.
cves: [CVE-1999-0953]
cvss: 10.0
severity: critical
category: exposure
confidence_base: 0.30
tags: [wwwboard, cgi, perl, password-disclosure, information-disclosure, default-credentials]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-1999-0953"
  - "https://www.scriptarchive.com/wwwboard.html"
  - "OpenVAS/Greenbone NASL pre2008/wwwboardpwd.nasl (OID 1.3.6.1.4.1.25623.1.0.10321, GPL-2.0-only)"

steps:
  # One iteration per candidate board directory. Both stored results are
  # pre-initialised so a refused connection (store_as left unset) can't abort the
  # verdict script.
  - id: init-board
    action: set_var
    var_name: board
    var_value: {connected: false, banner: ""}
    loop:
      over: ["", "/wwwboard", "/cgi-bin/wwwboard", "/board", "/forum", "/cgi-bin"]
      var: wb_dir

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

  - id: board-page
    action: tcp_connect
    port: "{{port}}"
    send: "GET {{wb_dir}}/wwwboard.html HTTP/1.0\r\nHost: {{target_host}}\r\nUser-Agent: noctis\r\nConnection: close\r\n\r\n"
    timeout_secs: 10
    store_as: board

  - id: passwd-file
    action: tcp_connect
    port: "{{port}}"
    send: "GET {{wb_dir}}/passwd.txt HTTP/1.0\r\nHost: {{target_host}}\r\nUser-Agent: noctis\r\nConnection: close\r\n\r\n"
    timeout_secs: 10
    store_as: pw

  # Verdict: only booleans, lengths and our own URL leave this step — the match step
  # below copies its `source` into the finding, so it reads leak.hit, never the reply.
  - id: verdict
    action: script
    store_as: leak
    code: |
      let res = #{ hit: false, url: "", ulen: 0, hlen: 0, kind: "", note: "" };
      let bb = if type_of(board.banner) == "string" { board.banner } else { "" };
      let pb = if type_of(pw.banner) == "string" { pw.banner } else { "" };
      // passwd.txt is a one-line file: skip anything big instead of copying it.
      if strlen(pb) == 0 || strlen(pb) > 65536 { return res; }
      if !ereg("^HTTP/1\\.[01] 200\\b", pb) { return res; }
      // header/body separator: CRLF CRLF, or bare LF LF from sloppy servers
      let hdr_end = stridx(pb, "\r\n\r\n");
      let skip = 4;
      if hdr_end < 0 { hdr_end = stridx(pb, "\n\n"); skip = 2; }
      if hdr_end < 0 { return res; }
      let body = substr(pb, hdr_end + skip);
      // soft-404 / catch-all pages
      if ereg("<(html|head|body|!doctype)", body, true) { return res; }
      let lines = egrep("^[A-Za-z0-9_.@-]+:([./0-9A-Za-z]{13}|\\$[0-9a-z]+(\\$[./0-9A-Za-z=,]{1,64}){1,2}\\$[./0-9A-Za-z]{22,}) *$", body);
      if lines == "" { return res; }
      let all = split(lines, "\n");
      let entry = ereg_replace(" +$", "", all[0]);
      for l in all {
        if ereg_replace(" +$", "", l) == "WebAdmin:aepTOqxOi4i8U" { entry = "WebAdmin:aepTOqxOi4i8U"; }
      }
      let sep = stridx(entry, ":");
      let user = substr(entry, 0, sep - 1);
      let hash = substr(entry, sep + 1);
      let stock = entry == "WebAdmin:aepTOqxOi4i8U";
      let gate = ereg("^HTTP/1\\.[01] 200\\b", bb) && stridx(bb, "wwwboard.pl") >= 0;
      if !(gate || stock) { return res; }
      res.hit = true;
      res.url = wb_dir + "/passwd.txt";
      res.ulen = strlen(user);
      res.hlen = strlen(hash);
      res.kind = if strlen(hash) == 13 { "DES crypt" } else { "modular crypt" };
      res.note = if stock {
        "; the entry is the stock WebAdmin account shipped with WWWBoard (default password never changed)"
      } else {
        "; " + wb_dir + "/wwwboard.html links to wwwboard.pl"
      };
      res

  - id: report
    action: match
    source: leak.hit
    pattern: "^true$"
    on_match:
      stop: true
      finding:
        confidence_delta: 0.55
        qod: 75
        evidence: "WWWBoard admin password file downloaded without authentication from {{scheme}}://{{target_host}}:{{port}}{{leak.url}} — user:hash entry (user name {{leak.ulen}} chars, {{leak.kind}} hash {{leak.hlen}} chars, values withheld){{leak.note}}"

View these feeds on GitHub