GoSmart — 2 vulnerability checks

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

← All products · Feeds on GitHub

GoSmart Message Board Forum.asp SQL injection

CVECVE-2004-1588
Severityhigh · CVSS 7.5
Categorysqli — SQL injection
Serviceshttp, https
Detectionscript, set_var, http_request, match · highest QoD 75
Feedtests/vulnerabilities/gosmart/CVE-2004-1588.yaml

GoSmart Message Board, a classic ASP forum backed by Microsoft Access, places the QuestionNumber and Category parameters of Forum.asp into its database queries without validation, so a remote attacker can run arbitrary SQL against the forum database.

On /messageboard and the web root, this check requests Forum.asp with a QuestionNumber followed by a random word, and with a Category carrying a stray quote and a random word. These values only make the query fail to parse and change nothing. The flaw is confirmed when the reply shows the database syntax error (Access "in query expression", SQL Server "Incorrect syntax near" or "Unclosed quotation mark") quoting the random word.

How noctis detects it

  1. Parses / computes the next value with a Rhai script
  2. HTTP(S) request GET {{v.d}}/Forum.asp?{{v.pre}}{{sc.tok}}{{v.post}}
  3. Parses / computes the next value with a Rhai script
  4. Checks hit for Forum\.asp → finding QoD 75: GoSmart Message Board Forum.asp SQL injection (CVE-2004-1588)

References:

Feed source — tests/vulnerabilities/gosmart/CVE-2004-1588.yaml
# GoSmart Message Board — Forum.asp QuestionNumber / Category SQL injection
# (CVE-2004-1588). The same releases carry the CVE-2004-1589 cross-site
# scripting, see CVE-2004-1589.yaml next to this file.
#
# GoSmart Message Board (Go Smart Inc., classic ASP + Access) concatenates the
# QuestionNumber and Category parameters of Forum.asp (and the Username /
# Password fields of Login_Exec.asp) into its database queries. Advisory
# (Positive Technologies, BID 11361, EDB-24670):
#   messageboard/Forum.asp?QuestionNumber=[SQL CODE HERE]&Find=1
#   messageboard/Forum.asp?Category=[SQL CODE HERE]
# The product sources were never published; the vectors follow the advisory.
#
# Detection (QoD 75), read-only: under /messageboard and the web root, Forum.asp
# is requested with
#   QuestionNumber=1 NOCTIS<random>&Find=1   (a stray word after a number)
#   Category=1'NOCTIS<random>                (a stray quote)
# Neither value can run anything: the database only fails to parse the query.
# The flaw is confirmed when the reply carries the database parser error quoting
# the injected word — Jet/Access "Syntax error ... in query expression
# '... NOCTIS<random>'" (ADO/OLE DB or ODBC driver), or SQL Server "Incorrect
# syntax near" / "Unclosed quotation mark" followed by it. A page that merely
# echoes the URL has no parser message in front of the word and is not reported;
# the reply must also be an error (HTTP 500) or name the database driver.
#
# The OpenVAS/Greenbone NVT `pre2008/gosmart_message_board.nasl` (OID
# 1.3.6.1.4.1.25623.1.0.15451, GPL-2.0-only) lists this CVE but only sends the
# CVE-2004-1589 XSS request; this feed proves the SQL injection itself.
# CVSS: NVD carries only a CVSS v2 score (7.5).
uid: ec8f9248-0179-4950-92b0-2d21e7e35180
name: "GoSmart Message Board Forum.asp SQL injection (CVE-2004-1588)"
description: |
  GoSmart Message Board, a classic ASP forum backed by Microsoft Access,
  places the QuestionNumber and Category parameters of Forum.asp into its
  database queries without validation, so a remote attacker can run arbitrary
  SQL against the forum database.

  On /messageboard and the web root, this check requests Forum.asp with a
  QuestionNumber followed by a random word, and with a Category carrying a
  stray quote and a random word. These values only make the query fail to
  parse and change nothing. The flaw is confirmed when the reply shows the
  database syntax error (Access "in query expression", SQL Server "Incorrect
  syntax near" or "Unclosed quotation mark") quoting the random word.
cves: [CVE-2004-1588]
cvss: 7.5
severity: high
category: sqli
confidence_base: 0.30
tags: [gosmart, message-board, forum, asp, access, sqli]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2004-1588"
  - "http://www.securityfocus.com/bid/11361"
  - "https://www.exploit-db.com/exploits/24670"

steps:
  - id: gen-marker
    action: script
    code: |
      let tok = "NOCTIS" + rand_int(10000000, 99999999);
      #{ tok: tok,
         re: "(?i)(query expression|incorrect syntax near|unclosed quotation mark)[^<\\r\\n]{0,200}" + tok }
    store_as: sc

  - id: init-hit
    action: set_var
    var_name: hit
    var_value: ""

  # ── Per install dir × parameter (loop group) ──────────────────────────────
  - id: init-r
    action: set_var
    var_name: r
    var_value: {status: 0, body: ""}
    loop:
      var: v
      over:
        - {d: "/messageboard", pre: "QuestionNumber=1%20", post: "&Find=1", param: "QuestionNumber"}
        - {d: "/messageboard", pre: "Category=1%27", post: "", param: "Category"}
        - {d: "", pre: "QuestionNumber=1%20", post: "&Find=1", param: "QuestionNumber"}
        - {d: "", pre: "Category=1%27", post: "", param: "Category"}

  - id: probe
    action: http_request
    method: GET
    path: "{{v.d}}/Forum.asp?{{v.pre}}{{sc.tok}}{{v.post}}"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    condition: 'hit == ""'
    store_as: r

  - id: check
    action: script
    condition: 'hit == ""'
    code: |
      let b = if type_of(r.body) == "string" { r.body } else { "" };
      let drv = r.status == 500 || ereg("(?i)80040e14|JET Database Engine|ODBC|OLE DB|SQL Server", b);
      if r.status != 0 && drv && ereg(sc.re, b) {
        let m = eregmatch("(?i)(Syntax error[^<\\r\\n]{0,40}?in query expression|Syntax error[^<'\\r\\n]{0,40}|Incorrect syntax near|Unclosed quotation mark)", b);
        let what = if type_of(m) == "array" && m.len() > 0 { m[0] } else { "SQL syntax error" };
        v.d + "/Forum.asp " + v.param + ": HTTP " + r.status + ", \"" + what + "\" quoting " + sc.tok
      } else { "" }
    store_as: hit

  # ── Finding ───────────────────────────────────────────────────────────────
  - id: report
    action: match
    source: hit
    pattern: "Forum\\.asp"
    condition: 'hit != ""'
    on_match:
      finding:
        title: "GoSmart Message Board Forum.asp SQL injection (CVE-2004-1588)"
        description: "GoSmart Message Board passed a request parameter of Forum.asp into its database query unvalidated: the injected word reached the SQL parser and came back in its syntax error. An attacker can run arbitrary SQL against the forum database (read or change accounts and messages)."
        remediation: "Upgrade GoSmart Message Board to a release that validates QuestionNumber / Category and uses parameterised queries, or remove the message board: the product is no longer maintained."
        confidence_delta: 0.50
        qod: 75
        evidence: "{{hit}}"
      stop: true

GoSmart Message Board Forum.asp / ReplyToQuestion.asp cross-site scripting

CVECVE-2004-1589
Severitymedium · CVSS 4.3
Categoryxss — XSS
Serviceshttp, https
Detectionscript, set_var, http_request, match · highest QoD 75
Feedtests/vulnerabilities/gosmart/CVE-2004-1589.yaml

GoSmart Message Board, a classic ASP forum, prints the Category parameter of Forum.asp and the MainMessageID parameter of ReplyToQuestion.asp into its pages without HTML encoding, so a crafted link runs attacker script in the browser of a user who follows it.

On /messageboard and the web root, this check requests both pages with a value that closes the HTML attribute and opens a script element carrying a random marker. The flaw is confirmed when the page (HTTP 200) returns that script element unescaped, and a random page of the same directory, given the same parameters, does not (which rules out servers that echo any URL).

How noctis detects it

  1. Parses / computes the next value with a Rhai script
  2. HTTP(S) request GET {{v.d}}/{{v.page}}?{{v.q}}{{sc.p}}
  3. Parses / computes the next value with a Rhai script
  4. HTTP(S) request GET {{v.d}}/{{sc.ctl}}?{{v.q}}{{sc.p}}
  5. Parses / computes the next value with a Rhai script
  6. Checks hit for \.asp\? → finding QoD 75: GoSmart Message Board cross-site scripting (CVE-2004-1589)

References:

