Zabbix — 2 vulnerability checks
noctis ships 2 vulnerability checks for Zabbix, covering 2 CVEs; each one has to observe the bug on the live service before it reports a finding.
← All products · Feeds on GitHub
Zabbix httpmon.php SQL Injection
| CVE | CVE-2013-5743 |
|---|---|
| Severity | critical · CVSS 9.8 |
| Category | sqli — SQL injection |
| Services | http, https |
| Detection | set_var, tcp_connect, match · highest QoD 75 |
| Feed | tests/vulnerabilities/zabbix/CVE-2013-5743.yaml |
Sends a single quote in the applications parameter of Zabbix httpmon.php and checks whether the response leaks a MySQL syntax error from the query.
How noctis detects it
- Raw TCP (TLS on HTTPS), sent verbatim:
GET /httpmon.php?applications=2%27 HTTP/1.0 - Checks
root_resp.bannerforError in query - Checks
root_resp.bannerforYou have an error in your SQL syntax→ finding QoD 75: SQL error leaked by /httpmon.php?applications=2%27: … - Raw TCP (TLS on HTTPS), sent verbatim:
GET /zabbix/httpmon.php?applications=2%27 HTTP/1.0 - Checks
zbx_resp.bannerforError in query - Checks
zbx_resp.bannerforYou have an error in your SQL syntax→ finding QoD 75: SQL error leaked by /zabbix/httpmon.php?applications=2%27: …
References:
Feed source — tests/vulnerabilities/zabbix/CVE-2013-5743.yaml
# Zabbix httpmon.php SQL injection — CVE-2013-5743
#
# Ported from OpenVAS/Greenbone NVT 2013/gb_zabbix_62794.nasl (GPL-2.0-only).
#
# Detection: GET <dir>/httpmon.php?applications=2%27 (a single quote in the
# "applications" parameter). A vulnerable frontend passes the value unescaped
# into SQL and returns the database error, containing both "Error in query"
# and "You have an error in your SQL syntax". Both strings are required, as in
# the NASL (pattern + extra_check). Probed dirs: "/" and "/zabbix".
#
# tcp_connect is used so the %27 encoding is sent verbatim.
# QoD 75 (response analysis).
uid: c36df46c-111e-4542-b8b9-bcc276bc4878
name: "Zabbix httpmon.php SQL Injection (CVE-2013-5743)"
description: |
Sends a single quote in the applications parameter of Zabbix httpmon.php and
checks whether the response leaks a MySQL syntax error from the query.
cves: [CVE-2013-5743]
cvss: 9.8
severity: critical
category: sqli
confidence_base: 0.30
tags: [zabbix, sqli, monitoring]
services: [http, https]
author: noctis
version: "1.0.0"
references:
- "https://nvd.nist.gov/vuln/detail/CVE-2013-5743"
- "OpenVAS NVT 2013/gb_zabbix_62794.nasl (GPL-2.0-only)"
steps:
- id: init
action: set_var
var_name: sqli_root
var_value: false
- id: init-zabbix
action: set_var
var_name: sqli_zabbix
var_value: false
# ── dir "/" ──────────────────────────────────────────────────────────────
- id: probe-root
action: tcp_connect
port: "{{port}}"
send: "GET /httpmon.php?applications=2%27 HTTP/1.0\r\nHost: {{target_host}}\r\n\r\n"
timeout_secs: 10
store_as: root_resp
- id: root-error
action: match
source: root_resp.banner
pattern: "Error in query"
on_match:
set_vars:
sqli_root: true
- id: root-syntax
action: match
source: root_resp.banner
pattern: "You have an error in your SQL syntax"
condition: "sqli_root == true"
on_match:
finding:
confidence_delta: 0.55
qod: 75
evidence: "SQL error leaked by /httpmon.php?applications=2%27: {{root_resp.banner}}"
stop: true
# ── dir "/zabbix" ────────────────────────────────────────────────────────
- id: probe-zabbix
action: tcp_connect
port: "{{port}}"
send: "GET /zabbix/httpmon.php?applications=2%27 HTTP/1.0\r\nHost: {{target_host}}\r\n\r\n"
timeout_secs: 10
store_as: zbx_resp
- id: zabbix-error
action: match
source: zbx_resp.banner
pattern: "Error in query"
on_match:
set_vars:
sqli_zabbix: true
- id: zabbix-syntax
action: match
source: zbx_resp.banner
pattern: "You have an error in your SQL syntax"
condition: "sqli_zabbix == true"
on_match:
finding:
confidence_delta: 0.55
qod: 75
evidence: "SQL error leaked by /zabbix/httpmon.php?applications=2%27: {{zbx_resp.banner}}"
stop: trueZabbix popup.php only_hostid SQL injection
| CVE | CVE-2011-4674 |
|---|---|
| Severity | high · CVSS 7.5 |
| Category | sqli — SQL injection |
| Services | http, https |
| Detection | set_var, script, http_request, match · highest QoD 75 |
| Feed | tests/vulnerabilities/zabbix/CVE-2011-4674.yaml |
Zabbix 1.8.3 and 1.8.4 (and possibly other releases before 1.8.9) place the only_hostid parameter of popup.php into an SQL query without validation.
Under /zabbix and the web root, this check requests popup.php with a plain numeric only_hostid as a control, which must not raise a database error. It then sends only_hostid with a quote followed by a random marker. A MySQL "You have an error in your SQL syntax" message that quotes the marker proves the value reaches the query unescaped. Nothing is written and no data is read.
How noctis detects it
- Parses / computes the next value with a Rhai script
- HTTP(S) request
GET {{zdir}}/popup.php?dstfrm=form_scenario&dstfld1=application&srctbl=applications&srcfl… - HTTP(S) request
GET {{zdir}}/popup.php?dstfrm=form_scenario&dstfld1=application&srctbl=applications&srcfl… - Parses / computes the next value with a Rhai script
- Checks
inj.bodyforYou have an error in your SQL syntax→ finding QoD 75: Zabbix popup.php only_hostid SQL injection (CVE-2011-4674)
References:
Feed source — tests/vulnerabilities/zabbix/CVE-2011-4674.yaml
# Zabbix popup.php only_hostid SQL injection — CVE-2011-4674
#
# Detection (per candidate dir: /zabbix, then the web root):
# 1. Control: popup.php?...&only_hostid=1 must answer 200 without a database
# error.
# 2. Probe: only_hostid=1'<random marker> (a quote, then a random inert word)
# makes the query invalid; a vulnerable frontend prints the MySQL
# "You have an error in your SQL syntax" message, which quotes the text
# after the failure point, i.e. our random marker. The marker coming back
# inside the database error proves the raw value reached the SQL query.
#
# Read-only: the payload is a syntax error, no data is read or written.
#
# Ported from OpenVAS/Greenbone NVT `2011/gb_zabbix_only_hostid_param_sql_inj_vuln.nasl`
# (GPL-2.0-only). Improvements: a control request plus a random marker that
# must be quoted by the error, instead of matching the error text alone.
# CVSS: NVD carries only a CVSS v2 score (7.5).
uid: 7d3f487c-a6d2-4987-a098-fd5f5458d604
name: "Zabbix popup.php only_hostid SQL injection (CVE-2011-4674)"
description: |
Zabbix 1.8.3 and 1.8.4 (and possibly other releases before 1.8.9) place the
only_hostid parameter of popup.php into an SQL query without validation.
Under /zabbix and the web root, this check requests popup.php with a plain
numeric only_hostid as a control, which must not raise a database error. It
then sends only_hostid with a quote followed by a random marker. A MySQL
"You have an error in your SQL syntax" message that quotes the marker proves
the value reaches the query unescaped. Nothing is written and no data is
read.
cves: [CVE-2011-4674]
cvss: 7.5
severity: high
category: sqli
confidence_base: 0.30
tags: [zabbix, sqli, monitoring, error-based]
services: [http, https]
author: noctis
version: "1.0.0"
references:
- "https://nvd.nist.gov/vuln/detail/CVE-2011-4674"
steps:
- id: init-ctl
action: set_var
var_name: ctl
var_value: {status: 0, body: null}
loop:
over: ["/zabbix", ""]
var: zdir
- id: init-inj
action: set_var
var_name: inj
var_value: {status: 0, body: null}
- id: marker
action: script
code: |
"noctis" + oob_token.sub_string(0, 8)
store_as: mk
- id: control
action: http_request
method: GET
port: "{{port}}"
path: "{{zdir}}/popup.php?dstfrm=form_scenario&dstfld1=application&srctbl=applications&srcfld1=name&only_hostid=1"
tls_insecure: true
follow_redirects: false
timeout_secs: 15
store_as: ctl
- id: inject
action: http_request
method: GET
port: "{{port}}"
path: "{{zdir}}/popup.php?dstfrm=form_scenario&dstfld1=application&srctbl=applications&srcfld1=name&only_hostid=1%27{{mk}}"
condition: 'ctl.status == 200 && type_of(ctl.body) == "string" && !ereg("You have an error in your SQL syntax", ctl.body)'
tls_insecure: true
follow_redirects: false
timeout_secs: 15
store_as: inj
- id: check
action: script
code: |
let b = if type_of(inj.body) == "string" { inj.body } else { "" };
#{ err: inj.status >= 200 && inj.status < 600 && ereg("You have an error in your SQL syntax[^<]*near '[^<]*" + mk, b) }
store_as: res
- id: report
action: match
source: inj.body
pattern: "You have an error in your SQL syntax"
condition: "res.err"
on_match:
finding:
title: "Zabbix popup.php only_hostid SQL injection (CVE-2011-4674)"
description: "only_hostid=1 answered normally, while only_hostid=1 followed by a quote and a random marker made the frontend print a MySQL syntax error quoting the marker: the value reaches an SQL query unescaped, so an attacker can run arbitrary SQL against the Zabbix database."
remediation: "Upgrade Zabbix to 1.8.9 or later, which validates only_hostid."
confidence_delta: 0.45
qod: 75
evidence: "{{zdir}}/popup.php: only_hostid=1 answers normally, only_hostid=1' plus a random marker is quoted back in a MySQL syntax error"
stop: true