PLANEX — 1 vulnerability check

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

← All products · Feeds on GitHub

PLANEX CS-W50HD Hardcoded Credentials (HTTP)

CVECVE-2017-12574
Severitycritical · CVSS 9.8
Categorydefault-credentials — Default credentials
Serviceshttp, https
Detectionset_var, script, tcp_connect, match · highest QoD 97
Feedtests/vulnerabilities/planex/CVE-2017-12574.yaml

PLANEX CS-W50HD network cameras with firmware before 030720 inject the hardcoded web account supervisor/dangerous into /.htpasswd at boot (CVE-2017-12574). The check logs in to the camera information page (/cgi-bin/info.cgi) over HTTP Basic auth with that pair and confirms it reaches the authenticated page, after making sure a random account is refused so a finding proves the hardcoded credential. With it, an attacker gets administrative access to the camera's web management interface.

How noctis detects it

  1. Parses / computes the next value with a Rhai script
  2. Raw TCP (TLS on HTTPS), sent verbatim: GET /cgi-bin/info.cgi HTTP/1.0
  3. Parses / computes the next value with a Rhai script
  4. Raw TCP (TLS on HTTPS), sent verbatim: GET /cgi-bin/info.cgi HTTP/1.0
  5. Parses / computes the next value with a Rhai script
  6. Checks login.banner for (?s)^HTTP/1\.[01] 200\b.*IP CAM Information → finding QoD 97: Logged in to the PLANEX CS-W50HD web interface with the hardcoded credential supervisor/dangerous: GET /cgi-bin/info.cgi returned HTTP 200 …

References:

Feed source — tests/vulnerabilities/planex/CVE-2017-12574.yaml
# PLANEX CS-W50HD network camera — hardcoded web account supervisor:dangerous
# (CVE-2017-12574).
#
# Ported from OpenVAS/Greenbone NVT
# 2018/planex/gb_planex_csw50hd_hardcode_cred_vuln.nasl
# (OID 1.3.6.1.4.1.25623.1.0.813883, GPL-2.0-only):
#   GET /cgi-bin/info.cgi with "Authorization: Basic base64(supervisor:dangerous)";
#   the login worked when the reply is HTTP 200 and carries ALL of
#   "IP CAM Information", "CS-W50HD", "WiFi Mac Address", "Network type" and
#   "IP CAM ID". Reading that information page is a read-only post-login proof.
#
# Deviation from the NASL (stronger detection, stated in the PR):
#   * Accept-any-password control: before the hardcoded login, the same page is
#     requested with a random user and a random password. If that already
#     returns the camera information page, the camera does not check
#     credentials (page open to anyone, honeypot, broken auth) and the feed
#     reports nothing — the NASL would report supervisor:dangerous. The random
#     account does not exist on a real camera, so no real account sees an
#     extra failed login.
#   * The NASL only runs once its product detection has set a CS-W50HD CPE;
#     here the five product-specific markers plus the control replace that gate.
#
# Nothing is changed on the camera.
uid: a5fdf93a-d5fd-4287-a787-2e38f17d6ccd
name: "PLANEX CS-W50HD Hardcoded Credentials (HTTP)"
description: |
  PLANEX CS-W50HD network cameras with firmware before 030720 inject the
  hardcoded web account supervisor/dangerous into /.htpasswd at boot
  (CVE-2017-12574). The check logs in to the camera information page
  (/cgi-bin/info.cgi) over HTTP Basic auth with that pair and confirms it
  reaches the authenticated page, after making sure a random account is
  refused so a finding proves the hardcoded credential. With it, an attacker
  gets administrative access to the camera's web management interface.
cves: [CVE-2017-12574]
cvss: 9.8
severity: critical
category: default-credentials
confidence_base: 0.30
tags: [openvas-migrated, planex, ip-camera, hardcoded-credentials, default-credentials, http]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2017-12574"
  - "OpenVAS/Greenbone NASL 2018/planex/gb_planex_csw50hd_hardcode_cred_vuln.nasl (GPL-2.0-only)"

steps:
  - id: init-anycred
    action: set_var
    var_name: anycred
    var_value: false
  - id: init-loggedin
    action: set_var
    var_name: loggedin
    var_value: false
  # Pre-init the stored results the scripts read, so a failed request never
  # leaves an undefined variable behind.
  - id: init-ctrl
    action: set_var
    var_name: ctrl
    var_value: {banner: null}
  - id: init-login
    action: set_var
    var_name: login
    var_value: {banner: null}

  # 1. Control — a random account must not open the information page.
  - id: control-auth
    action: script
    code: 'base64_encode("noctis" + rand_hex(6) + ":" + rand_hex(10))'
    store_as: bad_auth
  - id: control
    action: tcp_connect
    port: "{{port}}"
    send: "GET /cgi-bin/info.cgi HTTP/1.0\r\nHost: {{target_host}}\r\nAuthorization: Basic {{bad_auth}}\r\n\r\n"
    store_as: ctrl
  - id: control-check
    action: script
    code: |
      let b = ctrl.banner;
      type_of(b) == "string"
        && ereg("^HTTP/1\\.[01] 200", b)
        && ereg("IP CAM Information", b) && ereg("CS-W50HD", b)
        && ereg("WiFi Mac Address", b) && ereg("Network type", b)
        && ereg("IP CAM ID", b)
    store_as: anycred

  # 2. Hardcoded login supervisor:dangerous (NASL request).
  - id: login
    action: tcp_connect
    port: "{{port}}"
    send: "GET /cgi-bin/info.cgi HTTP/1.0\r\nHost: {{target_host}}\r\nAuthorization: Basic c3VwZXJ2aXNvcjpkYW5nZXJvdXM=\r\n\r\n"
    store_as: login
    condition: "!anycred"
  - id: login-check
    action: script
    code: |
      let b = login.banner;
      type_of(b) == "string"
        && ereg("^HTTP/1\\.[01] 200", b)
        && ereg("IP CAM Information", b) && ereg("CS-W50HD", b)
        && ereg("WiFi Mac Address", b) && ereg("Network type", b)
        && ereg("IP CAM ID", b)
    store_as: loggedin
    condition: "!anycred"
  - id: detect-hardcoded
    action: match
    source: login.banner
    pattern: '(?s)^HTTP/1\.[01] 200\b.*IP CAM Information'
    condition: "!anycred && loggedin"
    on_match:
      finding:
        confidence_delta: 0.65
        qod: 97
        evidence: "Logged in to the PLANEX CS-W50HD web interface with the hardcoded credential supervisor/dangerous: GET /cgi-bin/info.cgi returned HTTP 200 with the authenticated IP CAM Information page (CS-W50HD, IP CAM ID, Network type, WiFi Mac Address), while a random account was refused."

View these feeds on GitHub