Last active
August 29, 2015 14:07
Revisions
-
d33tah revised this gist
Oct 5, 2014 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -24,7 +24,6 @@ categories = { "default", "discovery", "safe" } portrule = shortport.http action = function(host, port) local status, err, response local socket = nmap.new_socket() -
d33tah revised this gist
Oct 5, 2014 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -11,9 +11,9 @@ directory. -- nmap -p 80 --script http-websocket-test <target> -- -- @output -- PORT STATE SERVICE -- 80/tcp open http -- |_http-websocket-test: Websocket detected author = "Jacek Wielemborek" @@ -40,4 +40,4 @@ action = function(host, port) if response:find("Web Socket Protocol Handshake") then return "Websocket detected" end end -
d33tah created this gist
Oct 5, 2014 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,43 @@ local shortport = require "shortport" local stdnse = require "stdnse" description = [[ Detects whether the given server is running a WebSocket service on its root directory. ]] --- -- @usage -- nmap -p 80 --script http-websocket-test <target> -- -- @output --PORT STATE SERVICE --80/tcp open http --|_http-websocket-test: Websocket detected author = "Jacek Wielemborek" license = "Same as Nmap--See http://nmap.org/book/man-legal.html" categories = { "default", "discovery", "safe" } portrule = shortport.http action = function(host, port) local output = "" local status, err, response local socket = nmap.new_socket() socket:connect(host.ip, port) status, err = socket:send("GET / HTTP/1.1\r\n" .. "Upgrade: websocket\r\n" .. "Connection: Upgrade\r\n" .. "Host: " .. stdnse.get_hostname(host) .. "\r\n" .. "Sec-WebSocket-Key: AIRcKHNkSl6fYaPxjJgs+A==\r\n" .. "Sec-WebSocket-Version: 13\r\n\r\n") status, response = socket:receive_bytes(0) if response:find("Web Socket Protocol Handshake") then return "Websocket detected" end end