Nmap Development mailing list archives

Nmap on Vista - maybe UAC?


From: majek04 <majek04+nmap-dev () gmail com>
Date: Fri, 11 Apr 2008 01:34:24 +0200

c:\nmap -sS nmap.org
dnet: Failed to open device eth4
QUITTING!


As everybody knows, first run of nmap on Vista must be with
Administrator rights,
so that WinPcap driver gets loaded.


I thought it would be nice to get standard UAC window instead of that.
http://ai.pjwstk.edu.pl/~majek/private/nmap/nmap_uac.png


The code works like this:
  - if nmap can't open dnet interface (in tcpip.cc:eth_open_cached)
  - new instance of nmap is invoked using ShellExecute function
  - with parameter "runas" which should show the UAC dialog
  - new instance of nmap does nothing, except that it loads the WinPcap driver
  - we try to open the dnet interface once more (and it should succeed now)


This command is executed with Administrator priviledges when nmap
fails to open dnet interface:
nmap -sS -p80 -P0 -n -e <interface name, like eth4> 127.0.0.1
(nmap string is actually argv[0])

This command sucesfully loads WinPcap driver. I thought that it's
going to quickly fail, because
nmap can't scan localhost on windows. But it actually sends something,
which is not what
I intended.

Anyone has better idea for simplest nmap command that is going to load
winpcap drivers?

Can anyone tell me if this works for windows xp? (i mean when you run
nmap as normal user)


The code is here (uac code + fix for vs2008):
  svn://svn.insecure.org/nmap-exp/majek04/nmap-7011-vs2008

Oh, the project must be linked with shell32.lib.
I haven't updated the *sln or *vcproj files, so you must add this lib by hand.
(Alt+F7 -> configuration -> linker -> input -> additional
dependencies, add "shell32.lib" there)


Separate patches:
  vs2008 - http://ai.pjwstk.edu.pl/~majek/private/nmap/nmap-vs2008-2.diff
  uac    - http://ai.pjwstk.edu.pl/~majek/private/nmap/nmap-vista-uac.diff
  minor warnigs -
http://ai.pjwstk.edu.pl/~majek/private/nmap/nmap-minor-warnings.diff


Cheers!
 Marek Majkowski

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


Current thread: