mirror of
https://github.com/nmap/nmap.git
synced 2026-08-03 22:29:06 +00:00
commit 7dae4affc23f9fd70e916bc461e45eafe4bcf99a
Author: Patrik Karlsson <patrik@cqure.net>
Date: Thu May 29 21:33:18 2014 -0400
fix to detect non ASA devices and unsupported versions
This commit is contained in:
parent
c6fc780a29
commit
0b0109d4af
6 changed files with 35 additions and 15 deletions
|
|
@ -89,20 +89,25 @@ Cisco = {
|
|||
end
|
||||
}
|
||||
|
||||
|
||||
local response = http.head(self.host, self.port, '/', options)
|
||||
local path = '/'
|
||||
local response = http.head(self.host, self.port, path, options)
|
||||
-- account for redirects
|
||||
if not response.status == 200 then
|
||||
return false, "Failed to connect to SSL VPN server"
|
||||
elseif response.location then
|
||||
local u = url.parse(response.location[#response.location])
|
||||
self.host = u.host
|
||||
if u.host then
|
||||
self.host = u.host
|
||||
end
|
||||
if u.path then
|
||||
path = u.path
|
||||
end
|
||||
end
|
||||
|
||||
response = http.post(self.host, self.port, '/', options, nil, data)
|
||||
response = http.post(self.host, self.port, path, options, nil, data)
|
||||
|
||||
if response.status ~= 200 or response.body == nil then
|
||||
return false, "Error in SSL VPN server response"
|
||||
return false, "Not a Cisco ASA or unsupported version"
|
||||
end
|
||||
|
||||
local xmltags = {
|
||||
|
|
@ -126,6 +131,11 @@ Cisco = {
|
|||
self.conn_attr[tag] = m
|
||||
end
|
||||
end
|
||||
|
||||
if not self.conn_attr['version'] then
|
||||
return false, "Not a Cisco ASA or unsupported version"
|
||||
end
|
||||
|
||||
-- in case we were redirected
|
||||
self.conn_attr['host'] = stdnse.get_hostname(self.host)
|
||||
return true
|
||||
|
|
|
|||
|
|
@ -41,8 +41,10 @@ end
|
|||
|
||||
action = function(host, port)
|
||||
local ac = anyconnect.Cisco.AnyConnect:new(host, port)
|
||||
local status = ac:connect()
|
||||
if status then
|
||||
local status, err = ac:connect()
|
||||
if not status then
|
||||
return ("\n ERROR: %s"):format(err)
|
||||
else
|
||||
local o = stdnse.output_table()
|
||||
local xmltags = { 'version', 'tunnel-group', 'group-alias',
|
||||
'config-hash', 'host-scan-ticket', 'host-scan-token',
|
||||
|
|
|
|||
|
|
@ -68,8 +68,10 @@ Cisco Adaptive Security Appliance (ASA) Software 8.2 before 8.2(5.47), 8.4 befor
|
|||
|
||||
local report = vulns.Report:new(SCRIPT_NAME, host, port)
|
||||
local ac = anyconnect.Cisco.AnyConnect:new(host, port)
|
||||
local status = ac:connect()
|
||||
if status then
|
||||
local status, err = ac:connect()
|
||||
if not status then
|
||||
return ("\n ERROR: %s"):format(err)
|
||||
else
|
||||
local ver = ac:get_version()
|
||||
if vuln_versions[ver['major']] and vuln_versions[ver['major']][ver['minor']] then
|
||||
if vuln_versions[ver['major']][ver['minor']] > tonumber(ver['rev']) then
|
||||
|
|
|
|||
|
|
@ -68,8 +68,10 @@ Cisco Adaptive Security Appliance (ASA) Software 8.x before 8.2(5.48), 8.3 befor
|
|||
|
||||
local report = vulns.Report:new(SCRIPT_NAME, host, port)
|
||||
local ac = anyconnect.Cisco.AnyConnect:new(host, port)
|
||||
local status = ac:connect()
|
||||
if status then
|
||||
local status, err = ac:connect()
|
||||
if not status then
|
||||
return ("\n ERROR: %s"):format(err)
|
||||
else
|
||||
local ver = ac:get_version()
|
||||
if vuln_versions[ver['major']] and vuln_versions[ver['major']][ver['minor']] then
|
||||
if vuln_versions[ver['major']][ver['minor']] > tonumber(ver['rev']) then
|
||||
|
|
|
|||
|
|
@ -69,8 +69,10 @@ The SSL VPN implementation in Cisco Adaptive Security Appliance (ASA) Software 8
|
|||
|
||||
local report = vulns.Report:new(SCRIPT_NAME, host, port)
|
||||
local ac = anyconnect.Cisco.AnyConnect:new(host, port)
|
||||
local status = ac:connect()
|
||||
if status then
|
||||
local status, err = ac:connect()
|
||||
if not status then
|
||||
return ("\n ERROR: %s"):format(err)
|
||||
else
|
||||
local ver = ac:get_version()
|
||||
if vuln_versions[ver['major']] and vuln_versions[ver['major']][ver['minor']] then
|
||||
if vuln_versions[ver['major']][ver['minor']] > tonumber(ver['rev']) then
|
||||
|
|
|
|||
|
|
@ -66,8 +66,10 @@ The SIP inspection engine in Cisco Adaptive Security Appliance (ASA) Software 8.
|
|||
|
||||
local report = vulns.Report:new(SCRIPT_NAME, host, port)
|
||||
local ac = anyconnect.Cisco.AnyConnect:new(host, port)
|
||||
local status = ac:connect()
|
||||
if status then
|
||||
local status, err = ac:connect()
|
||||
if not status then
|
||||
return ("\n ERROR: %s"):format(err)
|
||||
else
|
||||
local ver = ac:get_version()
|
||||
if vuln_versions[ver['major']] and vuln_versions[ver['major']][ver['minor']] then
|
||||
if vuln_versions[ver['major']][ver['minor']] > tonumber(ver['rev']) then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue