Harvesting Active Directory credentials via HTTP Request Smuggling
A desynchronisation between a proxy and the backend Exchange server allowed HTTP request smuggling, so an attacker could redirect a victim's ActiveSync request to a rogue server and capture the victim's base64-encoded Active Directory credentials. The attacker could then use those credentials to sign into Outlook Web Access and view sensitive data.
Published on tij.me
Exploiting public-facing services is one of the many ways to gain an initial foothold within a network. And it’s not uncommon to see this in the wild.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the proxy and the backend Exchange server parsed the Transfer-Encoding header differently because the attacker inserted a space before it, so the proxy used Content-Length while Exchange used chunked encoding.
What the attacker needed
Victim uses ActiveSync with Basic Auth; proxy and backend parse headers differently; attacker can send requests to the proxy
The fix
Disable http-reuse between the proxy and backend, force HTTP/2 from proxy to backend, and avoid Basic Auth in favour of modern authentication.
How it was found
- Send a request with a space before the Transfer-Encoding header to the proxy, so the proxy uses Content-Length and the backend uses chunked encoding.
- Include a second request in the body that redirects the next user to an attacker-controlled server.
- Check the attacker server's access log to confirm a victim was redirected.
- Change the redirect target to a catch-all server (Burp Collaborator) to capture the victim's ActiveSync request.
- Extract the Authorization header containing the victim's encoded credentials.
- Optionally, make the rogue server respond with a 451 status and X-MS-Location header to permanently migrate the victim's mail client to a rogue Exchange server.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
HTTP request smuggling happens when a front-end proxy and a back-end server disagree about where one HTTP request ends and the next begins. An attacker can sneak a second request past the proxy, and that hidden request is then answered to the next user who connects. Here, the hidden request redirected a victim's mail client to an attacker-controlled server, which then captured the victim's username and password.
What is Smuggling / CRLF?
A front end and a back end split one connection's bytes into requests differently, letting an attacker hide a request inside another user's.