-
Notifications
You must be signed in to change notification settings - Fork 11
/
fsl-tb-detect.nse
42 lines (35 loc) · 1.16 KB
/
fsl-tb-detect.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
local http = require "http"
local shortport = require "shortport"
local string = require "string"
description = [[
Checks for the FSL Test Bench web interface.
]]
author = "Fabian Affolter"
license = "Same as Nmap--See http://nmap.org/book/man-legal.html"
categories = {"discovery", "safe"}
---
-- @usage
-- nmap --script fsl-tb-detect <host>
--
--@output
-- Nmap scan report for testbench01.lab-ex.security (10.0.0.64)
-- PORT STATE SERVICE
-- 80/tcp open http
-- |_fsl-tb-detect: Fedora Security Lab Test bench Web interface FOUND.
-- Changelog:
-- 2013-05-09 Fabian Affolter <[email protected]>:
-- + initial release
-- 2014-02-22 Fabian Affolter <[email protected]>:
-- + update @usage
portrule = shortport.http
action = function(host, port)
local resp, title
resp = http.get( host, port, '/' )
title = string.match(resp.body, "<[Tt][Ii][Tt][Ll][Ee][^>]*>([^<]*)</[Tt][Ii][Tt][Ll][Ee]>")
if string.find(title, "Fedora Security Lab Test bench") then
title = "Fedora Security Lab Test bench Web interface FOUND."
else
title = "Fedora Security Lab Test bench Web interface NOT found."
end
return title
end