mirror of
https://github.com/nmap/nmap.git
synced 2025-12-15 04:09:01 +00:00
o Added a new NSE Comm library for common network discovery tasks such
as banner-grabbing (get_banner()) and making a quick exchange of data (exchange()). 16 scripts were updated to use this library. [Kris] I have *not* been able to test all of these scripts; however, I have reviewed them and they should all work properly. I would really like some more testing, though :) This commit includes scripting.xml documentation.
This commit is contained in:
@@ -9,23 +9,15 @@ license = "Same as Nmap--See http://nmap.org/book/man-legal.html"
|
||||
|
||||
categories = {"malware"}
|
||||
|
||||
require "comm"
|
||||
require "shortport"
|
||||
|
||||
portrule = shortport.port_or_service(113, "auth")
|
||||
|
||||
action = function(host, port)
|
||||
local status = 0
|
||||
local owner = ""
|
||||
local status, owner = comm.get_banner(host, port, {lines=1})
|
||||
|
||||
local client_ident = nmap.new_socket()
|
||||
|
||||
client_ident:connect(host.ip, port.number)
|
||||
|
||||
status, owner = client_ident:receive_lines(1)
|
||||
|
||||
client_ident:close()
|
||||
|
||||
if owner == "TIMEOUT" then
|
||||
if not status then
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user