mirror of
https://github.com/nmap/nmap.git
synced 2025-12-06 12:41:29 +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:
@@ -10,13 +10,16 @@ and login to the service by typing Password;1; into the console.
|
|||||||
]]
|
]]
|
||||||
|
|
||||||
---
|
---
|
||||||
|
-- @usage
|
||||||
|
-- nmap -p 12345 --script netbus-auth-bypass <target>
|
||||||
|
--
|
||||||
-- @output
|
-- @output
|
||||||
-- 12345/tcp open netbus
|
-- 12345/tcp open netbus
|
||||||
-- |_netbus-auth-bypass: Vulnerable
|
-- |_netbus-auth-bypass: Vulnerable
|
||||||
|
|
||||||
author = "Toni Ruottu"
|
author = "Toni Ruottu"
|
||||||
license = "Same as Nmap--See http://nmap.org/book/man-legal.html"
|
license = "Same as Nmap--See http://nmap.org/book/man-legal.html"
|
||||||
categories = {"auth", "intrusive", "vuln"}
|
categories = {"auth", "safe", "vuln"}
|
||||||
|
|
||||||
require("nmap")
|
require("nmap")
|
||||||
require("stdnse")
|
require("stdnse")
|
||||||
@@ -50,6 +53,6 @@ action = function( host, port )
|
|||||||
if buffer() == "Access;1" then
|
if buffer() == "Access;1" then
|
||||||
return "Vulnerable"
|
return "Vulnerable"
|
||||||
end
|
end
|
||||||
return
|
return "Not vulnerable, but password is empty"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,9 @@ Performs brute force password auditing about the Netbus backdoor ("remote admini
|
|||||||
]]
|
]]
|
||||||
|
|
||||||
---
|
---
|
||||||
|
-- @usage
|
||||||
|
-- nmap -p 12345 --script netbus-brute <target>
|
||||||
|
--
|
||||||
-- @output
|
-- @output
|
||||||
-- 12345/tcp open netbus
|
-- 12345/tcp open netbus
|
||||||
-- |_netbus-brute: password123
|
-- |_netbus-brute: password123
|
||||||
@@ -36,13 +39,18 @@ action = function( host, port )
|
|||||||
local login = buffer()
|
local login = buffer()
|
||||||
if login == "Access;1" then
|
if login == "Access;1" then
|
||||||
-- Store the password for other netbus scripts
|
-- Store the password for other netbus scripts
|
||||||
nmap.registry.netbuspassword=password
|
local key = string.format("%s:%d", host.ip, port.number)
|
||||||
|
if not nmap.registry.netbuspasswords then
|
||||||
|
nmap.registry.netbuspasswords = {}
|
||||||
|
end
|
||||||
|
nmap.registry.netbuspasswords[key] = password
|
||||||
|
if password == "" then
|
||||||
|
return "<empty>"
|
||||||
|
end
|
||||||
return string.format("%s", password)
|
return string.format("%s", password)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
socket:close()
|
socket:close()
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
-- @output
|
||||||
-- 12345/tcp open netbus
|
-- 12345/tcp open netbus
|
||||||
-- | netbus-info:
|
-- | netbus-info:
|
||||||
@@ -41,6 +44,8 @@ and an smtp-server used for notification delivery.
|
|||||||
-- | Wave: 0
|
-- | Wave: 0
|
||||||
-- | Synth: 0
|
-- | Synth: 0
|
||||||
-- |_ Cd: 0
|
-- |_ Cd: 0
|
||||||
|
--
|
||||||
|
-- @args netbus-info.password The password used for authentication
|
||||||
|
|
||||||
author = "Toni Ruottu"
|
author = "Toni Ruottu"
|
||||||
license = "Same as Nmap--See http://nmap.org/book/man-legal.html"
|
license = "Same as Nmap--See http://nmap.org/book/man-legal.html"
|
||||||
@@ -123,12 +128,14 @@ local function format_volume(volume)
|
|||||||
end
|
end
|
||||||
|
|
||||||
action = function( host, port )
|
action = function( host, port )
|
||||||
|
local password = nmap.registry.args[SCRIPT_NAME .. ".password"]
|
||||||
local password = nmap.registry.netbuspassword
|
if not password and nmap.registry.netbuspasswords then
|
||||||
if password == nil then
|
local key = string.format("%s:%d", host.ip, port.number)
|
||||||
password = ""
|
password = nmap.registry.netbuspasswords[key]
|
||||||
|
end
|
||||||
|
if not password then
|
||||||
|
password = ""
|
||||||
end
|
end
|
||||||
|
|
||||||
local socket = nmap.new_socket()
|
local socket = nmap.new_socket()
|
||||||
socket:set_timeout(5000)
|
socket:set_timeout(5000)
|
||||||
local status, err = socket:connect(host.ip, port.number)
|
local status, err = socket:connect(host.ip, port.number)
|
||||||
@@ -153,7 +160,6 @@ action = function( host, port )
|
|||||||
socket:close()
|
socket:close()
|
||||||
|
|
||||||
local response = {}
|
local response = {}
|
||||||
table.insert(response, "")
|
|
||||||
table.insert(response, format_acl(acl))
|
table.insert(response, format_acl(acl))
|
||||||
table.insert(response, format_apps(apps))
|
table.insert(response, format_apps(apps))
|
||||||
table.insert(response, format_info(info))
|
table.insert(response, format_info(info))
|
||||||
|
|||||||
@@ -4,6 +4,9 @@ that mimes NetBus.
|
|||||||
]]
|
]]
|
||||||
|
|
||||||
---
|
---
|
||||||
|
-- @usage
|
||||||
|
-- nmap -sV -p 12345 --script netbus-version <target>
|
||||||
|
--
|
||||||
-- @output
|
-- @output
|
||||||
-- 12345/tcp open netbus Netbuster (honeypot)
|
-- 12345/tcp open netbus Netbuster (honeypot)
|
||||||
|
|
||||||
@@ -15,7 +18,7 @@ require("nmap")
|
|||||||
require("stdnse")
|
require("stdnse")
|
||||||
require("shortport")
|
require("shortport")
|
||||||
|
|
||||||
portrule = shortport.version_port_or_service (12345, "netbus", {"tcp"})
|
portrule = shortport.version_port_or_service ({}, "netbus", {"tcp"})
|
||||||
|
|
||||||
action = function( host, port )
|
action = function( host, port )
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user