Lantronix — 2 vulnerability checks

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

← All products · Feeds on GitHub

Lantronix device server Telnet console without password

CVECVE-2018-12925
Severitycritical · CVSS 9.8
Categorydefault-credentials — Default credentials
Servicestelnet
Detectionset_var, tcp_open, sleep, tcp_send, script, tcp_close, match · highest QoD 97
Feedtests/vulnerabilities/lantronix/CVE-2018-12925.yaml

The Telnet console of a Lantronix device server (MSS, ETS, LRS, SCS and similar) opened its "Local>" command prompt for an arbitrary username without asking for any password, and ran the read-only SHOW SERVER command. An unauthenticated attacker on the network can reconfigure the device server and reach the serial equipment connected to it.

How noctis detects it

  1. Opens a persistent TCP/TLS socket
  2. Sends … on the open socket
  3. Parses / computes the next value with a Rhai script
  4. Parses / computes the next value with a Rhai script
  5. Sends {{tn_user}} on the open socket
  6. Sends SHOW SERVER on the open socket
  7. Sends on the open socket
  8. Sends LOGOUT on the open socket
  9. Parses / computes the next value with a Rhai script
  10. Parses / computes the next value with a Rhai script
  11. Parses / computes the next value with a Rhai script
  12. Checks tn_out for Hardware Addr → finding QoD 97: Lantronix device server Telnet console without password (CVE-2018-12925)
  13. Checks tn_out for Local[^\s>]*> → finding QoD 75: Lantronix device server Telnet console without password (CVE-2018-12925)

References:

Feed source — tests/vulnerabilities/lantronix/CVE-2018-12925.yaml
# Lantronix device servers (MSS / ETS / LRS / SCS…) — Telnet console open
# without any password (CVE-2018-12925).
#
# Ported from OpenVAS/Greenbone NVT
# 2018/lantronix/gb_lantronix_device_auth_bypass.nasl
# (OID 1.3.6.1.4.1.25623.1.0.107328, GPL-2.0-only): require the Lantronix
# greeting ("prompt for assistance" + "Username>"), send the username "login"
# and require the "Local_N>" command prompt in the reply. Here the console is
# then asked for the read-only `SHOW SERVER` table and its "Hardware Addr:" /
# "Name/Nodenum:" fields are required — output of a real console command,
# never in what we send.
#
# Deviations from the NASL (stronger detection, documented in the PR):
#   * Real command output (`SHOW SERVER`) proves the shell, not only a prompt —
#     also when the prompt was renamed on the device (no "Local" in it).
#   * The prompt is matched at the start of a line in the reply to the
#     username only — the greeting itself already quotes "'Local_N> '", which
#     must never count as a login.
#   * A console whose prompt is configured as plain "Local>" (the MSS manual's
#     default) is recognised too; the NASL's "Local_.+>" misses it.
#   * Late greeting: a console that greets after the first 500 ms read is still
#     recognised (wait, then read again) instead of being skipped.
#   * Fallback (QoD 75) when the prompt appears but the `SHOW SERVER` output
#     does not come back (the NASL's own level of proof).
#
# No random-username control: on these consoles the username is only an
# identifier and any value opens the prompt when no password is set, so a
# control would suppress true positives. Read-only: `SHOW SERVER` only prints
# the server table; nothing is changed on the device. category:
# default-credentials (a login to a factory-default, password-less account) so
# operators can exclude credential logins.
uid: 46219f55-d521-4a9e-96a5-497627bba41e
name: "Lantronix device server Telnet console without password (CVE-2018-12925)"
description: |
  The Telnet console of a Lantronix device server (MSS, ETS, LRS, SCS and
  similar) opened its "Local>" command prompt for an arbitrary username without
  asking for any password, and ran the read-only SHOW SERVER command. An
  unauthenticated attacker on the network can reconfigure the device server and
  reach the serial equipment connected to it.
cves: [CVE-2018-12925]
cvss: 9.8
severity: critical
category: default-credentials
confidence_base: 0.30
tags: [lantronix, mss, device-server, serial-to-ethernet, iot, ics, telnet, default-credentials, intrusive]
services: [telnet]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2018-12925"
  - "https://ts.lantronix.com/faqs/1195/Example.htm"

vars:
  tn_user: "login"

