Okay, let's break down the POST request used in the initial exploitation phase (ProxyLogon - CVE-2021-26855) of the 2021 Exchange Server attacks. This is where the malicious deserialization payload was delivered.
Understanding the Request
The attackers sent a specially crafted HTTP POST request to the Exchange Server's Outlook Web Access (OWA) endpoint. This endpoint is responsible for handling authentication and user interactions. The goal was to exploit a deserialization vulnerability within the OWA component.
1. HTTP Method: POST
- The
POST method is used to send data to the server to create or update a resource. In this case, the data was a malicious serialized object designed to trigger the vulnerability.
2. Target Endpoint: /ecp/8.0.1.1234/owa/auth.owa
/ecp/: This path points to the Exchange Control Panel (ECP), the administrative interface for Exchange Server.
8.0.1.1234: This is a version number. The specific version number might vary depending on the Exchange Server installation.
/owa/auth.owa: This endpoint handles authentication requests for OWA.
3. HTTP Headers
Host: target-server: Specifies the hostname of the Exchange Server.
Content-Type: application/x-www-form-urlencoded: Indicates that the request body is encoded as URL-encoded form data. This is a common format for submitting data from web forms.
- Other headers (e.g.,
User-Agent, Accept-Encoding) were also included to mimic legitimate browser traffic.
4. Request Body (The Malicious Payload)
This is the most critical part of the request. The body contained a specially crafted serialized object that exploited the deserialization vulnerability. The payload was encoded as URL-encoded form data.
Here's a simplified representation of the payload structure (actual payloads were more complex):
parameter1=value1¶meter2=value2&...&__REQUESTDIGEST=...&serializedObject=<malicious serialized object>
__REQUESTDIGEST: A security token used to prevent cross-site request forgery (CSRF). Attackers needed to bypass or obtain a valid digest token to successfully exploit the vulnerability.
serializedObject: This is where the malicious serialized object was embedded. The object was designed to trigger the deserialization flaw in the EmailMessage class.
Detailed Payload Structure (Simplified)
The serializedObject itself was a complex, serialized .NET object. It leveraged the deserialization vulnerability to execute arbitrary code. Here's a conceptual breakdown:
-
Type Specification: The payload included a $type property that specified a malicious .NET class (e.g., System.Windows.Data.ObjectDataProvider). This is where the TypeNameHandling setting became critical.
-
Gadget Chain: The payload used a "gadget chain" – a sequence of .NET classes and methods that, when combined, allowed the attacker to execute arbitrary code.
-
Method Invocation: The payload invoked a specific method on the malicious class (e.g., Start on ObjectDataProvider) with carefully crafted parameters.
-
Command Execution: The parameters passed to the method were designed to execute a command on the server (e.g., cmd.exe /c calc.exe).
Example Payload Snippet (Conceptual)
serializedObject=[
{
"$type": "System.Windows.Data.ObjectDataProvider, PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35",
"MethodName": "Start",
"MethodParameters": {
"$type": "System.Collections.ArrayList, mscorlib",
"$values": ["cmd.exe", "/c", "calc.exe"]
},
"ObjectInstance": {
"$type": "System.Diagnostics.Process, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
}
}
]
Explanation:
$type: Specifies the ObjectDataProvider class.
MethodName: Sets the method to be invoked to Start.
MethodParameters: Provides the parameters for the Start method, including the command to execute (cmd.exe /c calc.exe).
ObjectInstance: Specifies the Process class to be used for executing the command.
Tools Used for Payload Generation
- ysoserial.net: A popular .NET gadget chain generator. Attackers used ysoserial to create payloads tailored to the Exchange Server environment.
- Custom Scripts: Attackers also developed custom scripts to generate and encode payloads.
Key Takeaways
- The POST request was the initial vector for the attack.
- The malicious payload was embedded in the request body as a serialized .NET object.
- The
TypeNameHandling setting in Json.NET (or similar deserialization mechanisms) was crucial for enabling the attack.
- Gadget chains were used to execute arbitrary code on the server.
Do you want me to elaborate on any specific aspect of the request, such as the encoding, the gadget chain, or the bypass of the __REQUESTDIGEST token?