Sunny WebBox — 1 vulnerability check

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

← All products · Feeds on GitHub

SMA Sunny WebBox Hard-Coded Credentials (HTTP)

CVECVE-2015-3964
Severitycritical · CVSS 10.0
Categorydefault-credentials — Default credentials
Serviceshttp, https
Detectionset_var, script, tcp_connect, match · highest QoD 97
Feedtests/vulnerabilities/sunny-webbox/CVE-2015-3964.yaml

SMA Sunny WebBox photovoltaic data loggers accept hard-coded web passwords that the owner cannot change or disable (CVE-2015-3964): 0000 for the User level and 1111 for the Installer level. The check posts each pair to the login form (/culture/login) and confirms the login when the reply is the authenticated plant page (Sunny WebBox / My Plant frames with a Logout link and the Settings, Spot Values or Updates menu). A login with a random password is sent first and must be refused, so a finding proves the hard-coded password. With it, an attacker can read plant data and, at the Installer level, change the inverter and WebBox settings.

How noctis detects it

  1. Parses / computes the next value with a Rhai script
  2. Raw TCP (TLS on HTTPS), sent verbatim: {{ctrl_req}}
  3. Parses / computes the next value with a Rhai script
  4. Parses / computes the next value with a Rhai script
  5. Parses / computes the next value with a Rhai script
  6. Parses / computes the next value with a Rhai script
  7. Raw TCP (TLS on HTTPS), sent verbatim: {{login_req}}
  8. Parses / computes the next value with a Rhai script
  9. Checks login.banner for Logout → finding QoD 97: SMA Sunny WebBox hard-coded credentials …/…
  10. Checks login.banner for Logout → finding QoD 75: SMA Sunny WebBox hard-coded credentials …/…

References:

Feed source — tests/vulnerabilities/sunny-webbox/CVE-2015-3964.yaml
# SMA Sunny WebBox — hard-coded web accounts User/0000 and Installer/1111
# (CVE-2015-3964, ICS advisory ICSA-15-181-02A).
#
# Ported from OpenVAS/Greenbone NVT 2016/gb_sunny_webbox_hard_coded_account_vuln.nasl
# (OID 1.3.6.1.4.1.25623.1.0.808204, GPL-2.0-only):
#   POST /culture/login with the body "LangEN&Userlevels=<user>&password=<pass>"
#   for User:0000 then Installer:1111; the login worked when the reply is
#   HTTP 200 and carries 'name="Sunny WebBox', 'Logout', 'name="My Plant' and
#   one of 'title="Settings', 'title="Spot Values', 'title="Updates' — the
#   post-login plant page. Reading it is a read-only proof.
#
# Deviations from the NASL (stronger detection, stated in the PR):
#   * Accept-any-password control: before the hard-coded logins, the same
#     login is sent for the User level with a random password. If that already
#     returns the post-login page, the box does not check passwords (page open
#     to anyone, honeypot, broken auth) and the feed reports nothing — the
#     NASL would report User:0000.
#   * When the control request gets no HTTP reply at all, a matching login is
#     still reported, but at QoD 75 instead of 97 (fail-closed control).
#   * Content-Type: application/x-www-form-urlencoded and a User-Agent are added
#     to the NASL request (HTTP/1.0 so the reply is read to EOF); the body is
#     unchanged. The hard-coded passwords cannot be changed or disabled per
#     ICSA-15-181-02A.
#   * The NASL only runs once its product detection has set the WebBox CPE;
#     here the product-specific post-login markers plus the control replace
#     that gate.
#
# NVD scores CVE-2015-3964 with CVSS v2 10.0 only (no v3 vector). Nothing is
# changed on the device.
uid: 38598710-2e9e-4821-8796-f606ba41f84b
name: "SMA Sunny WebBox Hard-Coded Credentials (HTTP)"
description: |
  SMA Sunny WebBox photovoltaic data loggers accept hard-coded web passwords
  that the owner cannot change or disable (CVE-2015-3964): 0000 for the User
  level and 1111 for the Installer level. The check posts each pair to the
  login form (/culture/login) and confirms the login when the reply is the
  authenticated plant page (Sunny WebBox / My Plant frames with a Logout link
  and the Settings, Spot Values or Updates menu). A login with a random
  password is sent first and must be refused, so a finding proves the
  hard-coded password. With it, an attacker can read plant data and, at the
  Installer level, change the inverter and WebBox settings.
cves: [CVE-2015-3964]
cvss: 10.0
severity: critical
category: default-credentials
confidence_base: 0.30
tags: [openvas-migrated, sma, sunny-webbox, solar, ics, scada, hardcoded-credentials, default-credentials, http]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2015-3964"
  - "https://www.cisa.gov/news-events/ics-advisories/icsa-15-181-02a"
  - "OpenVAS/Greenbone NASL 2016/gb_sunny_webbox_hard_coded_account_vuln.nasl (GPL-2.0-only)"

