mirror of
https://github.com/nmap/nmap.git
synced 2025-12-28 02:19:04 +00:00
Provide a new nsock_setup_udp function to create a UDP socket without connecting it. Provide an NSE interface to the function. Add broadcast.nse, a script that receives UDP broadcasts with an unconnected socket.
This commit is contained in:
15
scripts/broadcast.nse
Normal file
15
scripts/broadcast.nse
Normal file
@@ -0,0 +1,15 @@
|
||||
description = ""
|
||||
categories = {}
|
||||
|
||||
prerule = function() return true end
|
||||
|
||||
action = function()
|
||||
local s, status, data
|
||||
|
||||
s = nmap.new_socket()
|
||||
s:bind("255.255.255.255", 67)
|
||||
s:setup("ipv4", "udp")
|
||||
status, data = s:receive()
|
||||
|
||||
return data
|
||||
end
|
||||
Reference in New Issue
Block a user