mirror of
https://github.com/nmap/nmap.git
synced 2025-12-06 12:41:29 +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:
@@ -89,20 +89,25 @@ Cisco = {
|
|||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
local path = '/'
|
||||||
local response = http.head(self.host, self.port, '/', options)
|
local response = http.head(self.host, self.port, path, options)
|
||||||
-- account for redirects
|
-- account for redirects
|
||||||
if not response.status == 200 then
|
if not response.status == 200 then
|
||||||
return false, "Failed to connect to SSL VPN server"
|
return false, "Failed to connect to SSL VPN server"
|
||||||
elseif response.location then
|
elseif response.location then
|
||||||
local u = url.parse(response.location[#response.location])
|
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
|
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
|
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
|
end
|
||||||
|
|
||||||
local xmltags = {
|
local xmltags = {
|
||||||
@@ -126,6 +131,11 @@ Cisco = {
|
|||||||
self.conn_attr[tag] = m
|
self.conn_attr[tag] = m
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if not self.conn_attr['version'] then
|
||||||
|
return false, "Not a Cisco ASA or unsupported version"
|
||||||
|
end
|
||||||
|
|
||||||
-- in case we were redirected
|
-- in case we were redirected
|
||||||
self.conn_attr['host'] = stdnse.get_hostname(self.host)
|
self.conn_attr['host'] = stdnse.get_hostname(self.host)
|
||||||
return true
|
return true
|
||||||
|
|||||||
@@ -41,8 +41,10 @@ end
|
|||||||
|
|
||||||
action = function(host, port)
|
action = function(host, port)
|
||||||
local ac = anyconnect.Cisco.AnyConnect:new(host, port)
|
local ac = anyconnect.Cisco.AnyConnect:new(host, port)
|
||||||
local status = ac:connect()
|
local status, err = ac:connect()
|
||||||
if status then
|
if not status then
|
||||||
|
return ("\n ERROR: %s"):format(err)
|
||||||
|
else
|
||||||
local o = stdnse.output_table()
|
local o = stdnse.output_table()
|
||||||
local xmltags = { 'version', 'tunnel-group', 'group-alias',
|
local xmltags = { 'version', 'tunnel-group', 'group-alias',
|
||||||
'config-hash', 'host-scan-ticket', 'host-scan-token',
|
'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 report = vulns.Report:new(SCRIPT_NAME, host, port)
|
||||||
local ac = anyconnect.Cisco.AnyConnect:new(host, port)
|
local ac = anyconnect.Cisco.AnyConnect:new(host, port)
|
||||||
local status = ac:connect()
|
local status, err = ac:connect()
|
||||||
if status then
|
if not status then
|
||||||
|
return ("\n ERROR: %s"):format(err)
|
||||||
|
else
|
||||||
local ver = ac:get_version()
|
local ver = ac:get_version()
|
||||||
if vuln_versions[ver['major']] and vuln_versions[ver['major']][ver['minor']] then
|
if vuln_versions[ver['major']] and vuln_versions[ver['major']][ver['minor']] then
|
||||||
if vuln_versions[ver['major']][ver['minor']] > tonumber(ver['rev']) 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 report = vulns.Report:new(SCRIPT_NAME, host, port)
|
||||||
local ac = anyconnect.Cisco.AnyConnect:new(host, port)
|
local ac = anyconnect.Cisco.AnyConnect:new(host, port)
|
||||||
local status = ac:connect()
|
local status, err = ac:connect()
|
||||||
if status then
|
if not status then
|
||||||
|
return ("\n ERROR: %s"):format(err)
|
||||||
|
else
|
||||||
local ver = ac:get_version()
|
local ver = ac:get_version()
|
||||||
if vuln_versions[ver['major']] and vuln_versions[ver['major']][ver['minor']] then
|
if vuln_versions[ver['major']] and vuln_versions[ver['major']][ver['minor']] then
|
||||||
if vuln_versions[ver['major']][ver['minor']] > tonumber(ver['rev']) 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 report = vulns.Report:new(SCRIPT_NAME, host, port)
|
||||||
local ac = anyconnect.Cisco.AnyConnect:new(host, port)
|
local ac = anyconnect.Cisco.AnyConnect:new(host, port)
|
||||||
local status = ac:connect()
|
local status, err = ac:connect()
|
||||||
if status then
|
if not status then
|
||||||
|
return ("\n ERROR: %s"):format(err)
|
||||||
|
else
|
||||||
local ver = ac:get_version()
|
local ver = ac:get_version()
|
||||||
if vuln_versions[ver['major']] and vuln_versions[ver['major']][ver['minor']] then
|
if vuln_versions[ver['major']] and vuln_versions[ver['major']][ver['minor']] then
|
||||||
if vuln_versions[ver['major']][ver['minor']] > tonumber(ver['rev']) 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 report = vulns.Report:new(SCRIPT_NAME, host, port)
|
||||||
local ac = anyconnect.Cisco.AnyConnect:new(host, port)
|
local ac = anyconnect.Cisco.AnyConnect:new(host, port)
|
||||||
local status = ac:connect()
|
local status, err = ac:connect()
|
||||||
if status then
|
if not status then
|
||||||
|
return ("\n ERROR: %s"):format(err)
|
||||||
|
else
|
||||||
local ver = ac:get_version()
|
local ver = ac:get_version()
|
||||||
if vuln_versions[ver['major']] and vuln_versions[ver['major']][ver['minor']] then
|
if vuln_versions[ver['major']] and vuln_versions[ver['major']][ver['minor']] then
|
||||||
if vuln_versions[ver['major']][ver['minor']] > tonumber(ver['rev']) then
|
if vuln_versions[ver['major']][ver['minor']] > tonumber(ver['rev']) then
|
||||||
|
|||||||
Reference in New Issue
Block a user