Nmap Development mailing list archives

nmap quits from scanning in NT4/95 - patch


From: "Ganga Bhavani" <GBhavani () everdreamcorp com>
Date: Thu, 2 Dec 2004 16:43:41 -0800


In Windows NT4/Windows 95, nmap quits scanning if the scanning host is included in the target host range. for eg: If 
the ip address of the host running nmap is 10.10.191.20 and nmap is executed with "nmap -O 10.10.191.0/24" or "nmap -O 
10.10.191.15-21" the entire scanning quits because the range includes the scanning host ip. 

I have come up with the following patch where nmap doesnt quit if the pcapname is not available for the loopback 
address(localhost), and proceeds with the scanning. Please let me know if you see any issues with this patch.

Thanks,
Ganga


The diff looks as follows:

--- winip.c.org 2004-12-02 15:58:29.264122400 -0800
+++ winip.c     2004-12-02 16:22:38.702608200 -0800
@@ -713,8 +713,11 @@
       if(0 != ifi2ipaddr(ifi, &sin_source.sin_addr))
  fatal("routethrough: no IP for device %s\n", ifi2name(ifi));

-      if(!rawsock_avail && !iftable[ifi].pcapname) return NULL;
-
+         if(!rawsock_avail && !iftable[ifi].pcapname) {
+               // proceed if it is a localhost
+               if(sin_source.sin_addr.s_addr != htonl(INADDR_LOOPBACK))
+                       return NULL;
+         }
       strcpy(dev, ifi2name(ifi));
     }
   else


--- pcapsend.c.org      2004-12-02 15:59:52.697658800 -0800
+++ pcapsend.c  2004-12-02 16:02:42.240524600 -0800
@@ -792,7 +792,7 @@
        }

        target_ifentry = ifi2ifentry(ifi);
-       if(!target_ifentry || !target_ifentry->pcapname)
+       if((!target_ifentry || !target_ifentry->pcapname) && rawsock_avail)
                return fallback_raw_send(packet, len, to, tolen);

        //      check the failcache

Attachment: winip.c.patch
Description: winip.c.patch

Attachment: pcapsend.c.patch
Description: pcapsend.c.patch

---------------------------------------------------------------------
For help using this (nmap-dev) mailing list, send a blank email to 
nmap-dev-help () insecure org . List archive: http://seclists.org

Current thread: