scrutinizer — 2 vulnerability checks

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

← All products · Feeds on GitHub

Plixer Scrutinizer < 9.5.0 unauthenticated file upload via /d4d/uploader.php

CVECVE-2012-2627, CVE-2012-2626, CVE-2012-3848
Severitycritical · CVSS 9.4
Categoryrce — Remote code execution
Serviceshttp, https
Detectionscript, set_var, http_request, match · highest QoD 75
Feedtests/vulnerabilities/scrutinizer/scrutinizer-uploader-file-upload.yaml

Plixer (Dell SonicWALL) Scrutinizer NetFlow & sFlow Analyzer before 9.5.0 lets anyone upload files through /d4d/uploader.php without logging in. The file is written under the name chosen by the client into the snmp\mibs folder of the installation, next to the SNMP configuration files that an attacker can thereby overwrite. The test uploads a short text file under a random per-run name (noctis_<random>.txt) and reports the host when the server answers that the upload succeeded for exactly that file name. The uploaded file is not reachable over HTTP and therefore stays on the target: it only contains a line identifying it as a scanner test file and can be deleted safely. Versions before 9.5.0 are also affected by an administrative authentication bypass and by cross-site scripting fixed in the same release.

How noctis detects it

  1. Parses / computes the next value with a Rhai script
  2. HTTP(S) request POST /d4d/uploader.php with a crafted body
  3. Checks up.body for "success"\s*:\s*1 → finding QoD 75: Scrutinizer /d4d/uploader.php accepted an unauthenticated multipart upload of … and answered "success":1 with that file name (file written …

References:

Feed source — tests/vulnerabilities/scrutinizer/scrutinizer-uploader-file-upload.yaml
# Plixer / Dell SonicWALL Scrutinizer < 9.5.0 — unauthenticated file upload via
# /d4d/uploader.php (CVE-2012-2627; Trustwave TWSL2012-014 finding 2).
#
# /d4d/uploader.php stores the "uploadedfile" multipart part under the file name
# the client chooses, in <install>\snmp\mibs\, without any session check, and
# answers {"success":1,"file_name":"<name>"}. The same folder holds the SNMP
# configuration files, which an attacker can overwrite by picking their name.
#
# Detection (the advisory's / NASL's request, benign):
#   - upload a short text file under a per-run random name
#     (noctis_<32 hex>.txt — it can never collide with an existing MIB/config
#     file) whose content says it is a scanner test file;
#   - the reply must carry "success":1 AND "file_name":"<that random name>"
#     → QoD 75. The uploaded file is not reachable over HTTP, so it cannot be
#     read back or removed: one small text file is left in snmp\mibs.
#
# Deviations from the NASL (improvements):
#   - the NASL accepts '"success":1' anywhere plus the file name anywhere in
#     the raw reply (headers included); the feed requires the JSON keys
#     "success":1 and "file_name":"<random name>" in the body, so an error page
#     that merely echoes the request cannot match;
#   - the random name is 32 hex characters instead of the NASL's short
#     lowercase string, so a canned/static success reply cannot match either
#     (proven by the mock's "blanket" mode);
#   - well-formed multipart body (the NASL hard-codes a Content-Length and
#     sends a stray blank line before the first boundary).
#
# CVEs: the probe proves CVE-2012-2627. CVE-2012-2626 (admin.cgi auth bypass)
# and CVE-2012-3848 (d4d XSS) were fixed in the same release (9.5.0), so a
# vulnerable uploader implies them too; they stay on the finding, as in the
# source check. Proving CVE-2012-2626 directly would create an admin account,
# so it is not probed. CVSS: NVD v2 9.4 (CVE-2012-2627, no v3 on NVD).
#
# Ported from OpenVAS/Greenbone NASL 2012/gb_scrutinizer_54726.nasl
# (OID 1.3.6.1.4.1.25623.1.0.103528, GPL-2.0-only).
uid: 44ccf33f-a5b5-4eb2-9466-e78be1552de1
name: "Plixer Scrutinizer < 9.5.0 unauthenticated file upload via /d4d/uploader.php"
description: |
  Plixer (Dell SonicWALL) Scrutinizer NetFlow & sFlow Analyzer before 9.5.0
  lets anyone upload files through /d4d/uploader.php without logging in. The
  file is written under the name chosen by the client into the snmp\mibs
  folder of the installation, next to the SNMP configuration files that an
  attacker can thereby overwrite. The test uploads a short text file under a
  random per-run name (noctis_<random>.txt) and reports the host when the
  server answers that the upload succeeded for exactly that file name. The
  uploaded file is not reachable over HTTP and therefore stays on the target:
  it only contains a line identifying it as a scanner test file and can be
  deleted safely. Versions before 9.5.0 are also affected by an administrative
  authentication bypass and by cross-site scripting fixed in the same release.
category: rce
cves: [CVE-2012-2627, CVE-2012-2626, CVE-2012-3848]
cvss: 9.4
severity: critical
confidence_base: 0.30
tags: [scrutinizer, plixer, sonicwall, netflow, file-upload, unauthenticated, intrusive]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2012-2627"
  - "https://nvd.nist.gov/vuln/detail/CVE-2012-2626"
  - "https://nvd.nist.gov/vuln/detail/CVE-2012-3848"
  - "https://seclists.org/fulldisclosure/2012/Jul/360"
  - "https://www.exploit-db.com/exploits/37548"
  - "https://www.securityfocus.com/bid/54726"

steps:
  # Per-run random file name and multipart boundary.
  - id: gen-proof
    action: script
    code: |
      let tok = rand_hex(16);
      #{ tok: tok, name: "noctis_" + tok + ".txt" }
    store_as: proof

  # Pre-init so the confirm condition never reads an undefined variable when
  # the request fails (connection refused / TLS error).
  - id: init-up
    action: set_var
    var_name: up
    var_value: ""

  - id: upload
    action: http_request
    method: POST
    path: "/d4d/uploader.php"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    headers:
      Content-Type: "multipart/form-data; boundary=_NOCTIS_{{proof.tok}}"
    body: "--_NOCTIS_{{proof.tok}}\r\nContent-Disposition: form-data; name=\"uploadedfile\"; filename=\"{{proof.name}}\"\r\nContent-Type: application/octet-stream\r\n\r\nnoctis vulnerability scanner test file - safe to delete\r\n--_NOCTIS_{{proof.tok}}--\r\n"
    store_as: up

  - id: confirm-upload
    action: match
    source: up.body
    pattern: "\"success\"\\s*:\\s*1"
    condition: 'type_of(up.body) == "string" && ereg("\"success\"[ \t]*:[ \t]*1[^0-9]", up.body) && ereg("\"file_name\"[ \t]*:[ \t]*\"" + proof.name + "\"", up.body)'
    on_match:
      finding:
        confidence_delta: 0.55
        qod: 75
        evidence: "Scrutinizer /d4d/uploader.php accepted an unauthenticated multipart upload of {{proof.name}} and answered \"success\":1 with that file name (file written to the snmp\\mibs folder; it holds one test line and can be deleted)"
        remediation: "Upgrade Scrutinizer to 9.5.0 or later, and restrict access to the web console. Delete the noctis_*.txt test file from the snmp\\mibs folder of the installation."
      stop: true

Scrutinizer MySQL default credentials (scrutremote / scrutinizer : admin)

CVECVE-2012-3951
Severityhigh · CVSS 7.5
Categorydefault-credentials — Default credentials
Servicesmysql
Ports3306
Detectionscript, set_var, tcp_open, tcp_send, match, tcp_close · highest QoD 97
Feedtests/vulnerabilities/scrutinizer/CVE-2012-3951.yaml

The MySQL server shipped with Plixer / Dell SonicWALL Scrutinizer 9.0.1.19899 and earlier has the accounts `scrutremote` and `scrutinizer` with the default password `admin`. The test logs in over the MySQL protocol with each account (one attempt per account) and, once a login is accepted, runs a constant `SELECT` that must return a per-run marker. A login that is refused ends the test without a finding. Anyone who can reach port 3306 can then run SQL commands on the Scrutinizer database.

How noctis detects it

  1. Parses / computes the next value with a Rhai script
  2. Parses / computes the next value with a Rhai script
  3. Parses / computes the next value with a Rhai script
  4. Opens a persistent TCP/TLS socket
  5. Parses / computes the next value with a Rhai script
  6. Sends a binary frame on the open socket
  7. Parses / computes the next value with a Rhai script
  8. Sends a binary frame on the open socket
  9. Checks q.response for NOCTIS_[0-9a-f]{16} → finding QoD 97: Scrutinizer MySQL default credentials (… / admin)
  10. Checks st for ^ok$ → finding QoD 75: Scrutinizer MySQL default credentials (… / admin)

References:

Feed source — tests/vulnerabilities/scrutinizer/CVE-2012-3951.yaml
# Plixer / Dell SonicWALL Scrutinizer MySQL default credentials — CVE-2012-3951
#
# The MySQL server bundled with Scrutinizer 9.0.1.19899 and earlier ships the
# accounts `scrutinizer` and `scrutremote` with the password `admin`, reachable
# from the network on 3306.
#
# Ported from OpenVAS/Greenbone NVT 2012/gb_scrutinizer_54731.nasl
# (OID 1.3.6.1.4.1.25623.1.0.103533, GPL-2.0-only): same mysql_native_password
# login (HandshakeResponse41 with the 20-byte SHA1 scramble computed from the
# server's salt).
#
# Detection method (real exploitation, benign proof):
#   1. open        read the protocol-10 greeting and extract the 20-byte salt.
#   2. login       scramble = SHA1(pw) XOR SHA1(salt + SHA1(SHA1(pw))), sent as the
#                  `scrutremote` then the `scrutinizer` account, password `admin`
#                  (one connection and one attempt per account).
#   3. proof       on an OK packet, run `SELECT CONCAT('NOCTIS_','<tok>')` on the
#                  same session and require the per-run marker NOCTIS_<tok> in the
#                  result (QoD 97). An OK packet whose query does not return the
#                  marker still reports, at QoD 75.
#
# Better than the NASL:
#   - the NASL only tries `scrutremote`; NVD names both accounts, so both are tried;
#   - the NASL stops at the auth reply; here the logged-in session runs a read-only
#     query and the result must carry a per-run marker (the query text, which holds
#     `'NOCTIS_','<tok>'` apart, cannot match);
#   - the salt is read from the real protocol-10 greeting (any version string
#     length), not from fixed offsets of a 5-byte version.
#
# Cyber-safety: the only statement run after login is a constant SELECT, no table
# is read or written. Two logins per scan can count toward a lock-out policy, so
# the feed is `default-credentials` (excludable).
uid: 1353f042-0cbe-414a-9213-478f81128347
name: "Scrutinizer MySQL default credentials (scrutremote / scrutinizer : admin)"
description: |
  The MySQL server shipped with Plixer / Dell SonicWALL Scrutinizer 9.0.1.19899 and
  earlier has the accounts `scrutremote` and `scrutinizer` with the default password
  `admin`. The test logs in over the MySQL protocol with each account (one attempt
  per account) and, once a login is accepted, runs a constant `SELECT` that must
  return a per-run marker. A login that is refused ends the test without a finding.
  Anyone who can reach port 3306 can then run SQL commands on the Scrutinizer
  database.
category: default-credentials
cves: [CVE-2012-3951]
cvss: 7.5
severity: high
confidence_base: 0.20
tags: [scrutinizer, plixer, mysql, database, default-credentials]
services: [mysql]
ports: [3306]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2012-3951"
  - "https://www.securityfocus.com/bid/54731"

steps:
  - id: mint-token
    action: script
    code: 'rand_hex(8)'
    store_as: tok

  - id: build-marker
    action: script
    code: '"NOCTIS_" + tok'
    store_as: marker

  # [len:3 LE][seq 0][0x03 COM_QUERY][SELECT CONCAT('NOCTIS_','<tok>')]
  - id: build-query
    action: script
    store_as: query_frame
    code: |
      let sql = "SELECT CONCAT('NOCTIS_','" + tok + "')";
      substr(p32le(strlen(sql) + 1), 0, 5) + "00" + "03" + hexstr(sql)

  # Pre-initialise every stored result a script reads: an undefined variable in a
  # script aborts the whole test, and a failed open leaves `greet` unset.
  - id: init
    action: set_var
    var_name: greet
    var_value: { connected: false, banner_hex: null }
    loop:
      over: ["scrutremote", "scrutinizer"]
      var: acct

  - id: open
    action: tcp_open
    handle: db
    port: "{{port}}"
    tls: false
    read_banner: true
    timeout_secs: 10
    store_as: greet
    on_failure:
      stop: true

  # Salt = scramble part 1 (8 bytes) + part 2 (12 bytes) of the protocol-10
  # greeting; the account password is `admin`. Returns #{ ok, frame }.
  - id: build-login
    action: script
    store_as: login
    code: |
      let hex = if type_of(greet.banner_hex) == "string" { tolower(greet.banner_hex) } else { "" };
      if strlen(hex) < 12 || u8(substr(hex, 8, 9)) != 10 {
        #{ ok: false, frame: "" }
      } else {
        let i = 10;
        while i < strlen(hex) - 2 && substr(hex, i, i + 1) != "00" { i += 2; }
        if strlen(hex) < i + 88 {
          #{ ok: false, frame: "" }
        } else {
          let salt = substr(hex, i + 10, i + 25) + substr(hex, i + 64, i + 87);
          let h1 = sha1_hex(hexstr("admin"));
          let h3 = sha1_hex(salt + sha1_hex(h1));
          let token = "";
          for k in 0..20 {
            token += p8(u8(substr(h1, 2 * k, 2 * k + 1)) ^ u8(substr(h3, 2 * k, 2 * k + 1)));
          }
          let body = "05a60f00" + "00000001" + "21" + "0000000000000000000000000000000000000000000000"
            + hexstr(acct) + "00" + "14" + token + hexstr("mysql_native_password") + "00";
          #{ ok: true, frame: substr(p32le(strlen(body) / 2), 0, 5) + "01" + body }
        }
      }

  - id: login-send
    action: tcp_send
    handle: db
    condition: "login.ok"
    send_hex: "{{login.frame}}"
    timeout_secs: 10
    store_as: auth

  # First byte of the reply payload: 00 OK, ff ERR, fe auth-switch request.
  - id: login-result
    action: script
    store_as: st
    code: |
      let hex = if is_def_var("auth") && type_of(auth.response_hex) == "string" { tolower(auth.response_hex) } else { "" };
      if login.ok && strlen(hex) >= 10 && substr(hex, 6, 7) == "02" && substr(hex, 8, 9) == "00" { "ok" } else { "no" }

  - id: proof-query
    action: tcp_send
    handle: db
    condition: 'st == "ok"'
    send_hex: "{{query_frame}}"
    timeout_secs: 10
    store_as: q

  - id: detect
    action: match
    source: q.response
    pattern: "NOCTIS_[0-9a-f]{16}"
    condition: 'st == "ok" && q.responded == true && stridx(q.response, marker) >= 0'
    on_match:
      finding:
        title: "Scrutinizer MySQL default credentials ({{acct}} / admin)"
        description: "The MySQL server accepted a login with the default account {{acct}} and password admin, and the session returned a per-run marker for a SELECT. Anyone who can reach the database port can run SQL commands on the Scrutinizer database."
        remediation: "Change the password of the scrutinizer and scrutremote MySQL accounts, upgrade Scrutinizer, and restrict port 3306 to the hosts that need it."
        confidence_delta: 0.77
        qod: 97
        evidence: "mysql_native_password login as {{acct}} with the default password accepted; SELECT CONCAT('NOCTIS_','{{tok}}') returned {{marker}} — authenticated session confirmed."
      stop: true

  - id: detect-ok-only
    action: match
    source: st
    pattern: "^ok$"
    on_match:
      finding:
        title: "Scrutinizer MySQL default credentials ({{acct}} / admin)"
        description: "The MySQL server answered a login with the default account {{acct}} and password admin with an OK packet."
        remediation: "Change the password of the scrutinizer and scrutremote MySQL accounts, upgrade Scrutinizer, and restrict port 3306 to the hosts that need it."
        confidence_delta: 0.60
        qod: 75
        evidence: "mysql_native_password login as {{acct}} with the default password was accepted (the proof query did not return the marker). Reply (hex): {{auth.response_hex}}"
      stop: true

  - id: close
    action: tcp_close
    handle: db

View these feeds on GitHub