steps:
  # ---------------------------------------------------------------- set-up
  - id: init-gate
    action: set_var
    var_name: gate
    var_value: false

  - id: init-login-ok
    action: set_var
    var_name: login_ok
    var_value: false

  - id: init-show-ok
    action: set_var
    var_name: show_ok
    var_value: false

  - id: init-late
    action: set_var
    var_name: late
    var_value: {response: ""}

  # ------------------------------------------------------ greeting / gate
  - id: open
    action: tcp_open
    handle: tn
    port: "{{port}}"
    read_banner: true
    timeout_secs: 10
    store_as: conn

  # No "Username>" in the first read: wait and read again (a zero-byte write
  # only triggers the read).
  - id: late-banner-wait
    action: sleep
    condition: "conn.connected == true && (type_of(conn.banner) != \"string\" || strstr(conn.banner, \"Username>\") == \"\")"
    duration_ms: 3000

  - id: late-banner
    action: tcp_send
    handle: tn
    condition: "conn.connected == true && (type_of(conn.banner) != \"string\" || strstr(conn.banner, \"Username>\") == \"\")"
    send: ""
    timeout_secs: 10
    store_as: late

  - id: greeting
    action: script
    condition: "conn.connected == true"
    store_as: greet
    code: |
      let g = "";
      if type_of(conn.banner) == "string" { g += conn.banner; }
      if type_of(late.response) == "string" { g += late.response; }
      g

  - id: gate-check
    action: script
    condition: "conn.connected == true"
    store_as: gate
    code: |
      strstr(tolower(greet), "prompt for assistance") != "" && strstr(greet, "Username>") != ""

  # ------------------------------------------------ username, no password
  - id: send-user
    action: tcp_send
    handle: tn
    condition: "gate == true"
    send: "{{tn_user}}\r\n"
    timeout_secs: 10
    store_as: r_user

  - id: wait-prompt
    action: sleep
    condition: "gate == true"
    duration_ms: 1500

  # --------------------------------------------- read-only `SHOW SERVER`
  - id: send-cmd
    action: tcp_send
    handle: tn
    condition: "gate == true"
    send: "SHOW SERVER\r\n"
    timeout_secs: 10
    store_as: r_cmd

  - id: wait-output
    action: sleep
    condition: "gate == true"
    duration_ms: 1500

  # An empty line flushes whatever the console printed after the previous read.
  - id: flush
    action: tcp_send
    handle: tn
    condition: "gate == true"
    send: "\r\n"
    timeout_secs: 10
    store_as: r_tail

  - id: logout
    action: tcp_send
    handle: tn
    condition: "gate == true"
    send: "LOGOUT\r\n"
    timeout_secs: 2

  - id: close
    action: tcp_close
    handle: tn

  # Everything received after the username (the greeting is left out: it
  # quotes the prompt itself).
  - id: collect
    action: script
    condition: "gate == true"
    store_as: tn_out
    code: |
      let out = "";
      for r in [r_user, r_cmd, r_tail] {
        if type_of(r.response) == "string" { out += r.response + "\n"; }
      }
      out

  # "Local>" / "Local_2>" / "Local_34>" at the start of a line.
  - id: check-login
    action: script
    condition: "gate == true"
    store_as: login_ok
    code: |
      ereg("(^|[\\r\\n])Local(_[^\\s>]+)?>", tn_out)

  # Independent of the prompt check: a device whose prompt was renamed
  # (e.g. "MSS_1>") still proves access with the SHOW SERVER table.
  - id: check-show
    action: script
    condition: "gate == true"
    store_as: show_ok
    code: |
      strstr(tn_out, "Hardware Addr") != "" && strstr(tn_out, "Name/Nodenum") != ""

  # ---------------------------------------------------------------- findings
  - id: finding-show-server
    action: match
    source: tn_out
    pattern: "Hardware Addr"
    condition: "show_ok == true"
    on_match:
      finding:
        title: "Lantronix device server Telnet console without password (CVE-2018-12925)"
        description: "The Lantronix Telnet console opened its command prompt for the username '{{tn_user}}' without asking for any password and ran the read-only SHOW SERVER command."
        remediation: "Enable the login password on the Lantronix device server (SET/DEFINE SERVER INCOMING PASSWORD and a strong LOGIN PASSWORD), disable incoming Telnet if unused, and restrict the console ports to a management network."
        confidence_delta: 0.65
        qod: 97
        evidence: "Username '{{tn_user}}' accepted without password; SHOW SERVER output: {{tn_out}}"
      stop: true

  # Prompt after the username, SHOW SERVER output not captured.
  - id: finding-prompt
    action: match
    source: tn_out
    pattern: "Local[^\\s>]*>"
    condition: "login_ok == true && show_ok == false"
    on_match:
      finding:
        title: "Lantronix device server Telnet console without password (CVE-2018-12925)"
        description: "The Lantronix Telnet console showed its command prompt after the username '{{tn_user}}' without asking for any password. The SHOW SERVER output was not captured."
        remediation: "Enable the login password on the Lantronix device server (SET/DEFINE SERVER INCOMING PASSWORD and a strong LOGIN PASSWORD), disable incoming Telnet if unused, and restrict the console ports to a management network."
        confidence_delta: 0.50
        qod: 75
        evidence: "Username '{{tn_user}}' accepted without password, command prompt shown: {{tn_out}}"

