WowBB — 3 vulnerability checks

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

← All products · Feeds on GitHub

WowBB <= 1.61 view_topic.php forum_id / view_user.php page SQL injection

CVECVE-2004-2181
Severityhigh · CVSS 7.5
Categorysqli — SQL injection
Serviceshttp, https
Detectionscript, set_var, http_request, match · highest QoD 97
Feedtests/vulnerabilities/wowbb/CVE-2004-2181.yaml

WowBB 1.61 and earlier put the forum_id parameter of view_topic.php and the page parameter of view_user.php unfiltered into SQL queries, allowing unauthenticated SQL injection that can expose the forum database, including the administrator's password hash.

Under the web root and the usual forum directories, this check first loads view_topic.php?forum_id=1 and confirms it is a WowBB page without any SQL error. It then proves the injection with three requests whose forum_id is a condition on the sum of two random numbers: a wrong sum must make WowBB print its "Invalid SQL query" error, the right sum must not, which shows the database evaluated the injected expression. When that cannot run, a single quote appended to forum_id or to the member list's page parameter that triggers the error page, while the plain value does not, is reported with lower confidence; failing both, a WowBB footer naming version 1.61 or older is reported with the lowest confidence. Nothing is written and no data is read from the database.

How noctis detects it

  1. Parses / computes the next value with a Rhai script
  2. HTTP(S) request GET {{wdir}}/view_topic.php?forum_id=1&topic_id=1
  3. Parses / computes the next value with a Rhai script
  4. HTTP(S) request GET {{wdir}}/view_topic.php?forum_id=IF({{sc.a}}%2B{{sc.b}}%3D{{sc.bad1}},1,(SELECT%201%2…
  5. HTTP(S) request GET {{wdir}}/view_topic.php?forum_id=IF({{sc.a}}%2B{{sc.b}}%3D{{sc.sum}},1,(SELECT%201%20…
  6. HTTP(S) request GET {{wdir}}/view_topic.php?forum_id=IF({{sc.a}}%2B{{sc.b}}%3D{{sc.bad2}},1,(SELECT%201%2…
  7. Parses / computes the next value with a Rhai script
  8. Checks bp.found for ^BOOL$ → finding QoD 97: WowBB view_topic.php forum_id SQL injection (CVE-2004-2181)
  9. HTTP(S) request GET {{wdir}}/view_topic.php?forum_id=1%27&topic_id=1
  10. HTTP(S) request GET {{wdir}}/view_user.php?list=1&letter=&page=1
  11. HTTP(S) request GET {{wdir}}/view_user.php?list=1&letter=&page=1%27
  12. Parses / computes the next value with a Rhai script
  13. Checks qm.found for ^QUOTE$ → finding QoD 75: WowBB view_topic.php / view_user.php SQL injection (CVE-2004-2181)
  14. HTTP(S) request GET {{vdir}}/index.php
  15. … and 2 more steps — see the feed source below

References:

Feed source — tests/vulnerabilities/wowbb/CVE-2004-2181.yaml
# WowBB <= 1.61 — view_topic.php forum_id / view_user.php page SQL injection
# (CVE-2004-2181). The same releases carry the CVE-2004-2180 cross-site
# scripting, see CVE-2004-2180.yaml next to this file.
#
# WowBB 1.61 puts the forum_id parameter of view_topic.php and the page
# parameter of view_user.php unfiltered into SQL queries (Positive
# Technologies / MaxPatrol advisory, BID 11429; the third vector, the sort_by
# parameter of view_user.php, is the one later re-reported for 1.6x as
# CVE-2005-1554 and is tested by CVE-2005-1554.yaml). On a failed query WowBB
# prints its "Invalid SQL query: SELECT ..." error page, which keeps the forum
# footer. No WowBB source is public any more; the request shapes follow the
# advisory's parameter list.
#
# Detection (per candidate install dir: web root, /wowbb, /forum, /forums,
# /board):
#   0. Control — view_topic.php?forum_id=1&topic_id=1 must answer 200 with the
#      WowBB footer and no SQL error.
#   1. QoD 97 — boolean proof computed by the database on forum_id (numeric
#      WHERE): forum_id=IF(A+B=S,1,(SELECT 1 UNION SELECT 2)) sent three times
#      (S wrong, right, wrong; random 6-digit A/B). A wrong sum compares
#      forum_id with a two-row subquery and the query fails ("Subquery returns
#      more than 1 row"); the right sum is the plain value 1. Checked on
#      MariaDB: the constant subquery is evaluated as soon as the forums table
#      has a row. Error / no error / error proves the database evaluated our
#      arithmetic. Quote-free (magic_quotes safe).
#   2. QoD 75 — a quote breaks the query: forum_id=1' (view_topic.php) or
#      page=1' (view_user.php?list=1, the member list paging offset) makes
#      WowBB print "Invalid SQL query: SELECT" or the MySQL syntax error while
#      the same page with the plain value 1 does not. Covers MySQL < 4.1 (no
#      subqueries) and a quoted forum_id.
#   3. QoD 70 — fallback when nothing above confirms: the index.php footer
#      names WowBB 1.61 or older.
#
# Read-only: SELECT only, nothing is written and no data is extracted.
#
# Ported from OpenVAS/Greenbone NVT `pre2008/wowBB_flaws.nasl`
# (OID 1.3.6.1.4.1.25623.1.0.15557, GPL-2.0-only), which only reads the
# version in the index.php footer of /forum, /forums and /board. Differences:
# the injections are proven first (database-computed boolean, then quote error
# with a clean-value control); the web root and /wowbb are probed too; the
# version regex also accepts the "WowBB 1.6" footer of release 1.6, which the
# reference pattern misses.
# CVSS: NVD carries only a CVSS v2 score (7.5).
uid: 1ff315c1-d1e0-407b-9927-dd57c429a74c
name: "WowBB <= 1.61 view_topic.php forum_id / view_user.php page SQL injection (CVE-2004-2181)"
description: |
  WowBB 1.61 and earlier put the forum_id parameter of view_topic.php and the
  page parameter of view_user.php unfiltered into SQL queries, allowing
  unauthenticated SQL injection that can expose the forum database, including
  the administrator's password hash.

  Under the web root and the usual forum directories, this check first loads
  view_topic.php?forum_id=1 and confirms it is a WowBB page without any SQL
  error. It then proves the injection with three requests whose forum_id is a
  condition on the sum of two random numbers: a wrong sum must make WowBB
  print its "Invalid SQL query" error, the right sum must not, which shows the
  database evaluated the injected expression. When that cannot run, a single
  quote appended to forum_id or to the member list's page parameter that
  triggers the error page, while the plain value does not, is reported with
  lower confidence; failing both, a WowBB footer naming version 1.61 or older
  is reported with the lowest confidence. Nothing is written and no data is
  read from the database.
cves: [CVE-2004-2181]
cvss: 7.5
severity: high
category: sqli
confidence_base: 0.30
tags: [wowbb, forum, php, sqli, boolean-based, error-based]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2004-2181"
  - "http://www.securityfocus.com/bid/11429"
  - "http://www.maxpatrol.com/advdetails.asp?id=7"

steps:
  # ── Random operands ───────────────────────────────────────────────────────
  - id: gen-operands
    action: script
    code: |
      let a = rand_int(100000, 999999);
      let b = rand_int(100000, 999999);
      #{ a: a, b: b, sum: a + b, bad1: a + b + rand_int(1, 9), bad2: a + b - rand_int(1, 9) }
    store_as: sc

  # ── Per candidate install dir (loop group) ────────────────────────────────
  # Pre-initialise every stored result a script reads: a failed request leaves
  # store_as unset and an undefined var would abort the whole test.
  - id: init-ctl-resp
    action: set_var
    var_name: ctl_resp
    var_value: {status: 0, body: null}
    loop:
      over: ["", "/wowbb", "/forum", "/forums", "/board"]
      var: wdir

  - id: init-f1-resp
    action: set_var
    var_name: f1_resp
    var_value: {status: 0, body: null}

  - id: init-t-resp
    action: set_var
    var_name: t_resp
    var_value: {status: 0, body: null}

  - id: init-f2-resp
    action: set_var
    var_name: f2_resp
    var_value: {status: 0, body: null}

  - id: init-qm-resp
    action: set_var
    var_name: qm_resp
    var_value: {status: 0, body: null}

  - id: init-pctl-resp
    action: set_var
    var_name: pctl_resp
    var_value: {status: 0, body: null}

  - id: init-pqm-resp
    action: set_var
    var_name: pqm_resp
    var_value: {status: 0, body: null}

  # ── Stage 0: control — forum_id=1, no SQL error ───────────────────────────
  - id: ctl-probe
    action: http_request
    method: GET
    port: "{{port}}"
    path: "{{wdir}}/view_topic.php?forum_id=1&topic_id=1"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    store_as: ctl_resp

  - id: check-ctl
    action: script
    code: |
      let re = "Invalid SQL query|You have an error in your SQL syntax|Subquery returns more than 1 row";
      let body = if type_of(ctl_resp.body) == "string" { ctl_resp.body } else { "" };
      let ok = ctl_resp.status == 200 && ereg("WowBB Forum Software|(?i)powered by[^<]*<[^>]*>\\s*WowBB|>WowBB [0-9]", body) && !ereg(re, body);
      #{ ok: ok }
    store_as: ctl

  # ── Stage 1: boolean proof on forum_id — the database must compute A+B ────
  - id: bool-false-1
    action: http_request
    method: GET
    port: "{{port}}"
    path: "{{wdir}}/view_topic.php?forum_id=IF({{sc.a}}%2B{{sc.b}}%3D{{sc.bad1}},1,(SELECT%201%20UNION%20SELECT%202))&topic_id=1"
    condition: "ctl.ok"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    store_as: f1_resp

  - id: bool-true
    action: http_request
    method: GET
    port: "{{port}}"
    path: "{{wdir}}/view_topic.php?forum_id=IF({{sc.a}}%2B{{sc.b}}%3D{{sc.sum}},1,(SELECT%201%20UNION%20SELECT%202))&topic_id=1"
    condition: "ctl.ok"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    store_as: t_resp

  - id: bool-false-2
    action: http_request
    method: GET
    port: "{{port}}"
    path: "{{wdir}}/view_topic.php?forum_id=IF({{sc.a}}%2B{{sc.b}}%3D{{sc.bad2}},1,(SELECT%201%20UNION%20SELECT%202))&topic_id=1"
    condition: "ctl.ok"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    store_as: f2_resp

  - id: check-bool
    action: script
    code: |
      let re = "Invalid SQL query|You have an error in your SQL syntax|Subquery returns more than 1 row";
      let b1 = if type_of(f1_resp.body) == "string" { f1_resp.body } else { "" };
      let bt = if type_of(t_resp.body) == "string" { t_resp.body } else { "" };
      let b2 = if type_of(f2_resp.body) == "string" { f2_resp.body } else { "" };
      let ok = ctl.ok && t_resp.status == 200 && ereg("WowBB Forum Software|(?i)powered by[^<]*<[^>]*>\\s*WowBB|>WowBB [0-9]", bt)
        && ereg(re, b1) && !ereg(re, bt) && ereg(re, b2);
      #{ ok: ok, found: if ok { "BOOL" } else { "" } }
    store_as: bp

  - id: report-bool
    action: match
    source: bp.found
    pattern: "^BOOL$"
    condition: "bp.ok"
    on_match:
      finding:
        title: "WowBB view_topic.php forum_id SQL injection (CVE-2004-2181)"
        description: "The database evaluated arithmetic injected in the forum_id parameter of view_topic.php: an unauthenticated attacker can run arbitrary SQL against the forum database and read its content, including the administrator's password hash."
        remediation: "WowBB is no longer maintained and no release is known to fix every reported parameter: replace it with a maintained forum, or restrict access to it."
        confidence_delta: 0.65
        qod: 97
        evidence: "Boolean SQLi confirmed on {{wdir}}/view_topic.php: forum_id=IF({{sc.a}}+{{sc.b}}=S,1,(SELECT 1 UNION SELECT 2)) made WowBB print an SQL error for S={{sc.bad1}} and S={{sc.bad2}} but not for the correct sum S={{sc.sum}} (HTTP {{f1_resp.status}} / {{t_resp.status}} / {{f2_resp.status}})"
      stop: true

  # ── Stage 2: fallback — a quote breaks forum_id / page ────────────────────
  - id: qm-probe
    action: http_request
    method: GET
    port: "{{port}}"
    path: "{{wdir}}/view_topic.php?forum_id=1%27&topic_id=1"
    condition: "ctl.ok && !bp.ok"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    store_as: qm_resp

  # page: control with the plain value first, then the quote.
  - id: page-ctl-probe
    action: http_request
    method: GET
    port: "{{port}}"
    path: "{{wdir}}/view_user.php?list=1&letter=&page=1"
    condition: "!bp.ok"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    store_as: pctl_resp

  - id: page-qm-probe
    action: http_request
    method: GET
    port: "{{port}}"
    path: "{{wdir}}/view_user.php?list=1&letter=&page=1%27"
    condition: "!bp.ok && pctl_resp.status == 200"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    store_as: pqm_resp

  - id: check-qm
    action: script
    code: |
      let re = "Invalid SQL query|You have an error in your SQL syntax|Subquery returns more than 1 row";
      let qre = "Invalid SQL query: *SELECT|You have an error in your SQL syntax";
      let foot = "WowBB Forum Software|(?i)powered by[^<]*<[^>]*>\\s*WowBB|>WowBB [0-9]";
      let qb = if type_of(qm_resp.body) == "string" { qm_resp.body } else { "" };
      let pc = if type_of(pctl_resp.body) == "string" { pctl_resp.body } else { "" };
      let pq = if type_of(pqm_resp.body) == "string" { pqm_resp.body } else { "" };
      let fid = ctl.ok && ereg(qre, qb);
      let pg = pctl_resp.status == 200 && ereg(foot, pc) && !ereg(re, pc) && ereg(qre, pq);
      let where = if fid { wdir + "/view_topic.php forum_id=1'" } else if pg { wdir + "/view_user.php?list=1 page=1'" } else { "" };
      #{ hit: fid || pg, where: where, found: if fid || pg { "QUOTE" } else { "" } }
    store_as: qm

  - id: report-qm
    action: match
    source: qm.found
    pattern: "^QUOTE$"
    condition: "qm.hit"
    on_match:
      finding:
        title: "WowBB view_topic.php / view_user.php SQL injection (CVE-2004-2181)"
        description: "A single quote appended to a numeric parameter made WowBB print its SQL error page while the plain value did not: the parameter reaches an SQL query unfiltered, so an unauthenticated attacker can run arbitrary SQL against the forum database."
        remediation: "WowBB is no longer maintained and no release is known to fix every reported parameter: replace it with a maintained forum, or restrict access to it."
        confidence_delta: 0.50
        qod: 75
        evidence: "SQL injection: {{qm.where}} made WowBB print its Invalid SQL query error, while the same page with the value 1 did not"
      stop: true

  # ── Fallback: WowBB 1.61 or older in the index.php footer ─────────────────
  - id: init-idx
    action: set_var
    var_name: idx
    var_value: {status: 0, body: ""}
    loop:
      var: vdir
      over: ["", "/wowbb", "/forum", "/forums", "/board"]

  - id: index
    action: http_request
    method: GET
    path: "{{vdir}}/index.php"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    store_as: idx

  - id: check-version
    action: script
    code: |
      let b = if type_of(idx.body) == "string" { idx.body } else { "" };
      let m = eregmatch("(?is)(?:TITLE=[\"']WowBB Forum Software[^\"']*[\"']|HREF=[\"']https?://(?:www\\.)?wowbb\\.com/?[\"'])[^>]*>\\s*WowBB (0\\.[0-9][0-9.]*|1\\.(?:[0-5][0-9]?|6|60|61))\\s*</A>", b);
      if idx.status == 200 && type_of(m) == "array" && m.len() > 1 { m[1] } else { "" }
    store_as: ver

  - id: report-version
    action: match
    source: ver
    pattern: "^[0-9]"
    condition: 'ver != ""'
    on_match:
      finding:
        title: "WowBB 1.61 or older — SQL injection (CVE-2004-2181)"
        description: "The WowBB forum footer names version 1.61 or older. These releases put the forum_id parameter of view_topic.php and the sort_by and page parameters of view_user.php unfiltered into SQL queries, so an unauthenticated attacker can run arbitrary SQL against the forum database. The injection itself could not be confirmed with the probed parameters."
        remediation: "WowBB is no longer maintained and no release is known to fix every reported parameter: replace it with a maintained forum, or restrict access to it."
        confidence_delta: 0.40
        qod: 70
        evidence: "{{vdir}}/index.php footer: WowBB {{ver}} (1.61 or older)"
      stop: true

WowBB view_user.php sort_by SQL Injection

CVECVE-2005-1554
Severityhigh · CVSS 7.5
Categorysqli — SQL injection
Serviceshttp, https
Detectionscript, set_var, http_request, match · highest QoD 97
Feedtests/vulnerabilities/wowbb/CVE-2005-1554.yaml

WowBB 1.6, 1.61 and 1.62 put the `sort_by` parameter of view_user.php (the member list) unfiltered into the ORDER BY clause of an SQL query, allowing unauthenticated SQL injection that can expose the administrator's user name and password hash.

This check first loads view_user.php?list=1 and confirms it is a WowBB member list without any SQL error. It then proves the injection with three requests whose sort_by value is a condition on the sum of two random numbers: a wrong sum must make WowBB print its "Invalid SQL query" error, the right sum must not, which shows the database evaluated the injected expression. When that boolean test cannot run (for example on databases without subqueries), a single quote in sort_by that triggers the "Invalid SQL query: SELECT" error page is reported with lower confidence. Nothing is written and no data is read from the database.

How noctis detects it

  1. Parses / computes the next value with a Rhai script
  2. HTTP(S) request GET {{wdir}}/view_user.php?list=1&letter=
  3. Parses / computes the next value with a Rhai script
  4. HTTP(S) request GET {{wdir}}/view_user.php?list=1&letter=&sort_by=IF({{sc.a}}%2B{{sc.b}}%3D{{sc.bad1}},1,…
  5. HTTP(S) request GET {{wdir}}/view_user.php?list=1&letter=&sort_by=IF({{sc.a}}%2B{{sc.b}}%3D{{sc.sum}},1,(…
  6. HTTP(S) request GET {{wdir}}/view_user.php?list=1&letter=&sort_by=IF({{sc.a}}%2B{{sc.b}}%3D{{sc.bad2}},1,…
  7. Parses / computes the next value with a Rhai script
  8. Checks bp.found for ^BOOL$ → finding QoD 97: Boolean SQLi confirmed on …/view_user.php: sort_by=IF(…+…=S,1,(SELECT 1 UNION SELECT 2)) made WowBB print an SQL error for S=… and S=… but …
  9. HTTP(S) request GET {{wdir}}/view_user.php?list=1&letter=&sort_by=%27select
  10. HTTP(S) request GET {{wdir}}/view_user.php?list=1&letter=&sort_by=1
  11. Parses / computes the next value with a Rhai script
  12. Checks qm.found for ^QUOTE$ → finding QoD 75: SQL injection: sort_by='select on …/view_user.php made WowBB print its Invalid SQL query error, while the default member list and sort_by=1…

References:

Feed source — tests/vulnerabilities/wowbb/CVE-2005-1554.yaml
# WowBB 1.6 / 1.61 / 1.62 — view_user.php `sort_by` SQL injection (CVE-2005-1554)
#
# view_user.php?list=1 lists the forum members and puts the `sort_by` GET
# parameter, unfiltered, into the ORDER BY clause of the member-list query
# (Bugtraq 2005-05-10, "WowBB view_user.php SQL Injection Vulnerability",
# BID 13569: view_user.php?list=1&letter=&sort_by='[SQL Injection]). On a
# failed query WowBB prints its "Invalid SQL query: SELECT ..." error page,
# which keeps the forum footer (TITLE="WowBB Forum Software ...").
#
# No WowBB source is public any more (wowbb.com is gone); the request shape
# and the error page come from the advisory and the reference check below.
#
# Detection (per candidate install dir):
#   0. Control — view_user.php?list=1&letter= (no sort_by, the default sort)
#      must answer 200 with the WowBB footer and no SQL error: a page that
#      always prints an SQL error never reports.
#   1. QoD 97 — boolean proof computed by the database:
#      sort_by=IF(A+B=S,1,(SELECT 1 UNION SELECT 2)) sent three times
#      (S wrong, right, wrong; random 6-digit A/B). A wrong sum picks the
#      two-row subquery and the query fails ("Subquery returns more than 1
#      row"); the right sum is a valid constant sort key. Measured on MariaDB
#      10.11 and MySQL 8.0: the ORDER BY subquery is evaluated even when no
#      member row matches (unless the optimizer proves the WHERE empty, e.g.
#      an impossible condition — then nothing errors and nothing is reported).
#      Quote-free (magic_quotes safe). Error / no error / error proves the
#      database evaluated our arithmetic.
#   2. QoD 75 — the reference check: sort_by='select makes the page print
#      "Invalid SQL query: SELECT" (or the MySQL syntax error), while the
#      control above did not and sort_by=1 (order by column position, valid
#      on every MySQL) did not either — a page that errors on any sort_by
#      value stays clean. Covers MySQL < 4.1 (no subqueries).
#
# Better than the reference check: it also needs the control to stay clean
# (an always-erroring page no longer reports), proves the injection with a
# database-computed boolean instead of a lone quote error, looks under /wowbb
# (the advisory's path) and the web root besides /forum, /forums, /board,
# and does not require the exact TITLE="WowBB Forum Software attribute on the
# error page (any WowBB footer on the control page).
#
# Read-only: SELECT only, nothing is written and no data is extracted.
#
# Credit: request and markers adapted from Greenbone's
#   pre2008/wowBB_sql_injection.nasl (OID 1.3.6.1.4.1.25623.1.0.18221,
#   GPL-2.0-only).
uid: 394c4e88-62be-4c5f-ba65-d1367335420c
name: "WowBB view_user.php sort_by SQL Injection (CVE-2005-1554)"
description: |
  WowBB 1.6, 1.61 and 1.62 put the `sort_by` parameter of view_user.php
  (the member list) unfiltered into the ORDER BY clause of an SQL query,
  allowing unauthenticated SQL injection that can expose the administrator's
  user name and password hash.

  This check first loads view_user.php?list=1 and confirms it is a WowBB
  member list without any SQL error. It then proves the injection with three
  requests whose sort_by value is a condition on the sum of two random
  numbers: a wrong sum must make WowBB print its "Invalid SQL query" error,
  the right sum must not, which shows the database evaluated the injected
  expression. When that boolean test cannot run (for example on databases
  without subqueries), a single quote in sort_by that triggers the
  "Invalid SQL query: SELECT" error page is reported with lower confidence.
  Nothing is written and no data is read from the database.
cves: [CVE-2005-1554]
cvss: 7.5
severity: high
confidence_base: 0.30
category: sqli
tags: [wowbb, forum, php, sqli, boolean-based, error-based]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2005-1554"
  - "https://marc.info/?l=bugtraq&m=111575905112831&w=2"
  - "https://www.securityfocus.com/bid/13569"

steps:
  # ── Random operands ───────────────────────────────────────────────────────
  - id: gen-operands
    action: script
    code: |
      let a = rand_int(100000, 999999);
      let b = rand_int(100000, 999999);
      #{ a: a, b: b, sum: a + b, bad1: a + b + rand_int(1, 9), bad2: a + b - rand_int(1, 9) }
    store_as: sc

  # ── Per candidate install dir (loop group) ────────────────────────────────
  # Pre-initialise every stored result a script reads: a failed request leaves
  # store_as unset and an undefined var would abort the whole test.
  - id: init-ctl-resp
    action: set_var
    var_name: ctl_resp
    var_value: {status: 0, body: null}
    loop:
      over: ["", "/wowbb", "/forum", "/forums", "/board"]
      var: wdir

  - id: init-qm-resp
    action: set_var
    var_name: qm_resp
    var_value: {status: 0, body: null}

  - id: init-f1-resp
    action: set_var
    var_name: f1_resp
    var_value: {status: 0, body: null}

  - id: init-t-resp
    action: set_var
    var_name: t_resp
    var_value: {status: 0, body: null}

  - id: init-f2-resp
    action: set_var
    var_name: f2_resp
    var_value: {status: 0, body: null}

  - id: init-pos-resp
    action: set_var
    var_name: pos_resp
    var_value: {status: 0, body: null}

  # ── Stage 0: control — the default member list, no SQL error ──────────────
  - id: ctl-probe
    action: http_request
    method: GET
    port: "{{port}}"
    path: "{{wdir}}/view_user.php?list=1&letter="
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    store_as: ctl_resp

  - id: check-ctl
    action: script
    code: |
      let re = "Invalid SQL query|You have an error in your SQL syntax|Subquery returns more than 1 row";
      let body = if type_of(ctl_resp.body) == "string" { ctl_resp.body } else { "" };
      let ok = ctl_resp.status == 200 && ereg("WowBB Forum Software|(?i)powered by[^<]*<[^>]*>\\s*WowBB|>WowBB [0-9]", body) && !ereg(re, body);
      #{ ok: ok }
    store_as: ctl

  # ── Stage 1: boolean proof — the database must compute A+B ────────────────
  - id: bool-false-1
    action: http_request
    method: GET
    port: "{{port}}"
    path: "{{wdir}}/view_user.php?list=1&letter=&sort_by=IF({{sc.a}}%2B{{sc.b}}%3D{{sc.bad1}},1,(SELECT%201%20UNION%20SELECT%202))"
    condition: "ctl.ok"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    store_as: f1_resp

  - id: bool-true
    action: http_request
    method: GET
    port: "{{port}}"
    path: "{{wdir}}/view_user.php?list=1&letter=&sort_by=IF({{sc.a}}%2B{{sc.b}}%3D{{sc.sum}},1,(SELECT%201%20UNION%20SELECT%202))"
    condition: "ctl.ok"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    store_as: t_resp

  - id: bool-false-2
    action: http_request
    method: GET
    port: "{{port}}"
    path: "{{wdir}}/view_user.php?list=1&letter=&sort_by=IF({{sc.a}}%2B{{sc.b}}%3D{{sc.bad2}},1,(SELECT%201%20UNION%20SELECT%202))"
    condition: "ctl.ok"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    store_as: f2_resp

  - id: check-bool
    action: script
    code: |
      let re = "Invalid SQL query|You have an error in your SQL syntax|Subquery returns more than 1 row";
      let b1 = if type_of(f1_resp.body) == "string" { f1_resp.body } else { "" };
      let bt = if type_of(t_resp.body) == "string" { t_resp.body } else { "" };
      let b2 = if type_of(f2_resp.body) == "string" { f2_resp.body } else { "" };
      let ok = ctl.ok && t_resp.status == 200 && ereg("WowBB Forum Software|(?i)powered by[^<]*<[^>]*>\\s*WowBB|>WowBB [0-9]", bt)
        && ereg(re, b1) && !ereg(re, bt) && ereg(re, b2);
      #{ ok: ok, found: if ok { "BOOL" } else { "" } }
    store_as: bp

  - id: report-bool
    action: match
    source: bp.found
    pattern: "^BOOL$"
    condition: "bp.ok"
    on_match:
      finding:
        confidence_delta: 0.65
        qod: 97
        evidence: "Boolean SQLi confirmed on {{wdir}}/view_user.php: sort_by=IF({{sc.a}}+{{sc.b}}=S,1,(SELECT 1 UNION SELECT 2)) made WowBB print an SQL error for S={{sc.bad1}} and S={{sc.bad2}} but not for the correct sum S={{sc.sum}} (HTTP {{f1_resp.status}} / {{t_resp.status}} / {{f2_resp.status}})"
      stop: true

  # ── Stage 2: fallback — the quote breaks the query ────────────────────────
  - id: qm-probe
    action: http_request
    method: GET
    port: "{{port}}"
    path: "{{wdir}}/view_user.php?list=1&letter=&sort_by=%27select"
    condition: "ctl.ok && !bp.ok"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    store_as: qm_resp

  # Second control: a valid sort_by value (column position) must not error.
  - id: pos-probe
    action: http_request
    method: GET
    port: "{{port}}"
    path: "{{wdir}}/view_user.php?list=1&letter=&sort_by=1"
    condition: "ctl.ok && !bp.ok"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    store_as: pos_resp

  - id: check-qm
    action: script
    code: |
      let re = "Invalid SQL query|You have an error in your SQL syntax|Subquery returns more than 1 row";
      let body = if type_of(qm_resp.body) == "string" { qm_resp.body } else { "" };
      let pbody = if type_of(pos_resp.body) == "string" { pos_resp.body } else { "" };
      let hit = ctl.ok && pos_resp.status == 200 && !ereg(re, pbody)
        && ereg("Invalid SQL query: *SELECT|You have an error in your SQL syntax", body);
      #{ hit: hit, found: if hit { "QUOTE" } else { "" } }
    store_as: qm

  - id: report-qm
    action: match
    source: qm.found
    pattern: "^QUOTE$"
    condition: "qm.hit"
    on_match:
      finding:
        confidence_delta: 0.50
        qod: 75
        evidence: "SQL injection: sort_by='select on {{wdir}}/view_user.php made WowBB print its Invalid SQL query error, while the default member list and sort_by=1 did not (HTTP {{qm_resp.status}} / {{ctl_resp.status}} / {{pos_resp.status}})"
      stop: true

WowBB <= 1.61 search.php / index.php / view_forum.php / view_user.php cross-site scripting

CVECVE-2004-2180
Severitymedium · CVSS 4.3
Categoryxss — XSS
Serviceshttp, https
Detectionscript, set_var, http_request, match · highest QoD 75
Feedtests/vulnerabilities/wowbb/CVE-2004-2180.yaml

WowBB 1.61 and earlier print several request parameters (search.php q, index.php and view_forum.php show, view_user.php letter and country, among others) into their pages without HTML encoding, so a crafted link runs attacker script in the browser of a forum user who follows it.

Under the web root and the usual forum directories, this check requests search.php, index.php, view_forum.php and view_user.php with a value that closes an HTML attribute and opens an element named after a random marker. The flaw is confirmed when a WowBB page (HTTP 200) returns that element unescaped, and a random page of the same directory, given the same parameters, does not (which rules out servers that echo any URL). When no page reflects the element, a WowBB footer naming version 1.61 or older is reported with lower confidence.

How noctis detects it

  1. Parses / computes the next value with a Rhai script
  2. HTTP(S) request GET {{wdir}}/index.php
  3. Parses / computes the next value with a Rhai script
  4. Parses / computes the next value with a Rhai script
  5. HTTP(S) request GET {{wdir}}/search.php?q={{sc.p}}
  6. HTTP(S) request GET {{wdir}}/index.php?show={{sc.p}}
  7. HTTP(S) request GET {{wdir}}/view_forum.php?show={{sc.p}}
  8. HTTP(S) request GET {{wdir}}/view_user.php?list=1&letter={{sc.p}}
  9. Parses / computes the next value with a Rhai script
  10. HTTP(S) request GET {{wdir}}/{{sc.ctl}}?{{cand.q}}{{sc.p}}
  11. Parses / computes the next value with a Rhai script
  12. Checks hit for \.php\? → finding QoD 75: WowBB cross-site scripting (CVE-2004-2180)
  13. Checks ver.v for ^[0-9], for each of 1 values → finding QoD 70: WowBB 1.61 or older — cross-site scripting (CVE-2004-2180)

References:

Feed source — tests/vulnerabilities/wowbb/CVE-2004-2180.yaml
# WowBB <= 1.61 — reflected cross-site scripting (CVE-2004-2180).
# The same releases carry the CVE-2004-2181 SQL injections, see
# CVE-2004-2181.yaml next to this file.
#
# WowBB 1.61 prints several request parameters into its pages without HTML
# encoding (Positive Technologies / MaxPatrol advisory, BID 11429): the q
# parameter of search.php, the show parameter of index.php and view_forum.php,
# the letter and country parameters of view_user.php, the highlight parameter
# of view_topic.php, the Referer header on admin.php and user_email on
# login.php. No WowBB source is public any more and the advisory gives
# parameter names only, so the probes follow the advisory's parameter list.
#
# Detection:
#   0. Gate — of the web root, /wowbb, /forum, /forums and /board, only a
#      directory whose index.php carries a WowBB footer is probed (5 requests
#      on a host without WowBB).
#   1. QoD 75 — search.php?q=, index.php?show=, view_forum.php?show= and
#      view_user.php?list=1&letter= are sent an attribute break-out
#      "><noctis<random>> . Confirmed when a WowBB page (HTTP 200, WowBB
#      footer) returns it verbatim outside single-quoted attributes (those
#      occurrences are removed first: the element stays text there), and a
#      random .php name of the same directory, given the same query, does not
#      (rules out servers that echo any URL).
#   2. QoD 70 — fallback when no probe confirms: the index.php footer names
#      WowBB 1.61 or older ("WowBB 1.6", "WowBB 1.61", "WowBB 1.5x", 0.x).
#
# Ported from OpenVAS/Greenbone NVT `pre2008/wowBB_flaws.nasl`
# (OID 1.3.6.1.4.1.25623.1.0.15557, GPL-2.0-only), which only reads the
# version in the index.php footer of /forum, /forums and /board. Differences:
# an active reflection proof comes first; the web root and /wowbb are probed
# too; the version regex also accepts the two-character "WowBB 1.6" footer of
# release 1.6 (the reference pattern needs two digits after "1." and misses
# it) and no longer needs the "WowBB Forums" title on the same page.
# CVSS: NVD carries only a CVSS v2 score (4.3).
uid: 8a1d534c-3c36-4206-8f4d-2afce60cbecb
name: "WowBB <= 1.61 search.php / index.php / view_forum.php / view_user.php cross-site scripting (CVE-2004-2180)"
description: |
  WowBB 1.61 and earlier print several request parameters (search.php q,
  index.php and view_forum.php show, view_user.php letter and country, among
  others) into their pages without HTML encoding, so a crafted link runs
  attacker script in the browser of a forum user who follows it.

  Under the web root and the usual forum directories, this check requests
  search.php, index.php, view_forum.php and view_user.php with a value that
  closes an HTML attribute and opens an element named after a random marker.
  The flaw is confirmed when a WowBB page (HTTP 200) returns that element
  unescaped, and a random page of the same directory, given the same
  parameters, does not (which rules out servers that echo any URL). When no
  page reflects the element, a WowBB footer naming version 1.61 or older is
  reported with lower confidence.
cves: [CVE-2004-2180]
cvss: 4.3
severity: medium
category: xss
confidence_base: 0.30
tags: [wowbb, forum, php, xss, reflected]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2004-2180"
  - "http://www.securityfocus.com/bid/11429"
  - "http://www.maxpatrol.com/advdetails.asp?id=7"

steps:
  - id: gen-marker
    action: script
    code: |
      let tok = "noctis" + rand_int(10000000, 99999999);
      #{ tok: tok,
         want: "\"><" + tok + ">",
         sq: "='[^'<>]*\"><" + tok + ">",
         p: "%22%3E%3C" + tok + "%3E",
         ctl: "noctis" + rand_hex(6) + ".php" }
    store_as: sc

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

  - id: init-ver
    action: set_var
    var_name: ver
    var_value: {v: "", d: ""}

  # ── Per install dir (loop group) ──────────────────────────────────────────
  # Pre-initialise every stored result a script reads: a failed request leaves
  # store_as unset and an undefined var would abort the whole test.
  - id: init-idx
    action: set_var
    var_name: idx
    var_value: {status: 0, body: ""}
    loop:
      var: wdir
      over: ["", "/wowbb", "/forum", "/forums", "/board"]

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

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

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

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

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

  # Landing page: only a directory serving a WowBB index.php is probed.
  - id: index
    action: http_request
    method: GET
    path: "{{wdir}}/index.php"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: true
    timeout_secs: 10
    condition: 'hit == ""'
    store_as: idx

  - id: check-index
    action: script
    code: |
      let b = if type_of(idx.body) == "string" { idx.body } else { "" };
      let m = eregmatch("(?is)(?:TITLE=[\"']WowBB Forum Software[^\"']*[\"']|HREF=[\"']https?://(?:www\\.)?wowbb\\.com/?[\"'])[^>]*>\\s*WowBB (0\\.[0-9][0-9.]*|1\\.(?:[0-5][0-9]?|6|60|61))\\s*</A>", b);
      #{ wb: idx.status == 200 && ereg("WowBB Forum Software|(?i)powered by[^<]*<[^>]*>\\s*WowBB|>WowBB [0-9]|<TITLE>WowBB", b),
         ver: if idx.status == 200 && type_of(m) == "array" && m.len() > 1 { m[1] } else { "" } }
    store_as: pg

  - id: keep-version
    action: script
    code: |
      if ver.v == "" && pg.ver != "" { #{ v: pg.ver, d: wdir } } else { ver }
    store_as: ver

  - id: probe-1
    action: http_request
    method: GET
    path: "{{wdir}}/search.php?q={{sc.p}}"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    condition: 'hit == "" && pg.wb'
    store_as: r1

  - id: probe-2
    action: http_request
    method: GET
    path: "{{wdir}}/index.php?show={{sc.p}}"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    condition: 'hit == "" && pg.wb'
    store_as: r2

  - id: probe-3
    action: http_request
    method: GET
    path: "{{wdir}}/view_forum.php?show={{sc.p}}"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    condition: 'hit == "" && pg.wb'
    store_as: r3

  - id: probe-4
    action: http_request
    method: GET
    path: "{{wdir}}/view_user.php?list=1&letter={{sc.p}}"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    condition: 'hit == "" && pg.wb'
    store_as: r4

  # A reflection counts outside single-quoted attributes (removed first),
  # on a WowBB page (HTTP 200 + footer).
  - id: check-probes
    action: script
    condition: 'hit == "" && pg.wb'
    code: |
      let vs = [
        #{ page: "search.php", q: "q=", r: r1 },
        #{ page: "index.php", q: "show=", r: r2 },
        #{ page: "view_forum.php", q: "show=", r: r3 },
        #{ page: "view_user.php", q: "list=1&letter=", r: r4 },
      ];
      let cand = #{ page: "", q: "" };
      for x in vs {
        let b = if type_of(x.r.body) == "string" { x.r.body } else { "" };
        if cand.q == "" && x.r.status == 200 && ereg_replace(sc.sq, "", b).contains(sc.want)
          && ereg("WowBB Forum Software|(?i)powered by[^<]*<[^>]*>\\s*WowBB|>WowBB [0-9]|<TITLE>WowBB", b) {
          cand = #{ page: x.page, q: x.q };
        }
      }
      cand
    store_as: cand

  # Generic-reflection control: same query on a random page of the directory.
  - id: control
    action: http_request
    method: GET
    path: "{{wdir}}/{{sc.ctl}}?{{cand.q}}{{sc.p}}"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    condition: 'hit == "" && pg.wb && cand.q != ""'
    store_as: rc

  - id: check
    action: script
    condition: 'hit == "" && pg.wb'
    code: |
      let cb = if type_of(rc.body) == "string" { rc.body } else { "" };
      if cand.q != "" && !cb.contains(sc.want) { wdir + "/" + cand.page + "?" + cand.q } else { "" }
    store_as: hit

  - id: report-xss
    action: match
    source: hit
    pattern: "\\.php\\?"
    condition: 'hit != ""'
    on_match:
      finding:
        title: "WowBB cross-site scripting (CVE-2004-2180)"
        description: "WowBB returned an HTML element passed in a request parameter without HTML encoding: a crafted link runs attacker script in the browser of a forum user who follows it, in the context of the forum."
        remediation: "WowBB is no longer maintained and no release is known to fix every reported parameter: replace it with a maintained forum, or restrict access to it."
        confidence_delta: 0.50
        qod: 75
        evidence: "{{hit}} + attribute break-out returned {{sc.want}} unescaped (HTTP 200, WowBB page); a random page of the same directory did not reflect it"
      stop: true

  # ── Fallback: WowBB 1.61 or older in an index.php footer ──────────────────
  # A one-item loop ends the per-directory group above.
  - id: report-version
    action: match
    source: ver.v
    pattern: "^[0-9]"
    condition: 'ver.v != ""'
    loop:
      var: once
      over: ["once"]
    on_match:
      finding:
        title: "WowBB 1.61 or older — cross-site scripting (CVE-2004-2180)"
        description: "The WowBB forum footer names version 1.61 or older. These releases print several request parameters into their pages without HTML encoding, so a crafted link runs attacker script in the browser of a forum user who follows it. The reflection itself could not be confirmed with the probed parameters."
        remediation: "WowBB is no longer maintained and no release is known to fix every reported parameter: replace it with a maintained forum, or restrict access to it."
        confidence_delta: 0.40
        qod: 70
        evidence: "{{ver.d}}/index.php footer: WowBB {{ver.v}} (1.61 or older)"
      stop: true

View these feeds on GitHub