Nmap Development mailing list archives

Re: Adding new NSE discovered targets to Nmap


From: David Fifield <david () bamsoftware com>
Date: Sun, 19 Sep 2010 22:34:32 -0700

On Sun, Aug 15, 2010 at 07:00:25PM -0700, Fyodor wrote:
On Fri, Aug 13, 2010 at 06:22:31PM +0200, Patrik Karlsson wrote:

nsp_new() is called for NSE in nse_nsock.cc in luaopen_nsock(). To
enable broadcast, a call to nsp_setbroadcast() must be made after that
call.

I guess this is not currently possible and would require an
additional function (eg: setbroadcast in nse_nsock.cc) accessible to
NSE Lua right?

If we find proof that it is useful, we can probably just enable this
for all NSE sockets.  I think Nmap already sets the broadcast flag for
it's connect()-based host discovery and port scanning, and Ncat now
does this too (Ncat uses the nsp_setbraodcast() function mentioned by
Daniel).  So if setting this enables a useful script to work, and we
don't identify any problems with using the flag, then we might just
set it in all cases rather than provide it as an optional function.

I tested this for receiving broadcasts; receiving works with or without
nsp_setbroadcast on Linux. What prevents it from working is connecting
the socket (even "connecting" the UDP socket to 0.0.0.0). I commented
out the connect call in nsock_connect_internal for these tests.

David Fifield
_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://seclists.org/nmap-dev/


Current thread: