mirror of
https://github.com/nmap/nmap.git
synced 2025-12-09 22:21:29 +00:00
Adding back my '-D rnd' from soc07 which I guess was lost in the move back here to /nmap
This commit is contained in:
@@ -2525,7 +2525,9 @@ lists the relevant options and describes what they do.</para>
|
|||||||
common port scan detectors (such as Solar Designer's
|
common port scan detectors (such as Solar Designer's
|
||||||
excellent scanlogd) are unlikely to show your IP address at
|
excellent scanlogd) are unlikely to show your IP address at
|
||||||
all. If you don't use <literal>ME</literal>, nmap will put
|
all. If you don't use <literal>ME</literal>, nmap will put
|
||||||
you in a random position.</para> <para>Note that the hosts
|
you in a random position. You can also use RND to generate
|
||||||
|
a random, non-reserved IP address, or RND:<number> to
|
||||||
|
generate <number> addresses.</para> <para>Note that the hosts
|
||||||
you use as decoys should be up or you might accidentally SYN
|
you use as decoys should be up or you might accidentally SYN
|
||||||
flood your targets. Also it will be pretty easy to determine
|
flood your targets. Also it will be pretty easy to determine
|
||||||
which host is scanning if only one is actually up on the
|
which host is scanning if only one is actually up on the
|
||||||
|
|||||||
19
nmap.cc
19
nmap.cc
@@ -918,6 +918,25 @@ int nmap_main(int argc, char *argv[]) {
|
|||||||
if (o.decoyturn != -1)
|
if (o.decoyturn != -1)
|
||||||
fatal("Can only use 'ME' as a decoy once.\n");
|
fatal("Can only use 'ME' as a decoy once.\n");
|
||||||
o.decoyturn = o.numdecoys++;
|
o.decoyturn = o.numdecoys++;
|
||||||
|
} else if (!strcasecmp(p, "rnd") || !strncasecmp(p, "rnd:", 4)) {
|
||||||
|
int i = 1;
|
||||||
|
|
||||||
|
/* 'rnd:' is allowed and just gives them one */
|
||||||
|
if (strlen(p) > 4)
|
||||||
|
i = atoi(&p[4]);
|
||||||
|
|
||||||
|
if (i < 1)
|
||||||
|
fatal("Bad 'rnd' decoy \"%s\"", p);
|
||||||
|
|
||||||
|
if (o.numdecoys + i >= MAX_DECOYS - 1)
|
||||||
|
fatal("You are only allowed %d decoys (if you need more redefine MAX_DECOYS in nmap.h)", MAX_DECOYS);
|
||||||
|
|
||||||
|
while (i--) {
|
||||||
|
do {
|
||||||
|
o.decoys[o.numdecoys].s_addr = get_random_u32();
|
||||||
|
} while (ip_is_reserved(&o.decoys[o.numdecoys]));
|
||||||
|
o.numdecoys++;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (o.numdecoys >= MAX_DECOYS -1)
|
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);
|
fatal("You are only allowed %d decoys (if you need more redefine MAX_DECOYS in nmap.h)", MAX_DECOYS);
|
||||||
|
|||||||
Reference in New Issue
Block a user