-
Notifications
You must be signed in to change notification settings - Fork 3
/
1125-http-cisco-webvpn-cookie.nse
66 lines (57 loc) · 1.69 KB
/
1125-http-cisco-webvpn-cookie.nse
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
description = [[
Looks for webvpn cookies that could denote a Cisco ASA SSL VPN WebVPN Service
is enabled on a port. This may also apply to a Cisco IOS based router
running the Client SSLVPN Service which is rare but possible.
]]
local http = require "http"
local shortport = require "shortport"
local stdnse = require "stdnse"
local table = require "table"
---
-- @usage
-- nmap -p <port> --script http-bigip-cookie <target>
--
-- @output
-- PORT STATE SERVICE
-- 443/tcp open http
-- | http-cisco-webvpn-cookie:
-- | webvpn:
-- | Potential Cisco SSLVPN Cookie Found
-- | webvpn_as:
-- |_ Potential Cisco SSLVPN Cookie Found
--
-- @xmloutput
-- <table key="webvpn">
-- <table key="webvpn">
-- <elem key="message">Potential Cisco SSLVPN Cookie Found</elem>
-- </table>
-- </table>
--
-- @args http-cisco-webvpn-cookie.path The URL path to request. The default path is "/".
author = "mosesrenegade"
license = "Same as Nmap--See https://nmap.org/book/man-legal.html"
categories = { "discovery", "safe" }
portrule = shortport.http
action = function(host, port,redirect_ok)
local path = stdnse.get_script_args(SCRIPT_NAME..".path") or "/"
local response = http.get(host, port, path, { redirect_ok = false })
if not response then
return
end
if not response.cookies then
return
end
local output = stdnse.output_table()
for _, cookie in ipairs(response.cookies) do
if cookie.name:find("webvpn") then
local host, port = cookie.value:match("webvpn")
if http.response_contains("+CSCOE+") then
local result = {"Potential SSLVPN Cookie Found"}
output[cookie.name] = result
end
end
end
if #output > 0 then
return output
end
end