Feed source — tests/vulnerabilities/gosmart/CVE-2004-1589.yaml
# GoSmart Message Board — Forum.asp Category / ReplyToQuestion.asp MainMessageID
# reflected cross-site scripting (CVE-2004-1589). The same releases carry the
# CVE-2004-1588 SQL injection, see CVE-2004-1588.yaml next to this file.
#
# GoSmart Message Board (Go Smart Inc., classic ASP + Access) prints the Category
# parameter of Forum.asp and the MainMessageID parameter of ReplyToQuestion.asp
# into its pages without HTML encoding. Advisory vectors (Positive Technologies,
# BID 11361, EDB-24670):
#   /messageboard/Forum.asp?QuestionNumber=1&Find=1&Category="><script>alert()</script><"
#   /messageboard/ReplyToQuestion.asp?MainMessageID="><script>alert()</script><"
# The product sources were never published; the vectors follow the advisory.
#
# Detection (QoD 75): both vectors are sent under /messageboard and the web root
# with an attribute break-out "><script>alert(/noctis<random>/)</script><". The
# flaw is confirmed when the reply (HTTP 200) carries the break-out verbatim, not
# inside a single-quoted attribute (where it would stay text). A random .asp name
# in the same directory is then requested with the same query: a server that
# echoes any URL raw (catch-all page, reflector) also reflects it there and is
# not reported; a 404 page echoing the URL HTML-encoded does not mask the flaw.
#
# Ported from OpenVAS/Greenbone NVT `pre2008/gosmart_message_board.nasl`
# (OID 1.3.6.1.4.1.25623.1.0.15451, GPL-2.0-only): Forum.asp Category vector with
# a static `<script>foo</script>` marker, skipped when the host reflects XSS
# generically. Differences: random marker (no static page can match), the
# ReplyToQuestion.asp vector from the advisory is tried too, and the generic
# reflection control is done per directory with the same query.
# CVSS: NVD carries only a CVSS v2 score (4.3).
uid: 2b55a386-3bc6-40e1-afb7-81c256b4d9f2
name: "GoSmart Message Board Forum.asp / ReplyToQuestion.asp cross-site scripting (CVE-2004-1589)"
description: |
  GoSmart Message Board, a classic ASP forum, prints the Category parameter of
  Forum.asp and the MainMessageID parameter of ReplyToQuestion.asp into its
  pages without HTML encoding, so a crafted link runs attacker script in the
  browser of a user who follows it.

  On /messageboard and the web root, this check requests both pages with a
  value that closes the HTML attribute and opens a script element carrying a
  random marker. The flaw is confirmed when the page (HTTP 200) returns that
  script element unescaped, and a random page of the same directory, given the
  same parameters, does not (which rules out servers that echo any URL).
cves: [CVE-2004-1589]
cvss: 4.3
severity: medium
category: xss
confidence_base: 0.30
tags: [gosmart, message-board, forum, asp, xss, reflected]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2004-1589"
  - "http://www.securityfocus.com/bid/11361"
  - "https://www.exploit-db.com/exploits/24670"

steps:
  - id: gen-marker
    action: script
    code: |
      let tok = "noctis" + rand_int(10000000, 99999999);
      #{ tok: tok,
         want: "\"><script>alert(/" + tok + "/)</script>",
         sq: "='[^'<>]*\"><script>alert\\(/" + tok + "/\\)",
         p: "%22%3E%3Cscript%3Ealert%28%2F" + tok + "%2F%29%3C%2Fscript%3E%3C%22",
         ctl: "noctis" + rand_hex(6) + ".asp" }
    store_as: sc

  - id: init-hit
    action: set_var
    var_name: hit
    var_value: ""

  # ── Per install dir × vector (loop group) ─────────────────────────────────
  - id: init-r
    action: set_var
    var_name: r
    var_value: {status: 0, body: ""}
    loop:
      var: v
      over:
        - {d: "/messageboard", page: "Forum.asp", q: "QuestionNumber=1&Find=1&Category="}
        - {d: "/messageboard", page: "ReplyToQuestion.asp", q: "MainMessageID="}
        - {d: "", page: "Forum.asp", q: "QuestionNumber=1&Find=1&Category="}
        - {d: "", page: "ReplyToQuestion.asp", q: "MainMessageID="}

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

  - id: probe
    action: http_request
    method: GET
    path: "{{v.d}}/{{v.page}}?{{v.q}}{{sc.p}}"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    condition: 'hit == ""'
    store_as: r

  - id: check-probe
    action: script
    condition: 'hit == ""'
    code: |
      let b = if type_of(r.body) == "string" { r.body } else { "" };
      r.status == 200 && b.contains(sc.want) && !ereg(sc.sq, b)
    store_as: reflected

  # Generic-reflection control: same query on a random page of the directory.
  - id: control
    action: http_request
    method: GET
    path: "{{v.d}}/{{sc.ctl}}?{{v.q}}{{sc.p}}"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    condition: 'hit == "" && reflected'
    store_as: c

  - id: check
    action: script
    condition: 'hit == ""'
    code: |
      let cb = if type_of(c.body) == "string" { c.body } else { "" };
      if reflected && !cb.contains(sc.want) { v.d + "/" + v.page + "?" + v.q } else { "" }
    store_as: hit

  # ── Finding ───────────────────────────────────────────────────────────────
  - id: report
    action: match
    source: hit
    pattern: "\\.asp\\?"
    condition: 'hit != ""'
    on_match:
      finding:
        title: "GoSmart Message Board cross-site scripting (CVE-2004-1589)"
        description: "GoSmart Message Board returned a script element passed in a request parameter without HTML encoding: a crafted link runs attacker script in the browser of a forum user who follows it, in the context of the site."
        remediation: "Upgrade GoSmart Message Board to a release that encodes request parameters before printing them, or remove the message board: the product is no longer maintained."
        confidence_delta: 0.50
        qod: 75
        evidence: "{{hit}} + attribute break-out returned {{sc.want}} unescaped (HTTP 200); a random page of the same directory did not reflect it"
      stop: true

View these feeds on GitHub