Schneider Modicon — 1 vulnerability check

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

← All products · Feeds on GitHub

Schneider Electric Quantum Ethernet Module Hardcoded FTP Credentials

CVECVE-2011-4859, CVE-2011-4860, CVE-2011-4861
Severitycritical · CVSS 10.0
Categorydefault-credentials — Default credentials
Servicesftp
Detectionset_var, tcp_dialogue, script, match · highest QoD 97
Feedtests/vulnerabilities/schneider-modicon/quantum-ethernet-ftp-hardcoded-credentials.yaml

Schneider Electric Ethernet modules for Modicon Quantum (140NOE771*, 140CPU65*), Premium (TSXETY*, TSXP57*), M340 (BMXNOE01*, BMXP3420*) and STB (NIC2212, NIP2*) ship fixed firmware accounts that open their FTP service. On an FTP server that greets with "220 FTP server ready" or a VxWorks banner, the check logs in with each known account (pcfactory, loader, ntpupdate, sysdiag, test, USER, webserver, fdrusers, nic2212, nimrohs2212, nip2212, ftpuser, noe77111_v500, AUTCSE, AUT_CSE, target; for the last four both the stored password hash and a password matching it) and sends the read-only SYST command. It is confirmed when a login is accepted (230), SYST answers with a VxWorks system type, and a second login with the same user and a random password is rejected. When that second login cannot run, the login is reported with lower confidence; when a random password is accepted as well, nothing is reported. Logging in gives read and write access to the module's flash file system, web pages and firmware.

How noctis detects it

  1. TCP dialogue: QUIT
  2. Parses / computes the next value with a Rhai script
  3. TCP dialogue: USER {{acct.user}}, PASS {{acct.pass}}, SYST, NOOP (+2 more)
  4. Checks login.transcript for (?m)^230[ -](?s:.*)^215[ -][^\n]*VxWorks
  5. Parses / computes the next value with a Rhai script
  6. Parses / computes the next value with a Rhai script
  7. TCP dialogue: USER {{hit_user}}, PASS {{ctl_pw}}, SYST, NOOP (+2 more)
  8. Parses / computes the next value with a Rhai script
  9. Checks hit_syst for VxWorks → finding QoD 97: FTP login accepted with the hardcoded Schneider Electric account …:…; SYST answered '…'. A login with the same user and a random password w…
  10. Checks hit_syst for VxWorks → finding QoD 75: FTP login accepted with the hardcoded Schneider Electric account …:…; SYST answered '…'. The random-password control login could not be com…

References:

Feed source — tests/vulnerabilities/schneider-modicon/quantum-ethernet-ftp-hardcoded-credentials.yaml
# Schneider Electric Quantum / Premium / M340 / STB Ethernet modules —
# hardcoded FTP accounts (CVE-2011-4859; tracked with CVE-2011-4860 and
# CVE-2011-4861, ICS-ALERT-11-346-01).
#
# The VxWorks firmware of the Ethernet modules (Quantum 140NOE771* / 140CPU65*,
# Premium TSXETY* / TSXP57*, M340 BMXNOE01* / BMXP3420*, STB NIC2212 / NIP2*)
# ships fixed accounts (pcfactory, loader, ntpupdate, sysdiag, test, USER,
# webserver, fdrusers, nic2212, nimrohs2212, nip2212, ftpuser, noe77111_v500,
# AUTCSE, AUT_CSE, target) that open the FTP, Telnet and Wind River debug
# services. FTP access gives read / write access to the module's flash file
# system, including web pages and firmware.
#
# Ported from OpenVAS/Greenbone NVT
# 2011/gb_schneider_quantum_ethernet_module_hardcoded_credentials_ftp_51046.nasl
# (OID 1.3.6.1.4.1.25623.1.0.103366, GPL-2.0-only): require "220 FTP server
# ready" in the greeting, then for each account log in over FTP and send SYST;
# report when the login works and the SYST reply names VxWorks.
#
# Deviations from the NASL (stronger detection, stated in the PR):
#   * Both USER accounts are tried. The NASL builds its list with make_array(),
#     where the second "USER" key overwrites the first, so USER:USER is never
#     sent.
#   * Four of the NASL's "passwords" (noe77111_v500, AUTCSE, AUT_CSE, target)
#     are the VxWorks loginDefaultEncrypt() hashes the firmware stores, which
#     never log in when sent as-is. A password hashing to each of them is
#     tried too (target:password is the well-known one).
#   * Greeting gate also accepts VxWorks-branded FTP greetings
#     ("220 VxWorks (5.4) FTP server ready"), not only the bare
#     "220 FTP server ready" of the NOE modules.
#   * Accept-any-password control: after a default login worked, the same user
#     logs in again with a random password. When that is accepted too
#     (honeypot, ftpd without login check), nothing is reported. Fail-closed:
#     QoD 97 needs a control that got a clean 530 rejection; a control that
#     could not run (2nd connection refused, no reply) keeps the finding at
#     QoD 75.
#   * Only CVE-2011-4859 (the hardcoded accounts) is proven, so the finding
#     names only that CVE. CVE-2011-4860 (fwupgrade password derived from the
#     MAC address) and CVE-2011-4861 (Modbus function code 125 firmware upload)
#     are not exercised: the second needs the MAC of the module and the third
#     would write firmware.
#
# Nothing is changed on the module: after login only SYST, NOOP and QUIT are
# sent. category: default-credentials so operators can exclude credential
# logins (a failed login can count toward a lockout).
uid: 5c0fc14f-3bc0-4af9-b5c9-be8f8128d946
name: "Schneider Electric Quantum Ethernet Module Hardcoded FTP Credentials (CVE-2011-4859)"
description: |
  Schneider Electric Ethernet modules for Modicon Quantum (140NOE771*,
  140CPU65*), Premium (TSXETY*, TSXP57*), M340 (BMXNOE01*, BMXP3420*) and STB
  (NIC2212, NIP2*) ship fixed firmware accounts that open their FTP service.
  On an FTP server that greets with "220 FTP server ready" or a VxWorks banner,
  the check logs in with each known account (pcfactory, loader, ntpupdate,
  sysdiag, test, USER, webserver, fdrusers, nic2212, nimrohs2212, nip2212,
  ftpuser, noe77111_v500, AUTCSE, AUT_CSE, target; for the last four both the
  stored password hash and a password matching it) and sends the read-only
  SYST command. It is confirmed when a login is accepted (230), SYST answers
  with a VxWorks system type, and a second login with the same user and a
  random password is rejected. When that second login cannot run, the login is
  reported with lower confidence; when a random password is accepted as well,
  nothing is reported. Logging in gives read and write access to the module's
  flash file system, web pages and firmware.
