Nmap Development mailing list archives

RE: [Bug]? -iR <num_hosts> on windows XP generates duplicate targets


From: "Thomas Buchanan" <TBuchanan () thecompassgrp net>
Date: Wed, 23 Apr 2008 22:57:41 -0500

-----Original Message-----
From: nmap-dev-bounces () insecure org 
[mailto:nmap-dev-bounces () insecure org] On Behalf Of Brandon Enright
Sent: Wednesday, April 23, 2008 10:38 PM
To: Fyodor
Cc: nmap-dev; jah; bmenrigh () ucsd edu
Subject: Re: [Bug]? -iR <num_hosts> on windows XP generates 
duplicate targets

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wed, 23 Apr 2008 20:30:30 -0700 or thereabouts Fyodor
<fyodor () insecure org> wrote:

I just checked in this fix, which seems to fix the problem in my
testing.  I moved the Nmap srand to be much earlier in the code to
reduce the chances of it clobbering other srand() calls, and I also
made it unique from the srand() call used by nbase.  Thanks 
to Jah and
Brandon for your help.


Hmm, I don't think we're out of the woods yet.  I think we're hitting
a very short cycle problem of Visual Studio's rand LCG that won't show
up using GCC on Linux.

We may need to use rand_s() on Windows.

I just sent a follow up note to your previous one.  I don't have a
Windows dev box or I'd help test this.

Brandon


The new code certainly looks better on my system:  Windows XP Pro SP2
w/VS Express 2005

Nmap 4.60 downloaded from nmap.org:

Thomas Buchanan@xp-shuttle /cygdrive/d/Utils/nmap-4.60
$ for i in 100 200 400 600 800 1200 1600 3200 6400 10000 100000 ; do
COUNT=`./nmap -n -sL -iR $i | egrep '^Host' | sort -u |wc -l`; echo $i
$COUNT; done
100 100
200 200
400 351
600 354
800 432
1200 843
1600 1258
3200 2863
6400 6035
10000 9637
100000 99649

Nmap built from svn at revision 7183:

Thomas Buchanan@xp-shuttle /cygdrive/e/Dev/svn/nmap/mswin32/Release
$ for i in 100 200 400 600 800 1200 1600 3200 6400 10000 100000 ; do
COUNT=`./nmap -n -sL -iR $i | egrep '^Host' | sort -u |wc -l`; echo $i
$COUNT; done
100 100
200 200
400 400
600 600
800 800
1200 1200
1600 1600
3200 3200
6400 6400
10000 10000
100000 99999


Thomas

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


Current thread: