-
Notifications
You must be signed in to change notification settings - Fork 0
/
crushftp-detect.nse
34 lines (27 loc) · 1.03 KB
/
crushftp-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
local http = require "http"
local stdnse = require "stdnse"
description = [[
This script checks if CrushFTP is detected on a web server.
]]
author = "Nithen Naidoo"
license = "Same as Nmap - See https://nmap.org/book/man-legal.html"
categories = {"default", "discovery"}
-- Define the script arguments (optional)
portrule = function(host, port)
return port.number == 80 or port.number == 443
end
-- Main function
action = function(host, port)
local path = "/WebInterface/login.html"
local url = string.format("http://%s:%d%s", host.targetname or host.ip, port.number, path)
stdnse.print_debug(1, "Checking for resource: %s", url)
-- Perform the HTTP request
local response = http.get(host, port, path)
if response and response.status == 200 then
return string.format("Resource %s CrushFTP found (Status: %d)", url, response.status)
elseif response then
return string.format("Resource %s CrushFTP not found (Status: %d)", url, response.status)
else
return string.format("Failed to connect to %s", url)
end
end