1
0
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:
david
2010-10-01 06:26:22 +00:00
parent df99409651
commit 87ee8343f3
2 changed files with 52 additions and 0 deletions

15
scripts/broadcast.nse Normal file
View 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