Microsoft Exchange ProxyLogon Scanner - Metasploit
This page contains detailed information about how to use the auxiliary/scanner/http/exchange_proxylogon metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.
Module Overview
Name: Microsoft Exchange ProxyLogon Scanner
Module: auxiliary/scanner/http/exchange_proxylogon
Source code: modules/auxiliary/scanner/http/exchange_proxylogon.rb
Disclosure date: 2021-03-02
Last modification time: 2022-02-23 16:27:12 +0000
Supported architecture(s): -
Supported platform(s): -
Target service / protocol: http, https
Target network port(s): 80, 443, 3000, 8000, 8008, 8080, 8443, 8880, 8888
List of CVEs: CVE-2021-26855, CVE-2021-27065
This module is also known as ProxyLogon.
This module scan for a vulnerability on Microsoft Exchange Server that allows an attacker bypassing the authentication and impersonating as the admin (CVE-2021-26855). By chaining this bug with another post-auth arbitrary-file-write vulnerability to get code execution (CVE-2021-27065). As a result, an unauthenticated attacker can execute arbitrary commands on Microsoft Exchange Server. This vulnerability affects (Exchange 2013 Versions < 15.00.1497.012, Exchange 2016 CU18 < 15.01.2106.013, Exchange 2016 CU19 < 15.01.2176.009, Exchange 2019 CU7 < 15.02.0721.013, Exchange 2019 CU8 < 15.02.0792.010). All components are vulnerable by default.
Module Ranking and Traits
Module Ranking:
- normal: The exploit is otherwise reliable, but depends on a specific version and can't (or doesn't) reliably autodetect. More information about ranking can be found here.
Stability:
- crash-safe: Module should not crash the service.
Side Effects:
- ioc-in-logs: Module leaves signs of a compromise in a log file (Example: SQL injection data found in HTTP log).
Basic Usage
This module is a scanner module, and is capable of testing against multiple hosts.
msf > use auxiliary/scanner/http/exchange_proxylogon
msf auxiliary(exchange_proxylogon) > show options
... show and set options ...
msf auxiliary(exchange_proxylogon) > set RHOSTS ip-range
msf auxiliary(exchange_proxylogon) > exploit
Other examples of setting the RHOSTS option:
Example 1:
msf auxiliary(exchange_proxylogon) > set RHOSTS 192.168.1.3-192.168.1.200
Example 2:
msf auxiliary(exchange_proxylogon) > set RHOSTS 192.168.1.1/24
Example 3:
msf auxiliary(exchange_proxylogon) > set RHOSTS file:/tmp/ip_list.txt
Required Options
- RHOSTS: The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
Knowledge Base
Vulnerable Application
CVE-2021-28855 is a pre-authentication SSRF (Server Side Request Forgery) which allows an attacker to bypass authentication by sending specially crafted HTTP requests. This vulnerability is part of an attack chain used to perform an RCE (Remote Code Execution).
This vulnerability affects (Exchange 2013 Versions < 15.00.1497.012, Exchange 2016 CU18 < 15.01.2106.013, Exchange 2016 CU19 < 15.01.2176.009, Exchange 2019 CU7 < 15.02.0721.013, Exchange 2019 CU8 < 15.02.0792.010).
Introduction
An issue was discovered in Microsoft Exchange Server that allows an attacker bypassing the authentication and impersonating as the admin (CVE-2021-26855). By chaining this bug with another post-auth arbitrary-file-write vulnerability to get code execution (CVE-2021-27065).
As a result, an unauthenticated attacker can execute arbitrary commands on Microsoft Exchange Server.
All components are vulnerable by default.
Verification Steps
- Start msfconsole
- Do:
use auxiliary/scanner/http/exchange_proxylogon
- Do:
set RHOSTS [IP]
- Do:
run
Options
METHOD
HTTP Method to use for the check (only). Default: POST
Scenarios
msf6 auxiliary(scanner/http/exchange_proxylogon) > options
Module options (auxiliary/scanner/http/exchange_proxylogon):
Name Current Setting Required Description
---- --------------- -------- -----------
METHOD POST yes HTTP Method to use for the check. (Accepted: GET, POST)
Proxies no A proxy chain of format type:host:port[,type:host:port][...]
RHOSTS 172.20.2.110 yes The target host(s), range CIDR identifier, or hosts file with syntax 'file:'
RPORT 443 yes The target port (TCP)
SSL true no Negotiate SSL/TLS for outgoing connections
THREADS 1 yes The number of concurrent threads (max one per host)
VHOST no HTTP server virtual host
msf6 auxiliary(scanner/http/exchange_proxylogon) > run
[+] https://172.20.2.110:443 - The target is vulnerable to CVE-2021-26855.
[*] Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed
msf6 auxiliary(scanner/http/exchange_proxylogon) >
References
Go back to menu.
Msfconsole Usage
Here is how the scanner/http/exchange_proxylogon auxiliary module looks in the msfconsole:
msf6 > use auxiliary/scanner/http/exchange_proxylogon
msf6 auxiliary(scanner/http/exchange_proxylogon) > show info
Name: Microsoft Exchange ProxyLogon Scanner
Module: auxiliary/scanner/http/exchange_proxylogon
License: Metasploit Framework License (BSD)
Rank: Normal
Disclosed: 2021-03-02
Provided by:
Orange Tsai
mekhalleh (RAMELLA S��bastien)
Check supported:
No
Basic options:
Name Current Setting Required Description
---- --------------- -------- -----------
METHOD POST yes HTTP Method to use for the check. (Accepted: GET, POST)
Proxies no A proxy chain of format type:host:port[,type:host:port][...]
RHOSTS yes The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
RPORT 443 yes The target port (TCP)
SSL true no Negotiate SSL/TLS for outgoing connections
THREADS 1 yes The number of concurrent threads (max one per host)
VHOST no HTTP server virtual host
Description:
This module scan for a vulnerability on Microsoft Exchange Server
that allows an attacker bypassing the authentication and
impersonating as the admin (CVE-2021-26855). By chaining this bug
with another post-auth arbitrary-file-write vulnerability to get
code execution (CVE-2021-27065). As a result, an unauthenticated
attacker can execute arbitrary commands on Microsoft Exchange
Server. This vulnerability affects (Exchange 2013 Versions <
15.00.1497.012, Exchange 2016 CU18 < 15.01.2106.013, Exchange 2016
CU19 < 15.01.2176.009, Exchange 2019 CU7 < 15.02.0721.013, Exchange
2019 CU8 < 15.02.0792.010). All components are vulnerable by
default.
References:
https://nvd.nist.gov/vuln/detail/CVE-2021-26855
Logo: https://proxylogon.com/images/logo.jpg
https://proxylogon.com/
https://aka.ms/exchangevulns
Also known as:
ProxyLogon
Module Options
This is a complete list of options available in the scanner/http/exchange_proxylogon auxiliary module:
msf6 auxiliary(scanner/http/exchange_proxylogon) > show options
Module options (auxiliary/scanner/http/exchange_proxylogon):
Name Current Setting Required Description
---- --------------- -------- -----------
METHOD POST yes HTTP Method to use for the check. (Accepted: GET, POST)
Proxies no A proxy chain of format type:host:port[,type:host:port][...]
RHOSTS yes The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
RPORT 443 yes The target port (TCP)
SSL true no Negotiate SSL/TLS for outgoing connections
THREADS 1 yes The number of concurrent threads (max one per host)
VHOST no HTTP server virtual host
Advanced Options
Here is a complete list of advanced options supported by the scanner/http/exchange_proxylogon auxiliary module:
msf6 auxiliary(scanner/http/exchange_proxylogon) > show advanced
Module advanced options (auxiliary/scanner/http/exchange_proxylogon):
Name Current Setting Required Description
---- --------------- -------- -----------
DOMAIN WORKSTATION yes The domain to use for Windows authentication
DigestAuthIIS true no Conform to IIS, should work for most servers. Only set to false for non-IIS servers
FingerprintCheck true no Conduct a pre-exploit fingerprint verification
HttpClientTimeout no HTTP connection and receive timeout
HttpPassword no The HTTP password to specify for authentication
HttpRawHeaders no Path to ERB-templatized raw headers to append to existing headers
HttpTrace false no Show the raw HTTP requests and responses
HttpTraceColors red/blu no HTTP request and response colors for HttpTrace (unset to disable)
HttpTraceHeadersOnly false no Show HTTP headers only in HttpTrace
HttpUsername no The HTTP username to specify for authentication
SSLVersion Auto yes Specify the version of SSL/TLS to be used (Auto, TLS and SSL23 are auto-negotiate) (Accepted: Auto, TLS, SSL23, SSL3, TLS1, TLS1.1, TLS1.2)
ShowProgress true yes Display progress messages during a scan
ShowProgressPercent 10 yes The interval in percent that progress should be shown
UserAgent Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) no The User-Agent header to use for all requests
VERBOSE false no Enable detailed status messages
WORKSPACE no Specify the workspace for this module
Auxiliary Actions
This is a list of all auxiliary actions that the scanner/http/exchange_proxylogon module can do:
msf6 auxiliary(scanner/http/exchange_proxylogon) > show actions
Auxiliary actions:
Name Description
---- -----------
Evasion Options
Here is the full list of possible evasion options supported by the scanner/http/exchange_proxylogon auxiliary module in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):
msf6 auxiliary(scanner/http/exchange_proxylogon) > show evasion
Module evasion options:
Name Current Setting Required Description
---- --------------- -------- -----------
HTTP::header_folding false no Enable folding of HTTP headers
HTTP::method_random_case false no Use random casing for the HTTP method
HTTP::method_random_invalid false no Use a random invalid, HTTP method for request
HTTP::method_random_valid false no Use a random, but valid, HTTP method for request
HTTP::pad_fake_headers false no Insert random, fake headers into the HTTP request
HTTP::pad_fake_headers_count 0 no How many fake headers to insert into the HTTP request
HTTP::pad_get_params false no Insert random, fake query string variables into the request
HTTP::pad_get_params_count 16 no How many fake query string variables to insert into the request
HTTP::pad_method_uri_count 1 no How many whitespace characters to use between the method and uri
HTTP::pad_method_uri_type space no What type of whitespace to use between the method and uri (Accepted: space, tab, apache)
HTTP::pad_post_params false no Insert random, fake post variables into the request
HTTP::pad_post_params_count 16 no How many fake post variables to insert into the request
HTTP::pad_uri_version_count 1 no How many whitespace characters to use between the uri and version
HTTP::pad_uri_version_type space no What type of whitespace to use between the uri and version (Accepted: space, tab, apache)
HTTP::uri_dir_fake_relative false no Insert fake relative directories into the uri
HTTP::uri_dir_self_reference false no Insert self-referential directories into the uri
HTTP::uri_encode_mode hex-normal no Enable URI encoding (Accepted: none, hex-normal, hex-noslashes, hex-random, hex-all, u-normal, u-all, u-random)
HTTP::uri_fake_end false no Add a fake end of URI (eg: /%20HTTP/1.0/../../)
HTTP::uri_fake_params_start false no Add a fake start of params to the URI (eg: /%3fa=b/../)
HTTP::uri_full_url false no Use the full URL for all HTTP requests
HTTP::uri_use_backslashes false no Use back slashes instead of forward slashes in the uri
HTTP::version_random_invalid false no Use a random invalid, HTTP version for request
HTTP::version_random_valid false no Use a random, but valid, HTTP version for request
Go back to menu.
Error Messages
This module may fail with the following error messages:
Check for the possible causes from the code snippets below found in the module source code. This can often times help in identifying the root cause of the problem.
No response, target seems down.
Here is a relevant code snippet related to the "No response, target seems down." error message:
70: 'method' => datastore['METHOD'],
71: 'uri' => uri,
72: 'cookie' => 'X-AnonResource=true; X-AnonResource-Backend=localhost/ecp/default.flt?~3; X-BEResource=localhost/owa/auth/logon.aspx?~3;'
73: })
74: unless received
75: print_error(message('No response, target seems down.'))
76:
77: return Exploit::CheckCode::Unknown
78: end
79:
80: if received && (received.code != 500 && received.code != 503)
The target is not vulnerable to CVE-2021-26855.
Here is a relevant code snippet related to the "The target is not vulnerable to CVE-2021-26855." error message:
76:
77: return Exploit::CheckCode::Unknown
78: end
79:
80: if received && (received.code != 500 && received.code != 503)
81: print_error(message('The target is not vulnerable to CVE-2021-26855.'))
82: vprint_error("Obtained HTTP response code #{received.code} for #{full_uri(uri)}.")
83:
84: return Exploit::CheckCode::Safe
85: end
86:
Obtained HTTP response code <RECEIVED.CODE> for <FULL_URI-URI>.
Here is a relevant code snippet related to the "Obtained HTTP response code <RECEIVED.CODE> for <FULL_URI-URI>." error message:
77: return Exploit::CheckCode::Unknown
78: end
79:
80: if received && (received.code != 500 && received.code != 503)
81: print_error(message('The target is not vulnerable to CVE-2021-26855.'))
82: vprint_error("Obtained HTTP response code #{received.code} for #{full_uri(uri)}.")
83:
84: return Exploit::CheckCode::Safe
85: end
86:
87: if received.headers['X-CalculatedBETarget'] != 'localhost'
The target is not vulnerable to CVE-2021-26855.
Here is a relevant code snippet related to the "The target is not vulnerable to CVE-2021-26855." error message:
83:
84: return Exploit::CheckCode::Safe
85: end
86:
87: if received.headers['X-CalculatedBETarget'] != 'localhost'
88: print_error(message('The target is not vulnerable to CVE-2021-26855.'))
89: vprint_error('Could\'t obtain a correct \'X-CalculatedBETarget\' in the response header.')
90:
91: return Exploit::CheckCode::Safe
92: end
93:
Could't obtain a correct 'X-CalculatedBETarget' in the response header.
Here is a relevant code snippet related to the "Could't obtain a correct 'X-CalculatedBETarget' in the response header." error message:
84: return Exploit::CheckCode::Safe
85: end
86:
87: if received.headers['X-CalculatedBETarget'] != 'localhost'
88: print_error(message('The target is not vulnerable to CVE-2021-26855.'))
89: vprint_error('Could\'t obtain a correct \'X-CalculatedBETarget\' in the response header.')
90:
91: return Exploit::CheckCode::Safe
92: end
93:
94: print_good(message('The target is vulnerable to CVE-2021-26855.'))
Go back to menu.
Related Pull Requests
References
- CVE-2021-26855
- LOGO-https://proxylogon.com/images/logo.jpg
- https://proxylogon.com/
- https://aka.ms/exchangevulns
See Also
Check also the following modules related to this module:
- auxiliary/gather/exchange_proxylogon_collector
- exploit/windows/http/exchange_proxylogon_rce
- auxiliary/scanner/http/exchange_web_server_pushsubscription
- auxiliary/scanner/msmail/exchange_enum
- exploit/windows/http/exchange_chainedserializationbinder_denylist_typo_rce
- exploit/windows/http/exchange_chainedserializationbinder_rce
- exploit/windows/http/exchange_ecp_dlp_policy
- exploit/windows/http/exchange_ecp_viewstate
- exploit/windows/http/exchange_proxynotshell_rce
- exploit/windows/http/exchange_proxyshell_rce
- auxiliary/dos/windows/smtp/ms06_019_exchange
- auxiliary/dos/windows/ssh/sysax_sshd_kexchange
- exploit/windows/smtp/ms03_046_exchange2000_xexch50
- exploit/windows/ssh/freeftpd_key_exchange
- exploit/windows/ssh/freesshd_key_exchange
- post/windows/gather/exchange
Related Nessus plugins:
- Security Updates for Microsoft Exchange Server (March 2021)
- Microsoft Exchange Server Authentication Bypass
- Potential exposure to Hafnium Microsoft Exchange targeting
Authors
- Orange Tsai
- mekhalleh (RAMELLA Sébastien)
Version
This page has been produced using Metasploit Framework version 6.2.29-dev. For more modules, visit the Metasploit Module Library.
Go back to menu.