| local anyconnect = require('anyconnect') |
| local stdnse = require('stdnse') |
| local shortport = require('shortport') |
| local nmap = require('nmap') |
| |
| description = [[ |
| Connect as Cisco AnyConnect client to a Cisco SSL VPN and retrieves version |
| and tunnel information. |
| ]] |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| author = "Patrik Karlsson <patrik@cqure.net>" |
| license = "Same as Nmap--See https://nmap.org/book/man-legal.html" |
| categories = {"default", "discovery", "safe"} |
| |
| portrule = function(host, port) |
| return shortport.ssl(host, port) and shortport.http(host, port) |
| end |
| |
| action = function(host, port) |
| local ac = anyconnect.Cisco.AnyConnect:new(host, port) |
| local status, err = ac:connect() |
| if not status then |
| return stdnse.format_output(false, err) |
| else |
| local o = stdnse.output_table() |
| local xmltags = { 'version', 'tunnel-group', 'group-alias', |
| 'config-hash', 'host-scan-ticket', 'host-scan-token', |
| 'host-scan-base-uri', 'host-scan-wait-uri', 'host' } |
| |
| |
| if nmap.verbosity() > 2 then xmltags[#xmltags] = 'banner' end |
| |
| for _, tag in ipairs(xmltags) do |
| o[tag] = ac.conn_attr[tag] |
| end |
| return o |
| end |
| end |