1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-29 02:49:01 +00:00

Apply a patch from Toni Ruottu with some small misc. improvements to the netbus-* scripts. Also I changed netbus-auth-bypass to the safe category as recommended by Toni

This commit is contained in:
fyodor
2011-01-15 21:28:45 +00:00
parent aef6f90991
commit b27c8e29d7
4 changed files with 32 additions and 12 deletions

View File

@@ -18,6 +18,9 @@ and an smtp-server used for notification delivery.
]]
---
-- @usage
-- nmap -p 12345 --script netbus-info <target> --script-args netbus-info.password=<password>
--
-- @output
-- 12345/tcp open netbus
-- | netbus-info:
@@ -41,6 +44,8 @@ and an smtp-server used for notification delivery.
-- | Wave: 0
-- | Synth: 0
-- |_ Cd: 0
--
-- @args netbus-info.password The password used for authentication
author = "Toni Ruottu"
license = "Same as Nmap--See http://nmap.org/book/man-legal.html"
@@ -123,12 +128,14 @@ local function format_volume(volume)
end
action = function( host, port )
local password = nmap.registry.netbuspassword
if password == nil then
password = ""
local password = nmap.registry.args[SCRIPT_NAME .. ".password"]
if not password and nmap.registry.netbuspasswords then
local key = string.format("%s:%d", host.ip, port.number)
password = nmap.registry.netbuspasswords[key]
end
if not password then
password = ""
end
local socket = nmap.new_socket()
socket:set_timeout(5000)
local status, err = socket:connect(host.ip, port.number)
@@ -153,7 +160,6 @@ action = function( host, port )
socket:close()
local response = {}
table.insert(response, "")
table.insert(response, format_acl(acl))
table.insert(response, format_apps(apps))
table.insert(response, format_info(info))