cves: [CVE-2011-4859, CVE-2011-4860, CVE-2011-4861]
cvss: 10.0
severity: critical
category: default-credentials
confidence_base: 0.30
tags: [schneider-electric, modicon, quantum, m340, ics, scada, plc, vxworks, ftp, default-credentials, hardcoded-credentials]
services: [ftp]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2011-4859"
  - "https://nvd.nist.gov/vuln/detail/CVE-2011-4860"
  - "https://nvd.nist.gov/vuln/detail/CVE-2011-4861"
  - "https://www.cisa.gov/news-events/ics-alerts/ics-alert-11-346-01"
  - "https://www.securityfocus.com/bid/51046"
  - "OpenVAS/Greenbone NASL 2011/gb_schneider_quantum_ethernet_module_hardcoded_credentials_ftp_51046.nasl (GPL-2.0-only)"

steps:
  # Pre-init everything the scripts and conditions read.
  - id: init-gate
    action: set_var
    var_name: gate
    var_value: false
  - id: init-hit
    action: set_var
    var_name: hit
    var_value: false
  - id: init-hit-user
    action: set_var
    var_name: hit_user
    var_value: ""
  - id: init-hit-pass
    action: set_var
    var_name: hit_pass
    var_value: ""
  - id: init-hit-syst
    action: set_var
    var_name: hit_syst
    var_value: ""
  - id: init-ctl-state
    action: set_var
    var_name: ctl_state
    var_value: "none"
  - id: init-greet
    action: set_var
    var_name: greet
    var_value: {transcript: ""}
  - id: init-ctl
    action: set_var
    var_name: ctl
    var_value: {transcript: ""}

  # 1. Greeting gate. QUIT's reply read also catches a greeting that missed
  #    the first read window.
  - id: greeting
    action: tcp_dialogue
    port: "{{port}}"
    read_banner: true
    timeout_secs: 10
    commands:
      - "QUIT"
    store_as: greet
  - id: gate-check
    action: script
    store_as: gate
    code: |
      let t = greet.transcript;
      type_of(t) == "string" && ereg("(?m)^220[ -](?:FTP server ready|.*(?i:vxworks))", t)

  # 2. One login per account (the loop groups the steps below it). Accounts
  #    after the first working one are skipped (`!hit`).
  - id: init-login
    action: set_var
    var_name: login
    var_value: {transcript: ""}
    loop:
      var: acct
      over:
        - {user: "pcfactory", pass: "pcfactory"}
        - {user: "loader", pass: "fwdownload"}
        - {user: "ntpupdate", pass: "ntpupdate"}
        - {user: "sysdiag", pass: "factorycast@schneider"}
        - {user: "test", pass: "testingpw"}
        - {user: "USER", pass: "USER"}
        - {user: "USER", pass: "USERUSER"}
        - {user: "webserver", pass: "webpages"}
        - {user: "fdrusers", pass: "sresurdf"}
        - {user: "nic2212", pass: "poiuypoiuy"}
        - {user: "nimrohs2212", pass: "qwertyqwerty"}
        - {user: "nip2212", pass: "fcsdfcsd"}
        - {user: "ftpuser", pass: "ftpuser"}
        - {user: "noe77111_v500", pass: "RcSyyebczS"}
        - {user: "AUTCSE", pass: "RybQRceeSd"}
        - {user: "AUT_CSE", pass: "cQdd9debez"}
        - {user: "target", pass: "RcQbRbzRyc"}
        # The four values above are VxWorks loginDefaultEncrypt() hashes as
        # stored by loginUserAdd(); the ftpd hashes what it receives, so the
        # hash string itself never logs in. These passwords hash to them.
        - {user: "noe77111_v500", pass: "djkURAgbzdUnxxsro"}
        - {user: "AUTCSE", pass: "HDqUokZmyzn"}
        - {user: "AUT_CSE", pass: "lJ4onaeLFogvawsvig"}
        - {user: "target", pass: "password"}
  # The NOOPs + QUIT give a slow module extra read windows: the transcript keeps
  # every reply, whichever command's read it arrived in.
  - id: login
    action: tcp_dialogue
    port: "{{port}}"
    condition: "gate == true && hit == false"
    read_banner: true
    timeout_secs: 10
    commands:
      - "USER {{acct.user}}"
      - "PASS {{acct.pass}}"
      - "SYST"
      - "NOOP"
      - "NOOP"
      - "QUIT"
    store_as: login
  # 230 = login accepted; 215 ... VxWorks = SYST answered by the module's
  # VxWorks ftpd (only sent after the login).
  - id: login-check
    action: match
    source: login.transcript
    pattern: '(?m)^230[ -](?s:.*)^215[ -][^\n]*VxWorks'
    condition: "gate == true && hit == false"
    on_match:
      set_vars:
        hit: true
        hit_user: "{{acct.user}}"
        hit_pass: "{{acct.pass}}"
  - id: login-syst
    action: script
    store_as: hit_syst
    condition: "hit == true && hit_syst == \"\""
    code: |
      chomp(egrep("^215[ -]", login.transcript))

  # 3. Control — same user, random password. A new loop (one item) so these
  #    steps run once, after the account loop.
  - id: ctl-password
    action: script
    store_as: ctl_pw
    condition: "hit == true"
    code: |
      "noctis" + rand_str(14)
    loop:
      var: once
      count: 1
  - id: ctl-login
    action: tcp_dialogue
    port: "{{port}}"
    condition: "hit == true"
    read_banner: true
    timeout_secs: 10
    commands:
      - "USER {{hit_user}}"
      - "PASS {{ctl_pw}}"
      - "SYST"
      - "NOOP"
      - "NOOP"
      - "QUIT"
    store_as: ctl
  # "rejected" only on a clean refusal: greeting seen, 530, no 230.
  # A 230 means the random password was accepted. Anything else = unknown.
  - id: ctl-check
    action: script
    store_as: ctl_state
    condition: "hit == true"
    code: |
      let t = ctl.transcript;
      if type_of(t) != "string" {
        "unknown"
      } else if ereg("(?m)^230[ -]", t) {
        "accepted"
      } else if ereg("(?m)^220[ -]", t) && ereg("(?m)^530[ -]", t) {
        "rejected"
      } else {
        "unknown"
      }

  # 4. Findings.
  - id: report-confirmed
    action: match
    source: hit_syst
    pattern: 'VxWorks'
    condition: "hit == true && ctl_state == \"rejected\""
    on_match:
      finding:
        cves: [CVE-2011-4859]
        confidence_delta: 0.65
        qod: 97
        evidence: "FTP login accepted with the hardcoded Schneider Electric account {{hit_user}}:{{hit_pass}}; SYST answered '{{hit_syst}}'. A login with the same user and a random password was rejected (530)."
  - id: report-unconfirmed-control
    action: match
    source: hit_syst
    pattern: 'VxWorks'
    condition: "hit == true && ctl_state == \"unknown\""
    on_match:
      finding:
        cves: [CVE-2011-4859]
        confidence_delta: 0.45
        qod: 75
        evidence: "FTP login accepted with the hardcoded Schneider Electric account {{hit_user}}:{{hit_pass}}; SYST answered '{{hit_syst}}'. The random-password control login could not be completed, so an accept-any FTP server is not ruled out."

View these feeds on GitHub