steps:
  - id: init-anycred
    action: set_var
    var_name: anycred
    var_value: false
  - id: init-ctrl-ok
    action: set_var
    var_name: ctrl_ok
    var_value: false
  # Pre-init the stored result the control script reads, so the script never
  # sees an undefined variable when the control request fails.
  - id: init-ctrl
    action: set_var
    var_name: ctrl
    var_value: {banner: null}

  # 1. Control — a random User-level password must not open the plant page.
  - id: control-req
    action: script
    store_as: ctrl_req
    code: |
      let body = "LangEN&Userlevels=User&password=n" + rand_hex(7);
      "POST /culture/login HTTP/1.0\r\nHost: " + target_host + "\r\n"
        + "User-Agent: Mozilla/5.0 (noctis)\r\n"
        + "Content-Type: application/x-www-form-urlencoded\r\n"
        + "Content-Length: " + strlen(body) + "\r\n\r\n" + body
  - id: control
    action: tcp_connect
    port: "{{port}}"
    send: "{{ctrl_req}}"
    store_as: ctrl
  - id: control-check
    action: script
    store_as: ctrl_state
    code: |
      let b = ctrl.banner;
      let answered = type_of(b) == "string" && ereg("^HTTP/1\\.[01] [0-9]{3}", b);
      let open = answered
        && ereg("^HTTP/1\\.[01] 200", b)
        && ereg("name=\"Sunny WebBox", b) && ereg("Logout", b) && ereg("name=\"My Plant", b)
        && ereg("title=\"(Settings|Spot Values|Updates)", b);
      #{ answered: answered, open: open }
  - id: control-flags
    action: script
    store_as: anycred
    code: 'ctrl_state.open'
  - id: control-answered
    action: script
    store_as: ctrl_ok
    code: 'ctrl_state.answered'

  # 2. Hard-coded logins (NASL order). The group below runs once per account;
  #    a finding stops the loop.
  - id: init-login
    action: set_var
    loop:
      over:
        - {user: "User", pass: "0000"}
        - {user: "Installer", pass: "1111"}
      var: acct
    var_name: login
    var_value: {banner: null}
  - id: login-req
    action: script
    store_as: login_req
    condition: "!anycred"
    code: |
      let body = "LangEN&Userlevels=" + acct.user + "&password=" + acct.pass;
      "POST /culture/login HTTP/1.0\r\nHost: " + target_host + "\r\n"
        + "User-Agent: Mozilla/5.0 (noctis)\r\n"
        + "Content-Type: application/x-www-form-urlencoded\r\n"
        + "Content-Length: " + strlen(body) + "\r\n\r\n" + body
  - id: login
    action: tcp_connect
    port: "{{port}}"
    send: "{{login_req}}"
    store_as: login
    condition: "!anycred"
  - id: login-check
    action: script
    store_as: login_ok
    code: |
      let b = login.banner;
      !anycred && type_of(b) == "string"
        && ereg("^HTTP/1\\.[01] 200", b)
        && ereg("name=\"Sunny WebBox", b) && ereg("Logout", b) && ereg("name=\"My Plant", b)
        && ereg("title=\"(Settings|Spot Values|Updates)", b)
  - id: finding-confirmed
    action: match
    source: login.banner
    pattern: "Logout"
    condition: "login_ok == true && ctrl_ok == true"
    on_match:
      finding:
        title: "SMA Sunny WebBox hard-coded credentials {{acct.user}}/{{acct.pass}}"
        description: "The Sunny WebBox web interface logged in the {{acct.user}} level with the hard-coded password {{acct.pass}} and returned the authenticated plant page, while a random password for the User level was refused (CVE-2015-3964). The hard-coded passwords cannot be changed or disabled."
        remediation: "SMA published no firmware fix for this product. Do not expose the WebBox to untrusted networks: remove port forwarding to it and reach it only through a VPN, or replace it with a supported data logger."
        confidence_delta: 0.65
        qod: 97
        evidence: "POST /culture/login as {{acct.user}}/{{acct.pass}} returned HTTP 200 with the post-login plant page (Sunny WebBox / My Plant frames, Logout link); a random User password was refused."
      stop: true

  # The control got no HTTP reply at all: an accept-any-password box cannot be
  # ruled out, so the login is reported at a lower QoD.
  - id: finding-control-unknown
    action: match
    source: login.banner
    pattern: "Logout"
    condition: "login_ok == true && ctrl_ok == false"
    on_match:
      finding:
        title: "SMA Sunny WebBox hard-coded credentials {{acct.user}}/{{acct.pass}}"
        description: "The Sunny WebBox web interface logged in the {{acct.user}} level with the hard-coded password {{acct.pass}} and returned the authenticated plant page (CVE-2015-3964). The control login with a random password got no reply, so a box that accepts any password could not be ruled out."
        remediation: "SMA published no firmware fix for this product. Do not expose the WebBox to untrusted networks: remove port forwarding to it and reach it only through a VPN, or replace it with a supported data logger."
        confidence_delta: 0.50
        qod: 75
        evidence: "POST /culture/login as {{acct.user}}/{{acct.pass}} returned HTTP 200 with the post-login plant page (Sunny WebBox / My Plant frames, Logout link); the random-password control got no HTTP reply."
      stop: true

View these feeds on GitHub