cbcvebase.
CVE-2021-31207
published 2021-05-11

CVE-2021-31207: Microsoft Exchange Server Security Feature Bypass Vulnerability

PriorityP187medium6.6CVSS 3.1
AVNACHPRHUINSUCHIHAH
KEVITWEXPLOITRansomwareInitial access
CISA Known Exploited Vulnerabilitydue 2021-11-17
Exploited in the wild
EPSS
99.78%
100.0th percentile
Microsoft Exchange Server Security Feature Bypass Vulnerability

Affected

13 ranges
VendorProductVersion rangeFixed in
microsoftexchange_server
microsoftexchange_server
microsoftexchange_server
microsoftmicrosoft_exchange_server_2013_cumulative_update_23>= 15.00.0 < 15.00.1497.01815.00.1497.018
microsoftmicrosoft_exchange_server_2016_cumulative_update_19>= 15.01.0 < 15.01.2176.01415.01.2176.014
microsoftmicrosoft_exchange_server_2016_cumulative_update_20>= 15.01.0 < 15.01.2242.01015.01.2242.010
microsoftmicrosoft_exchange_server_2019_cumulative_update_8>= 15.02.0 < 15.02.0792.01515.02.0792.015
microsoftmicrosoft_exchange_server_2019_cumulative_update_9>= 15.02.0 < 15.02.0858.01215.02.0858.012
msrcmicrosoft_exchange_server_2013_cumulative_update_23
msrcmicrosoft_exchange_server_2016_cumulative_update_19
msrcmicrosoft_exchange_server_2016_cumulative_update_20
msrcmicrosoft_exchange_server_2019_cumulative_update_8
msrcmicrosoft_exchange_server_2019_cumulative_update_9

Detection & IOCsextracted from sources · hover to see the quote

ip5.255.100.242
filenamelibeay32.dll
pathc:/inetpub/wwwroot/aspnet_client/{5-random-digit}.aspx
url/jquery-3.5.1.slim.min.js
pathC:\Windows\debug
pathC:\Windows\System32\AppLocker\winServicePrinter.ps1
urlhttp://31.214.157.169:80/ngrok.exe
processw3wp.exe
processMSExchangeMailboxReplication.exe
pathC:\Users\Public\
otherexec_code (query parameter)
otherBackdoor.ASP.WEBSHELL.SMYXBH5A
otherBackdoor.Win32.COBEACON.OSLJDO
otherBackdoor.PS1.REVSHELL.AB
otherPossible_SMWEBSHELLYXBH5A
sigma
filter event_type = STORY and actor_process_image_name = "certutil.exe" and actor_process_image_command_line contains ":8080"
sigma
filter event_type = ENUM.PROCESS and actor_process_image_name = "w3wp.exe" and (action_process_image_command_line contains "&ipconfig&echo" or action_process_image_command_line contains "&quesr&echo" or action_process_image_command_line contains "&whoami&echo" or action_process_image_command_line contains "&c:&echo" or action_process_image_command_line contains "&cd&echo" or action_process_image_command_line contains "&echo [E]" or action_process_image_command_line contains "&echo [S]")
sigma
filter event_type = ENUM.FILE and actor_process_image_name = "w3wp.exe" and action_file_path contains "FrontEnd\HttpProxy" and actor_process_command_line contains "MSExchange"
  • CVE-2021-31207 exploitation abuses the New-MailboxExportRequest PowerShell command to export a web shell embedded in a draft email to an arbitrary ASPX path under aspnet_client.
  • The exploitation chain imports a web shell as an email into the user draft mailbox, then exports it to a 5-random-digit ASPX file under c:/inetpub/wwwroot/aspnet_client/. Monitor for unexpected ASPX file creation in that directory.
  • Post-exploitation: IIS worker process (w3wp.exe) spawning PowerShell is a strong indicator of successful ProxyShell/CVE-2021-31207 exploitation. Alert on w3wp.exe as a parent process of PowerShell.
  • Web shell files dropped post-exploitation have random names and are placed in IIS script directories. Monitor MSExchangeMailboxReplication.exe as the parent process creating ASPX files.
  • Post-exploitation Cobalt Strike stager uses HTTP GET to /jquery-3.5.1.slim.min.js to blend in with normal traffic. Detect this path in proxy/web logs on Exchange servers.
  • China Chopper webshell activity can be detected by monitoring w3wp.exe spawning processes with command lines containing patterns like '&ipconfig&echo', '&whoami&echo', '&echo [E]', or '&echo [S]'.
  • Monitor for EXE or DLL file writes to C:\Users\Public\ by w3wp.exe on Exchange hosts as a post-exploitation indicator.
  • Monitor for suspicious file creation in Exchange FrontEnd\HttpProxy directories by w3wp.exe processes with MSExchange in the command line.
  • The tampered libeay32.dll used a non-valid certificate attributed to Zoom, issued by GoDaddy. Inspect DLL certificate metadata for anomalies when libeay32.dll is loaded in Exchange-related processes.
  • The exported function ASN1_OBJECT_create in the malicious libeay32.dll is used as a Cobalt Strike stager loader. Alert on rundll32.exe loading libeay32.dll and calling ASN1_OBJECT_create.
  • ·CVE-2021-31207 is part of the ProxyShell chain and requires chaining with CVE-2021-34473 (SSRF) and CVE-2021-34523 (privilege elevation) for full pre-auth RCE. CVE-2021-31207 alone provides arbitrary file write via New-MailboxExportRequest.
  • ·BianLian's use of the ProxyShell chain for initial access is assessed as 'possible' (not confirmed) by CISA/FBI/ACSC.

CVSS provenance

nvdv3.16.6MEDIUMCVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:H/I:H/A:H
nvdv2.06.5MEDIUMAV:N/AC:L/Au:S/C:P/I:P/A:P
vulncheck6.6MEDIUM
cisa6.6MEDIUM
vendor_msrc6.6MEDIUM
CVEs like this are exactly what “Exploited This Week” covers.

Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.