Lantronix device server Telnet default privileged password 'system'

CVECVE-2018-14018
Severitycritical · CVSS 10.0
Categorydefault-credentials — Default credentials
Servicestelnet
Detectionset_var, script, tcp_open, sleep, tcp_send, tcp_close, match · highest QoD 97
Feedtests/vulnerabilities/lantronix/CVE-2018-14018.yaml

The Telnet console of a Lantronix device server granted the privileged ("Local_N>>") prompt for the factory privileged password "system", while a random password was refused. An unauthenticated attacker on the network gets full administrator control of the device server and of the serial equipment connected to it.

How noctis detects it

  1. Parses / computes the next value with a Rhai script
  2. Opens a persistent TCP/TLS socket
  3. Sends … on the open socket
  4. Parses / computes the next value with a Rhai script
  5. Sends {{lx_user}} on the open socket
  6. Sends set privileged on the open socket
  7. Sends {{lx_pass}} on the open socket
  8. Sends on the open socket
  9. Sends logout on the open socket
  10. Parses / computes the next value with a Rhai script
  11. Parses / computes the next value with a Rhai script
  12. Opens a persistent TCP/TLS socket
  13. Sends {{lx_user}} on the open socket
  14. Sends set privileged on the open socket
  15. … and 8 more steps — see the feed source below

References:

Feed source — tests/vulnerabilities/lantronix/CVE-2018-14018.yaml
# Lantronix device servers — Telnet console factory privileged password
# "system" (CVE-2018-14018).
#
# Lantronix device servers (MSS / ETS / LRS / UDS ...) expose a Telnet "Local>"
# console. Its greeting says "Type HELP at the 'Local_2> ' prompt for
# assistance." and asks "Username> " (any name is accepted, it is not
# authenticated). `set privileged` asks "Password> "; with the factory password
# "system" the prompt becomes "Local_2>> " — the ">>" marks full administrator
# rights over the device and the serial equipment behind it.
#
# Ported from OpenVAS/Greenbone NVT
# 2018/lantronix/gb_lantronix_device_default_credentials.nasl
# (OID 1.3.6.1.4.1.25623.1.0.107329, GPL-2.0-only): require "prompt for
# assistance" + "Username>" in the greeting, send "root", expect "Local_.+>",
# send "set privileged", expect "Password>", send "system" and require the
# "Local_.+>>" privileged prompt.
#
# Deviations from the NASL (stronger detection, documented in the PR):
#   * Accept-any-password guard: after the privileged login worked, a second
#     session tries `set privileged` with a random password; when that also
#     yields ">>" (honeypot / broken console) the feed reports nothing. When the
#     control cannot be completed (second session refused), the login is still
#     reported, at QoD 75 instead of 97.
#   * Late greeting: a console that greets after the first 500 ms read is still
#     recognised (wait, then read again) instead of being skipped.
#   * Each session ends with `logout` so no console port stays held open.
#
# The privileged prompt itself is the post-login proof: it only appears once the
# device accepted the password. Nothing is changed on the device (no `define`
# / `save` command is sent). One wrong-password attempt (the control) is made
# only after the default password already worked. category: default-credentials
# so operators can exclude credential logins.
uid: cf2dfe8a-5bad-4c3c-a61c-be1113a905ed
name: "Lantronix device server Telnet default privileged password 'system' (CVE-2018-14018)"
description: |
  The Telnet console of a Lantronix device server granted the privileged
  ("Local_N>>") prompt for the factory privileged password "system", while a
  random password was refused. An unauthenticated attacker on the network gets
  full administrator control of the device server and of the serial equipment
  connected to it.
