Nmap Development mailing list archives

Re: ncat broadcast support?


From: Daniel Miller <bonsaiviking () gmail com>
Date: Thu, 13 May 2010 17:19:14 -0500

On 05/13/2010 03:32 PM, Daniel Miller wrote:
On 05/12/2010 05:53 PM, Fyodor wrote:
My initial thought is that maybe we should have a function like
nsp_setbroadcast() which specifies whether, from that point on, all
newly created sockets should have SO_BROADCAST set.  I suppose it
should probably default to false, just like in the socket API.  But I
imagine that Ncat, Nping, and Nmap may want to enable this.  Ncrack,
on the other hand, may not.

The change would have to tested on Windows and UNIX.  If you really
can't get access to a Windows system, you may be able to recruit
testers on this list.

So I'd encourage you to write a patch, and I definitely encourage
other folks to chime in if they know stuff about SO_BROADCAST that we
don't, or if they have any other implementation ideas or concerns.

Cheers,
-F

This is the suggestion that I took. I have attached the patch, which appears to work well. I'll continue to test, and I'll see if I can try it on Windows, though I haven't compiled Nmap on Windows before. Anyone who would like to test this out would be more than welcome.

Dan
Found a couple errors while trying to compile on Windows (no prototype for nsp_setbroadcast, cast to void * instead of const char * in setsockopt call). Fixed patch attached.

Attachment: nmap-17545-1.diff
Description:

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

Current thread: