Skip to main content
Mallory
HighExploited in the wildCISA KEVPublic exploitVulnerability

CVE-2021-27065: Microsoft Exchange Server Post-Authentication Arbitrary File Write in ProxyLogon

Published Mar 2, 2021 · Updated 5 days ago
Trending this weekNot trendingOutside this week’s top 100
Mention activity · 30 days1 mention · peak 1 in a dayToday
CVSS7.8High · v3.1
EPSS99.9%100th percentile
CISA KEVYesAdded Nov 3, 2021
In the wildActivePer CISA KEV
Vendor
Microsoft Corporation
IdentifiersCVE-2021-27065CWE-22 · Improper Limitation of a Pathname…

CVE-2021-27065 is a post-authentication arbitrary file-write vulnerability affecting on-premises Microsoft Exchange Server 2013, 2016, and 2019. Insufficient path validation in the Exchange Control Panel's DDI WriteFileActivity functionality allows an authenticated attacker to write attacker-controlled content to arbitrary server locations. Writing a web shell into a web-accessible location enables remote code execution. The vulnerability forms part of the ProxyLogon exploit chain: combining it with the CVE-2021-26855 server-side request forgery vulnerability permits exploitation without previously possessing valid credentials. Microsoft released fixes on March 2, 2021. The vulnerability has been actively exploited by espionage actors and financially motivated attackers.

Do you run this?See affected versions in your environment and whether adversaries are exploiting this vulnerability against assets like yours.
Check your exposure
Analyst brief

Impact, mitigation & remediation

What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.

Impact

What an attacker gets, and what they’ve been doing with it.

Successful exploitation compromises server integrity through arbitrary file writes and can lead to remote command execution and persistent access through web shells. Subsequent activity can expose mailboxes, server files, and credentials and enable additional malware deployment, ransomware, cryptomining, and lateral movement. Broader Active Directory compromise is a potential downstream consequence, not an automatic result of this vulnerability alone. Exchange Online and Microsoft 365 cloud email services were not known to be affected.

Mitigation

If you can’t patch tonight, do this now.

Until updates can be applied, disconnect vulnerable Exchange servers from untrusted networks or restrict HTTPS access to trusted clients through isolation, access controls, or a VPN. Microsoft's Exchange On-premises Mitigation Tool and temporary Exchange mitigations can reduce exposure but do not cover every exploitation method and are not substitutes for patching. Monitor Exchange and IIS logs, web-directory integrity, unexpected IIS child processes, credential theft, and anomalous outbound connections. Perimeter restrictions do not prevent exploitation by attackers who already have internal access.

Remediation

Patch, then assume compromise.

Apply Microsoft's security updates addressing CVE-2021-27065, originally released on March 2, 2021, or superseding updates applicable to the Exchange deployment. Install required cumulative-update prerequisites and run updates with administrator privileges, completing required reboots and verifying successful installation. Investigate potentially exposed servers for historical exploitation, unexpected web-accessible files, web shells, and unauthorized configuration changes. If compromise is identified, preserve forensic evidence, isolate affected systems, remove malicious artifacts and persistence, and reset compromised credentials as part of incident response. Patching alone does not remove an existing compromise.

Public exploits

Exploits

8 exploits validated by Mallory's analysis. Hidden: 3 rejected by Mallory's analysis as not a working exploit; 1 not yet analyzed, such as Exploit-DB entries.