cves: [CVE-2018-14018]
cvss: 10.0
severity: critical
category: default-credentials
confidence_base: 0.30
tags: [lantronix, device-server, serial, iot, telnet, default-credentials, intrusive]
services: [telnet]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2018-14018"

vars:
  lx_user: "root"
  lx_pass: "system"

steps:
  # ---------------------------------------------------------------- set-up
  - id: init-gate
    action: set_var
    var_name: gate
    var_value: false

  - id: init-priv
    action: set_var
    var_name: priv
    var_value: false

  - id: init-ctl-priv
    action: set_var
    var_name: ctl_priv
    var_value: false

  - id: init-ctl-ran
    action: set_var
    var_name: ctl_ran
    var_value: false

  - id: init-late
    action: set_var
    var_name: late
    var_value: {response: ""}

  # Random control password — never "system".
  - id: control-password
    action: script
    store_as: ctl_pw
    code: |
      "noctis" + rand_str(14)

  # ------------------------------------------------------ greeting / gate
  - id: open
    action: tcp_open
    handle: lx
    port: "{{port}}"
    read_banner: true
    timeout_secs: 10
    store_as: conn

  # No "Username>" prompt in the first read (nothing, or only the IAC
  # negotiation): wait and read again (a zero-byte write only triggers a read).
  - id: late-banner-wait
    action: sleep
    condition: "conn.connected == true && (type_of(conn.banner) != \"string\" || strstr(conn.banner, \"Username>\") == \"\")"
    duration_ms: 3000

  - id: late-banner
    action: tcp_send
    handle: lx
    condition: "conn.connected == true && (type_of(conn.banner) != \"string\" || strstr(conn.banner, \"Username>\") == \"\")"
    send: ""
    timeout_secs: 10
    store_as: late

  - id: gate-check
    action: script
    condition: "conn.connected == true"
    store_as: gate
    code: |
      let g = "";
      if type_of(conn.banner) == "string" { g += conn.banner; }
      if type_of(late.response) == "string" { g += late.response; }
      strstr(g, "prompt for assistance") != "" && strstr(g, "Username>") != ""

  # ------------------------------------------- default privileged password
  - id: send-user
    action: tcp_send
    handle: lx
    condition: "gate == true"
    send: "{{lx_user}}\r\n"
    timeout_secs: 10
    store_as: r_user

  - id: wait-local-prompt
    action: sleep
    condition: "gate == true"
    duration_ms: 1000

  - id: send-set-priv
    action: tcp_send
    handle: lx
    condition: "gate == true"
    send: "set privileged\r\n"
    timeout_secs: 10
    store_as: r_set

  - id: wait-password-prompt
    action: sleep
    condition: "gate == true"
    duration_ms: 1000

  # Like the NASL: password, then an empty line that redraws the prompt.
  - id: send-pass
    action: tcp_send
    handle: lx
    condition: "gate == true"
    send: "{{lx_pass}}\r\n\r\n"
    timeout_secs: 10
    store_as: r_pass

  - id: wait-prompt
    action: sleep
    condition: "gate == true"
    duration_ms: 1000

  - id: flush
    action: tcp_send
    handle: lx
    condition: "gate == true"
    send: "\r\n"
    timeout_secs: 10
    store_as: r_tail

  - id: logout
    action: tcp_send
    handle: lx
    condition: "gate == true"
    send: "logout\r\n"
    timeout_secs: 5

  - id: close
    action: tcp_close
    handle: lx

  - id: collect
    action: script
    condition: "gate == true"
    store_as: lx_out
    code: |
      let out = "";
      for r in [r_user, r_set, r_pass, r_tail] {
        if type_of(r.response) == "string" { out += r.response; }
      }
      out

  # NASL markers in order: unprivileged "Local_..>" prompt, "Password>" prompt,
  # then the privileged "Local_..>>" prompt. The password is not echoed and
  # nothing we type contains ">>", so only the device can produce it.
  - id: check-priv
    action: script
    condition: "gate == true"
    store_as: priv
    code: |
      ereg("Local_[^\r\n]*>", lx_out)
        && strstr(lx_out, "Password>") != ""
        && ereg("Local_[^\r\n>]*>>", lx_out)

  # ---------------------------------------- control: random password
  # Only when the default password worked, to rule out a console that grants
  # ">>" for any password.
  - id: ctl-open
    action: tcp_open
    handle: ctl
    port: "{{port}}"
    condition: "priv == true"
    read_banner: true
    timeout_secs: 10
    store_as: ctl_conn

  - id: ctl-user
    action: tcp_send
    handle: ctl
    condition: "priv == true"
    send: "{{lx_user}}\r\n"
    timeout_secs: 10
    store_as: c_user

  - id: ctl-wait-local-prompt
    action: sleep
    condition: "priv == true"
    duration_ms: 1000

  - id: ctl-set-priv
    action: tcp_send
    handle: ctl
    condition: "priv == true"
    send: "set privileged\r\n"
    timeout_secs: 10
    store_as: c_set

  - id: ctl-wait-password-prompt
    action: sleep
    condition: "priv == true"
    duration_ms: 1000

  - id: ctl-pass
    action: tcp_send
    handle: ctl
    condition: "priv == true"
    send: "{{ctl_pw}}\r\n\r\n"
    timeout_secs: 10
    store_as: c_pass

  - id: ctl-wait-prompt
    action: sleep
    condition: "priv == true"
    duration_ms: 1000

  - id: ctl-flush
    action: tcp_send
    handle: ctl
    condition: "priv == true"
    send: "\r\n"
    timeout_secs: 10
    store_as: c_tail

  - id: ctl-logout
    action: tcp_send
    handle: ctl
    condition: "priv == true"
    send: "logout\r\n"
    timeout_secs: 5

  - id: ctl-close
    action: tcp_close
    handle: ctl

  - id: ctl-collect
    action: script
    condition: "priv == true"
    store_as: ctl_out
    code: |
      let out = "";
      for r in [c_user, c_set, c_pass, c_tail] {
        if type_of(r.response) == "string" { out += r.response; }
      }
      out

  - id: ctl-check
    action: script
    condition: "priv == true"
    store_as: ctl_priv
    code: |
      ereg("Local_[^\r\n>]*>>", ctl_out)

  # The control only counts when it really reached the password prompt (a
  # console that refused the second session proves nothing either way).
  - id: ctl-ran
    action: script
    condition: "priv == true"
    store_as: ctl_ran
    code: |
      strstr(ctl_out, "Password>") != ""

  # ---------------------------------------------------------------- finding
  - id: finding-priv
    action: match
    source: lx_out
    pattern: "Local_[^\\r\\n>]*>>"
    condition: "priv == true && ctl_ran == true && ctl_priv == false"
    on_match:
      finding:
        title: "Lantronix device server Telnet default privileged password 'system' (CVE-2018-14018)"
        description: "The Lantronix Telnet console accepted `set privileged` with the factory password '{{lx_pass}}' (user '{{lx_user}}') and showed the privileged 'Local_N>>' prompt, while a random password was refused. This grants unrestricted administrator access to the device server."
        remediation: "Change the privileged password of the Lantronix device server (`set privileged password` / `define server privileged password`), disable Telnet or restrict it to a management network, and update the firmware."
        confidence_delta: 0.65
        qod: 97
        evidence: "Telnet `set privileged` with the default password gave the privileged '>>' prompt: {{lx_out}}"
      stop: true

  # The default password gave ">>" but the random-password control could not
  # be completed (second session refused / no password prompt): same login
  # evidence, without the accept-any-password guard.
  - id: finding-priv-unconfirmed
    action: match
    source: lx_out
    pattern: "Local_[^\\r\\n>]*>>"
    condition: "priv == true && ctl_ran == false"
    on_match:
      finding:
        title: "Lantronix device server Telnet default privileged password 'system' (CVE-2018-14018)"
        description: "The Lantronix Telnet console accepted `set privileged` with the factory password '{{lx_pass}}' (user '{{lx_user}}') and showed the privileged 'Local_N>>' prompt. The random-password control session could not be completed, so an accept-any-password console is not ruled out."
        remediation: "Change the privileged password of the Lantronix device server (`set privileged password` / `define server privileged password`), disable Telnet or restrict it to a management network, and update the firmware."
        confidence_delta: 0.45
        qod: 75
        evidence: "Telnet `set privileged` with the default password gave the privileged '>>' prompt (control not completed): {{lx_out}}"

View these feeds on GitHub