Nmap Development mailing list archives

Re: [PATCH] Random decoy (-D) addresses


From: "Eddie Bell" <ejlbell () gmail com>
Date: Mon, 4 Jun 2007 15:44:58 +0100

hi kris,

I was thinking it might also be useful to add something like '-D 10'
to send 10 randomly address decoys and let nmap decide where to put
the real one.

- eddie

On 01/06/07, Kris Katterjohn <katterjohn () gmail com> wrote:
Hey nmap-dev!

I attached a patch to add a "rnd" option to -D to generate a random,
non-reserved IP address for decoys.

I initially wrote this patch because I just wanted to be able to
generate traffic without having to type in a bunch of IP addresses by
hand when '-D rnd,rnd,rnd' etc. was easier (and with such a small
patch).  I thought that this might be useful for others sometimes (and
for other reasons), so I'm sending it here.  If people like it, I'll
stick it in the soc07 branch.

Well, please let me know what you think!


Thanks,
Kris Katterjohn

Index: nmap.cc
===================================================================
--- nmap.cc     (revision 4801)
+++ nmap.cc     (working copy)
@@ -892,6 +892,11 @@
          if (o.decoyturn != -1)
            fatal("Can only use 'ME' as a decoy once.\n");
          o.decoyturn = o.numdecoys++;
+       } else if (!strcasecmp(p, "rnd")) {
+         do {
+           o.decoys[o.numdecoys].s_addr = get_random_u32();
+         } while (ip_is_reserved(&o.decoys[o.numdecoys]));
+         o.numdecoys++;
        } else {
          if (o.numdecoys >= MAX_DECOYS -1)
            fatal("You are only allowed %d decoys (if you need more redefine MAX_DECOYS in nmap.h)", MAX_DECOYS);


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



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


Current thread: