ActivDesk — 1 vulnerability check

noctis ships 1 vulnerability check for ActivDesk; each one has to observe the bug on the live service before it reports a finding.

← All products · Feeds on GitHub

ActivDesk <= 3.0 search.cgi reflected XSS

Severitymedium
Categoryxss — XSS
Serviceshttp, https
Detectionscript, set_var, tcp_connect, match · highest QoD 75
Feedtests/vulnerabilities/activdesk/activdesk-search-xss.yaml

Tests an ActivDesk web help desk for the reflected cross-site scripting flaw in the search.cgi `keywords0` parameter, fixed in ActivDesk 3.0.1 together with blind SQL injection in kbcat.cgi and kb.cgi. The test first confirms the ActivDesk login page in each usual install directory, then sends an inert script tag carrying a per-scan random marker to search.cgi and reports the host when that tag is echoed back unescaped in a successful response.

How noctis detects it

  1. Parses / computes the next value with a Rhai script
  2. Raw TCP (TLS on HTTPS), sent verbatim: GET {{dir}}/login.cgi HTTP/1.0
  3. Parses / computes the next value with a Rhai script
  4. Raw TCP (TLS on HTTPS), sent verbatim: GET {{dir}}/search.cgi?keywords0=%3Cscript%3E{{marker}}%3C%2Fscript%3E HTTP/1.0
  5. Parses / computes the next value with a Rhai script
  6. Checks resp.banner for <script>noctis[0-9a-f]+</script> → finding QoD 75: ActivDesk at …/login.cgi: …/search.cgi reflected the inert tag <script>…</script> unescaped from the keywords0 parameter — …/search.cgi?key…

References:

Feed source — tests/vulnerabilities/activdesk/activdesk-search-xss.yaml
# ActivDesk <= 3.0 search.cgi reflected XSS (no CVE)
#
# ActivDesk (FocalMedia web help desk, Perl CGI) 3.0 and earlier echo the
# keywords0..keywords3 parameters of search.cgi into the results page without
# HTML-escaping them — a reflected cross-site scripting flaw (Brendan Coles,
# 2011-06-24, EDB-ID 17443, OSVDB-73343). The same advisory reports blind SQL
# injection in kbcat.cgi `cid` and kb.cgi `kid`; ActivDesk 3.0.1 fixes both.
#
# CVE mapping: the source NVT lists CVE-2011-1563 / CVE-2011-1564, but those
# NVD records describe DATAC RealFlex RealWin 2.1 HMI buffer/integer overflows
# (port 910, BID 46937), not ActivDesk. No CVE was ever assigned to the
# ActivDesk flaws, so `cves: []` and the classifier is `category: xss`.
#
# Detection (ported from OpenVAS/Greenbone NVT
# 2011/gb_activdesk_mult_xss_n_sql_inj_vuln.nasl, OID 1.3.6.1.4.1.25623.1.0.902530):
#   1. GET <dir>/login.cgi and require HTTP 200 + the ActivDesk support page
#      (<title>Support</title> or the "ActivDesk" footer).
#   2. GET <dir>/search.cgi?keywords0=<script>MARKER</script> (URL-encoded) and
#      require HTTP 200 whose body carries <script>MARKER</script> unescaped.
# Improvements over the NASL:
#   - the NASL fetches "/login.cgi" from the web root whatever <dir> it is
#     testing, so an install under /adesk, /support or /hdesk is never probed
#     unless a second copy sits at the root (false negative). The feed checks
#     <dir>/login.cgi for each candidate directory.
#   - the reflected script body is a per-scan random marker instead of the fixed
#     alert(document.cookie), so a page that contains that string or a cached
#     earlier probe cannot match.
# The SQL injection is not probed: it is blind, and without the product's
# source or a real instance no boolean/timing differential can be calibrated
# without false-positive risk; the XSS proves the vulnerable (<= 3.0) release.
# The payload is URL-encoded in the query, so it is sent verbatim with
# tcp_connect (reqwest would re-encode it) and matched on resp.banner.
uid: e23a7ee3-a81c-48dd-ba29-6efb707b890f
name: "ActivDesk <= 3.0 search.cgi reflected XSS"
description: |
  Tests an ActivDesk web help desk for the reflected cross-site scripting flaw
  in the search.cgi `keywords0` parameter, fixed in ActivDesk 3.0.1 together
  with blind SQL injection in kbcat.cgi and kb.cgi. The test first confirms the
  ActivDesk login page in each usual install directory, then sends an inert
  script tag carrying a per-scan random marker to search.cgi and reports the
  host when that tag is echoed back unescaped in a successful response.
cves: []
severity: medium
confidence_base: 0.30
category: xss
tags: [activdesk, helpdesk, perl, cgi, xss, web-abuse]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://www.exploit-db.com/exploits/17443"
  - "http://itsecuritysolutions.org/2011-06-24-ActivDesk-3.0-multiple-security-vulnerabilities/"
  - "OpenVAS/Greenbone NASL 2011/gb_activdesk_mult_xss_n_sql_inj_vuln.nasl (GPL-2.0-only)"

steps:
  # Per-scan marker: "noctis" + 16 lowercase hex chars.
  - id: mint-marker
    action: script
    code: '"noctis" + rand_hex(8)'
    store_as: marker

  # ── Loop group: every step below runs once per candidate install path ────
  # Pre-initialise everything the later steps read, so a refused connection or
  # a skipped probe never leaves a variable undefined (that aborts the test).
  - id: init-fp
    action: set_var
    var_name: fp
    var_value: {connected: false, banner: null}
    loop:
      over: ["/adesk", "/support", "/hdesk", "/helpdesk", "/activdesk", "/cgi-bin/adesk", "/cgi-bin", "/scripts", ""]
      var: dir

  - id: init-resp
    action: set_var
    var_name: resp
    var_value: {connected: false, banner: null}

  - id: init-adesk-page
    action: set_var
    var_name: adesk_page
    var_value: false

  # 1 — fingerprint: <dir>/login.cgi must be the ActivDesk support login page.
  - id: fingerprint
    action: tcp_connect
    port: "{{port}}"
    send: "GET {{dir}}/login.cgi HTTP/1.0\r\nHost: {{target_host}}\r\nAccept: text/html,*/*\r\nConnection: close\r\n\r\n"
    timeout_secs: 10
    store_as: fp

  - id: fingerprint-check
    action: script
    code: |
      let b = fp.banner;
      if type_of(b) != "string" { false }
      else {
        ereg("^HTTP/1\\.[01] 200", b) && ereg("(?i)<title>Support</title>|ActivDesk", b)
      }
    store_as: adesk_page

  # 2 — the XSS probe: keywords0=<script>MARKER</script>, URL-encoded.
  - id: xss-probe
    action: tcp_connect
    port: "{{port}}"
    condition: "adesk_page == true"
    send: "GET {{dir}}/search.cgi?keywords0=%3Cscript%3E{{marker}}%3C%2Fscript%3E HTTP/1.0\r\nHost: {{target_host}}\r\nAccept: text/html,*/*\r\nConnection: close\r\n\r\n"
    timeout_secs: 10
    store_as: resp

  # HTTP 200 and the raw <script>MARKER</script> tag in the reply. An
  # HTML-encoded echo (&lt;script&gt;…) from a fixed release does not match.
  - id: verify
    action: script
    code: |
      let b = resp.banner;
      if type_of(b) != "string" { false }
      else {
        ereg("^HTTP/1\\.[01] 200", b) && stridx(b, "<script>" + marker + "</script>") >= 0
      }
    store_as: xss_hit

  - id: xss-match
    action: match
    source: resp.banner
    pattern: "<script>noctis[0-9a-f]+</script>"
    condition: "xss_hit == true"
    on_match:
      finding:
        confidence_delta: 0.55
        qod: 75
        evidence: "ActivDesk at {{dir}}/login.cgi: {{dir}}/search.cgi reflected the inert tag <script>{{marker}}</script> unescaped from the keywords0 parameter — {{dir}}/search.cgi?keywords0=%3Cscript%3E{{marker}}%3C%2Fscript%3E"
      stop: true

View these feeds on GitHub