View more in app →
exchange_proxylogon_rce.rbThis repository contains a single Metasploit module: 'exchange_proxylogon_rce.rb', which exploits the ProxyLogon vulnerabilities (CVE-2021-26855 and CVE-2021-27065) in Microsoft Exchange Server. The exploit leverages an authentication bypass and arbitrary file write to achieve remote code execution (RCE) on vulnerable Exchange servers (2013, 2016, 2019) prior to specific patch levels. The module is highly weaponized, supporting multiple payload types (PowerShell, command, dropper) and architectures (x64, x86, CMD). It requires a known email address for the target organization and network access to the Exchange server, typically over HTTPS (port 443). The exploit writes a payload (such as a web shell or reverse shell) to a writable directory on the server and then triggers its execution. The code is structured as a standard Metasploit exploit module, with options for payload selection, HTTP method, and alternate file paths. The main attack vector is network-based, targeting Exchange web endpoints such as /ecp/ and /owa/. The module is operational and suitable for real-world exploitation within the Metasploit framework.Disclosed Mar 2, 2021 · Framework: metasploit · ruby · networkWeaponizedExchangeSSRFtoRCEExploitThis repository contains a fully operational exploit chain targeting Microsoft Exchange Server vulnerabilities CVE-2021-26855 (SSRF) and CVE-2021-27065 (RCE), known as the ProxyLogon exploit chain. The main file, 'Exchange_SSRFtoRCEChainExploit.py', is a Python script that automates the exploitation process: it first discovers the target's FQDN, then leverages SSRF to bypass authentication, escalates privileges, and finally uploads a JScript-based ASP web shell to the Exchange server's OWA authentication directory. The script interacts with several Exchange endpoints (notably /ecp/ and /owa/auth.owa) and writes the web shell to a known file path, enabling the attacker to execute arbitrary commands via HTTP requests. The exploit requires the attacker to provide the target Exchange server's URL and a valid email user. The README provides usage instructions and lists affected Exchange versions, confirming the exploit's applicability to Exchange 2010, 2013, 2016, and 2019 on Windows. The exploit is not part of a framework and is a standalone, weaponized script capable of achieving remote code execution.evilashz · Disclosed Mar 15, 2021 · python · networkOperationalProxyLogonThis repository contains a Python exploit script (ProxyLogon.py) targeting Microsoft Exchange Server vulnerabilities CVE-2021-26855 (ProxyLogon) and CVE-2021-27065. The exploit chains an authentication bypass (SSRF) with an arbitrary file write to achieve remote code execution. The script performs multiple stages: it first discovers the Exchange FQDN, then uses SSRF to leak user information and the administrator's SID, and finally writes a JScript web shell (proxylogon.aspx) to the Exchange server's OWA authentication directory. The payload allows the attacker to execute arbitrary code via HTTP requests to the web shell. The repository also includes a README.md with background, usage instructions, and mitigation advice. The exploit is operational and provides a working web shell if the target is vulnerable and accessible.RickGeex · Disclosed Mar 16, 2021 · python · networkOperationalProxyLogonThis repository contains a Python 3 exploit for the ProxyLogon vulnerabilities (CVE-2021-26855 and CVE-2021-27065) affecting Microsoft Exchange Server. The main file, ProxyLogon.py, implements a full exploit chain: it performs an SSRF (Server-Side Request Forgery) to bypass authentication, retrieves necessary information (such as domain and computer name), and leverages the vulnerabilities to write a web shell to the Exchange server's web directory. The exploit requires the attacker to specify the target Exchange server's hostname and a valid email address (or a file containing multiple addresses). Upon successful exploitation, a JScript-based web shell is uploaded to the server, granting the attacker remote code execution capabilities via HTTP requests. The code is operational and automates the entire attack chain, including NTLM authentication, mailbox SID retrieval, and web shell deployment. The README provides usage instructions and references the targeted CVEs. No detection-only scripts are present; the code is a working exploit.p0wershe11 · Disclosed Mar 17, 2021 · python · networkOperationalproxylogon-exploitThis repository is a proof-of-concept exploit for the ProxyLogon vulnerabilities (CVE-2021-26855 and CVE-2021-27065) affecting Microsoft Exchange Server. The main exploit script, 'exploit.py', is a Python program that automates the exploitation process, including backend host discovery, authentication bypass, and webshell upload. The exploit requires the attacker to provide the Exchange frontend URL, a valid email address (or SID), and a webshell payload. The script interacts with several Exchange endpoints, leveraging the ProxyLogon authentication bypass to gain administrative access and then abusing the OAB virtual directory to write a webshell to disk. Once the webshell is uploaded, the attacker can execute arbitrary commands on the server via HTTP requests to the webshell endpoint. The repository also includes a README with detailed usage instructions and an example attack flow. The exploit is operational and provides a working remote code execution vector, but the payload (webshell) must be supplied by the user and is subject to size and content restrictions.praetorian-inc · Disclosed Mar 24, 2021 · python · networkOperationalProxyVulnsThis repository contains operational exploit scripts for multiple high-profile Microsoft Exchange Server vulnerabilities: ProxyLogon (CVE-2021-26855, etc.), ProxyOracle (CVE-2021-31196), and ProxyShell (CVE-2021-34473, CVE-2021-31207). The structure includes four main Python scripts: - 26855.py: Implements the ProxyLogon exploit chain, culminating in the upload of a JScript webshell (api.aspx) to the Exchange server by abusing the OAB virtual directory. It automates the process of obtaining necessary tokens and SIDs, and provides a final webshell URL for remote code execution. - 31196.py: Implements the ProxyOracle padding oracle attack, allowing extraction of plaintext credentials from encrypted session cookies by exploiting a padding oracle vulnerability in OWA. It requires a valid 'cadata' cookie and outputs the decrypted username and password. - 34473.py: Implements the ProxyShell exploit chain, allowing remote PowerShell command execution on the Exchange server. It automates the process of obtaining a valid CommonAccessToken and then uses pypsrp to execute arbitrary PowerShell scripts remotely. - 31207.py: Works with 34473.py to deliver arbitrary files (e.g., malicious PDFs) to user mailboxes and then exports mailbox contents to a specified UNC path, leveraging Exchange's mailbox export features. A users.txt file provides a list of default or known usernames to assist in the exploitation process. The README.md gives usage instructions and references for each exploit. The scripts are operational and automate the full exploitation process, including credential extraction, webshell upload, remote command execution, and file delivery. The main attack vector is network-based, targeting exposed Exchange web services (ECP, OWA, Autodiscover, EWS, and PowerShell endpoints).hosch3n · Disclosed Apr 14, 2021 · python · networkOperationalProxyLogonThis repository contains a multi-language (Python and Go) exploit toolkit for the ProxyLogon vulnerability chain (CVE-2021-26855 and CVE-2021-27065) affecting Microsoft Exchange Server 2013, 2016, and 2019. The main exploit scripts are 'proxylogon.py' (Python 3) and 'proxylogon.go' (Go), both of which automate the attack chain: 1) exploiting the SSRF authentication bypass to impersonate an admin, 2) leaking the SID and other necessary information, 3) exploiting the arbitrary file write to upload a web shell (ASPX/JScript), and 4) providing remote code execution via the web shell. The 'manual' directory contains supporting scripts for manual exploitation steps: 'check.py' (enumeration and exploitation), 'brute.py' (SID brute-forcing), and 'shell.py' (interacting with the web shell). The exploit requires a valid email address on the target Exchange server, which can be brute-forced if unknown. The toolkit is operational and provides a working web shell for post-exploitation. All network interactions are over HTTPS endpoints typical of Exchange (e.g., /ecp/, /rpc/, /aspnet_client/).kh4sh3i · Disclosed Jun 27, 2022 · python · go · networkOperationalCTT-Exchange-RCE-v1.0---Microsoft-Exchange-Exploit-CVSS-10.0-CRITICAL-CVE-2021-26855-CVE-2021-27065Repository contains a single Python exploit script plus README and MIT license. The script presents itself as a ‘CTT-enhanced’ exploit chain for Microsoft Exchange Server targeting CVE-2021-26855 (ProxyLogon SSRF) and CVE-2021-27065 (post-auth arbitrary file write leading to RCE). Core capabilities visible in the provided content include: (1) Exchange service fingerprinting by probing common endpoints (OWA/ECP/EWS/Autodiscover/MAPI/ActiveSync) and checking for Exchange-specific strings/headers; (2) SSRF vulnerability checking using the known ProxyLogon technique of injecting an X-BEResource value (shown as being placed in a Cookie header) while requesting /owa/auth/Current/themes/resources/logon.css, attempting to reach internal endpoints like localhost/ews/Exchange.asmx and localhost/ecp/default.flt; (3) a multi-layer execution concept (‘CTT layers’) that varies timing (prime-aligned sleeps) and obfuscates request payloads via a custom XOR+base64 encoding routine (‘α-dispersion’) to claim evasion/reliability improvements; (4) post-exploitation behavior indicated by console output/README: deployment of an ASPX webshell and printing a shell URL with a ctt_cmd query parameter for command execution (documented example path: /owa/auth/ctt_shell.aspx). The README describes a full automation chain (SSRF → LegacyDN leak → SID conversion → WriteDACL/OAB abuse → webshell), but the code excerpt in CONTENT is truncated, so only the detection/SSRF-check portions and the stated end result (webshell URL output) can be directly confirmed from the provided snippet. No external C2 infrastructure is hardcoded; all network interaction is directed at the supplied target Exchange host and (via SSRF) internal loopback/localhost endpoints.SimoesCTT · Disclosed Jan 28, 2026 · python · networkOperational
Exposure surface

Affected products & vendors

Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.

VendorProductType
Microsoft CorporationExchange Serverapplication
FAQ

Frequently asked questions

Is CVE-2021-27065 exploited in the wild?
Yes. As of Nov 11, 2026, Mallory has reports of exploitation in the wild, and CISA added it to KEV on Nov 3, 2021.
Is there a public exploit for CVE-2021-27065?
Yes. Mallory tracks 8 public exploits or proofs of concept for CVE-2021-27065, the earliest disclosed Mar 2, 2021.
Is there a patch for CVE-2021-27065?
Apply Microsoft's security updates addressing CVE-2021-27065, originally released on March 2, 2021, or superseding updates applicable to the Exchange deployment. Install required cumulative-update prerequisites and run updates with administrator privileges, completing required reboots and verifying successful installation.
What products are affected by CVE-2021-27065?
Microsoft Corporation Exchange Server.
How severe is CVE-2021-27065?
CVE-2021-27065 has a CVSS v3.1 score of 7.8 (High) and an EPSS score of 99.9% (100th percentile) as of Nov 11, 2026.
Activity feed

Recent activity

101 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.

View more in app →
+76 more in the timeline. Sign up to see them
Do you run this?See affected versions in your environment and whether adversaries are exploiting this vulnerability against assets like yours.
Check your exposure
Mallory platform

The version that knows your environment.

This page is what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which adversaries are exploiting it right now, and which detections to deploy tonight.
Exposure mappingQuery your assets running an affected version, and investigate the blast radius.
Threat actor evidence84Every report linking this CVE to a named adversary.
Associated malware98Malware families linked to this CVE, with evidence and IOCs.
Detection signatures3YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.
Vendor-by-vendor mappingCross-references every affected SKU, including bundled OEM variants.
Social activity2Community discussion across Reddit, Mastodon, and other social sources.