Detection: Windows Exchange Autodiscover SSRF Abuse

Description

This analytic identifies potential exploitation attempts of ProxyShell (CVE-2021-34473, CVE-2021-34523, CVE-2021-31207) and ProxyNotShell (CVE-2022-41040, CVE-2022-41082) vulnerabilities in Microsoft Exchange Server. The detection focuses on identifying the SSRF attack patterns used in these exploit chains. The analytic monitors for suspicious POST requests to /autodiscover/autodiscover.json endpoints that may indicate attempts to enumerate LegacyDN attributes as part of initial reconnaissance. It also detects requests containing X-Rps-CAT parameters that could indicate attempts to impersonate Exchange users and access the PowerShell backend. Additionally, it looks for MAPI requests that may be used to obtain user SIDs, along with suspicious user agents (particularly Python-based) commonly used in automated exploit attempts. If successful, these attacks can lead to remote code execution as SYSTEM, allowing attackers to deploy webshells, access mailboxes, or gain persistent access to the Exchange server and potentially the broader network environment.

 1 
 2| tstats `security_content_summariesonly` count min(_time) as firstTime max(_time) as lastTime from datamodel=Web where (Web.status=200) AND Web.http_method=POST by Web.src Web.status Web.uri_path Web.dest Web.http_method Web.uri_query Web.http_user_agent 
 3| `drop_dm_object_name("Web")` 
 4| eval is_autodiscover=if(like(lower(uri_path),"%autodiscover/autodiscover.json%"),1,0) 
 5| eval has_rps_cat=if(like(lower(uri_query),"%x-rps-cat=%"),1,0) 
 6| eval exchange_backend=if(like(lower(uri_query),"%/powershell/?%"),1,0) 
 7| eval mapi=if(like(uri_query,"%/mapi/%"),1,0) 
 8| eval suspicious_agent=if(match(lower(http_user_agent), "python
 9|urllib"),1,0) 
10| addtotals fieldname=Score is_autodiscover, has_rps_cat, exchange_backend, mapi, suspicious_agent 
11| where Score >= 3 
12| fields Score, src, dest, status, uri_query, uri_path, http_method, http_user_agent 
13| `windows_exchange_autodiscover_ssrf_abuse_filter`

Data Source

Name Platform Sourcetype Source
Windows IIS Windows icon Windows 'IIS:Configuration:Operational' 'IIS:Configuration:Operational'

Macros Used

Name Value
security_content_summariesonly summariesonly=summariesonly_config allow_old_summaries=oldsummaries_config fillnull_value=fillnull_config``
windows_exchange_autodiscover_ssrf_abuse_filter search *
windows_exchange_autodiscover_ssrf_abuse_filter is an empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.

Annotations

- MITRE ATT&CK
+ Kill Chain Phases
+ NIST
+ CIS
- Threat Actors
ID Technique Tactic
T1190 Exploit Public-Facing Application Initial Access
T1133 External Remote Services Initial Access
Delivery
Installation
DE.CM
CIS 13
APT28
APT29
APT39
APT41
APT5
Agrius
Axiom
BackdoorDiplomacy
BlackTech
Blue Mockingbird
Cinnamon Tempest
Dragonfly
Earth Lusca
Ember Bear
FIN13
FIN7
Fox Kitten
GALLIUM
GOLD SOUTHFIELD
HAFNIUM
INC Ransom
Ke3chang
Kimsuky
Magic Hound
Moses Staff
MuddyWater
Play
Rocke
Sandworm Team
Threat Group-3390
ToddyCat
Volatile Cedar
Volt Typhoon
Winter Vivern
menuPass
APT18
APT28
APT29
APT41
Akira
Chimera
Dragonfly
Ember Bear
FIN13
FIN5
GALLIUM
GOLD SOUTHFIELD
Ke3chang
Kimsuky
LAPSUS$
Leviathan
OilRig
Play
Sandworm Team
Scattered Spider
TeamTNT
Threat Group-3390
Volt Typhoon
Wizard Spider

Default Configuration

This detection is configured by default in Splunk Enterprise Security to run with the following settings:

Setting Value
Disabled true
Cron Schedule 0 * * * *
Earliest Time -70m@m
Latest Time -10m@m
Schedule Window auto
Creates Notable Yes
Rule Title %name%
Rule Description %description%
Notable Event Fields user, dest
Creates Risk Event True
This configuration file applies to all detections of type TTP. These detections will use Risk Based Alerting and generate Notable Events.

Implementation

To successfully implement this search you need to be ingesting information on Web traffic, Exchange OR IIS logs, mapped to Web datamodel in the Web node. In addition, confirm the latest CIM App 4.20 or higher is installed.

Known False Positives

False positives are limited.

Associated Analytic Story

Risk Based Analytics (RBA)

Risk Message:

Activity related to ProxyShell or ProxyNotShell has been identified on $dest$. Review events and take action accordingly.

Risk Object Risk Object Type Risk Score Threat Objects
dest system 72 No Threat Objects

References

Detection Testing

Test Type Status Dataset Source Sourcetype
Validation Passing N/A N/A N/A
Unit Passing Dataset ms:iis:splunk ms:iis:splunk
Integration ✅ Passing Dataset ms:iis:splunk ms:iis:splunk

Replay any dataset to Splunk Enterprise by using our replay.py tool or the UI. Alternatively you can replay a dataset into a Splunk Attack Range


Source: GitHub | Version: 4