Home page logo
/

nmap-dev logo Nmap Development mailing list archives

Re: [BUG]? Unrecognized option --resume
From: "Rob Nicholls" <robert () everythingeverything co uk>
Date: Tue, 11 Dec 2007 14:35:50 -0000 (UTC)

I know, I know, bad practice to reply to myself, but I think I might have
found a solution. This error appears to have been spotted (and ignored?)
back in 2005: http://seclists.org/nmap-dev/2005/q1/0113.html

Anyway, after a bit of trial and error, it looks like the
CreateFileMapping call needs to use NULL instead of 0 for the
dwMaximumSizeHigh and dwMaximumSizeLow DWORDs. I think line 993 of
utils.cc should say:

gmap = CreateFileMapping (fd, NULL, mflags, NULL, NULL, NULL);

I also changed line 977 to:

  mflags = PAGE_READWRITE;

I did this because, according to
http://msdn2.microsoft.com/en-us/library/aa366537.aspx

"This parameter can be one of the following values"

But mflags is originally, if openflags != O_RDONLY, assigned the value
PAGE_READONLY | PAGE_READWRITE. Which looks wrong to me. According to the
link above, one or more of the *attributes* for the file mapping object
can be stated in that way after the page protection value, i.e. in the
form PAGE_READWRITE | SEC_COMMIT. Note: SEC_COMMIT is the default if
nothing is stated after the file protection parameter. Seeing as openflags
!= O_RDONLY, I think it makes more sense to simply put PAGE_READWRITE.
PAGE_READWRITE specifies that the file must be created with the
GENERIC_READ and GENERIC_WRITE access rights, which matches what's seen at
line 976. Note: I haven't tried changing 993 without modifying 977.

Anyway, after making the changes to lines 977 and 993 and compiling, I now
get:

nmap --resume testresume
Unable to parse supposed log file testresume.  Perhaps the Nmap execution
had not finished at least one host?  In that case there is no use
"resuming"
QUITTING!

Which looks a lot healthier (no more pfatal!). At some point I'll run a
longer scan so it'll save something to the file for me to resume. Perhaps
after I finish my late lunch.

Apologies for not sending a diff, I haven't worked out how to create them
yet *blush* but at least it's only (1 or) 2 lines of code that need to be
modified.


Rob



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


  By Date           By Thread  

Current thread:
[ Nmap | Sec Tools | Mailing Lists | Site News | About/Contact | Advertising | Privacy ]