Nmap Development mailing list archives

Re: Scans failing on Win32 - failures differ depending on args len(maybe)


From: David Fifield <david () bamsoftware com>
Date: Mon, 10 Oct 2011 19:39:13 -0600

On Fri, Oct 07, 2011 at 03:26:07PM +0100, jah wrote:
On 07/10/2011 14:52, Gisle Vanem wrote:
DEV  (SHORT) IP/MASK                     TYPE        UP   MTU  MAC
eth0 (eth0)  192.168.1.15/24             ethernet    up   1500 00:19:21:3D:3F:CE
eth0 (eth0)  fe80::219:21ff:fe3d:3fce/64 ethernet    up   1500 00:19:21:3D:3F:CE

You can try to add "-e eth0 --privileged" to the command-line.
See the 'o.isr00t' stuff in mswin32/winfix.cc. Or disable the
__HrLoadAllImportsForDll() sillyness therein.

These results differ based on the position of
"-e eth0 --privileged" in the args list:

nmap -F -v -v -d -n 195.166.128.231
MS-DOS - FAIL - route_dst_generic: Failed to obtain system routes:
                getsysroutes_dnet: sysroutes_dnet_find_interfaces()
                failed

nmap -F -v -v -d -n 195.166.128.231 -e eth0 --privileged
MS-DOS - FAIL - pcap_open_live(eth0, 256, 0, 2) FAILED.
                Reported error: Error opening adapter:
                The system cannot find the device specified. (20).
                Will wait 5 seconds then retry.
                ... Call to pcap_open_live() failed three times...

nmap -e eth0 --privileged -F -v -v -d -n 195.166.128.231
MS-DOS - SUCCESS

I bet there's a really simple explanation and I'm just not seeing the
wood for the trees.

That's a good clue. This may be a long shot, but please try this patch.
It defers calling win_init until option processing is finished,
including the options that have to wait to be processed until after the
whole command line has been seen.

The delayed option processing is a new thing added by Shinnok this
summer, which would explain why we haven't seen this error before.

David Fifield

Attachment: win_init.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: