Nmap Security Scanner
*Intro
*Ref Guide
*Install Guide
*Download
*Changelog
*Book
*Docs
Security Lists
*Nmap Hackers
*Nmap Dev
*Bugtraq
*Full Disclosure
*Pen Test
*Basics
*More
Security Tools
*Pass crackers
*Sniffers
*Vuln Scanners
*Web scanners
*Wireless
*Exploitation
*Packet crafters
*More
Site News
Site Search:
Exploit World
Advertising
About/Contact
Credits
Sponsors:
edgeos



Nmap Development: Re: nmap under win98

Re: nmap under win98

From: Andy Lutomirski <Luto_at_myrealbox.com>
Date: Tue, 15 Jan 2002 21:25:36 -0800

This should do it:

Change readip_rawrecv in rawrecv.c to this:

[note to fyodor: I'm fairly sure I already sent you this]

char *rawrecv_readip(pcap_t *pd, unsigned int *len, long to_usec)
{
 int rcvlen;
 DWORD time1, time2;
 fd_set fds;
 TIMEVAL tv;

 if(-2 != (long)pd)
  fatal("rawrecv_readip: called with non-rawrecv handle\n");

begin:

 // Note: I could use SO_RCVTIMEO but I don't trust it...
 time1 = GetTickCount();
 FD_ZERO(&fds);
 FD_SET(s, &fds);
 tv.tv_usec = to_usec % 1000000;
 tv.tv_sec = to_usec / 1000000;
 if(0 == select(0, &fds, 0, 0, &tv))
 {
  if(len) *len = 0;
  return 0;
 }

 rcvlen = recv(s, buf, sizeof(buf), 0);
 time2 = GetTickCount() + 10;

 if(rcvlen > 0)
 {
  if(rcvlen >= sizeof(struct ip) && filter(buf, rcvlen))
  {
   if(len) *len = rcvlen;
   return buf;
  }
  else
  {
   to_usec -= 1000 * (time2 - time1);
   if(to_usec < 0)
   {
    if(len) *len = 0;
    return 0;
   }
   goto begin;
  }
 }
 else
 {
  DWORD err = WSAGetLastError();
  if(err != WSAETIMEDOUT && err != WSAEWOULDBLOCK)
   fatal("rawrecv: recv failed (%lu)\n", err);

  if(len) *len = 0;
  return 0;
 }
}

Andy

----- Original Message -----
From: "Kevin Davis" <kevin.davis_at_mindless.com>
To: <nmap-dev_at_insecure.org>
Sent: Tuesday, January 15, 2002 4:50 PM
Subject: Re: nmap under win98

> I've been getting nmap crashing on some W2K and WXP boxes. This does not
> happen on all of these type boxes but exclusively with Beta30. Beta29 does
> not seem to have this problem.
>
> Any ideas?
>
>
> ----- Original Message -----
> From: "testic" <testic_at_btinternet.com>
> To: <nmap-dev_at_insecure.org>
> Sent: Tuesday, January 15, 2002 4:30 PM
> Subject: nmap under win98
>
>
> if you want a version of nmap that runs under win32 you can download it from
> my website www.testic.co.uk
>
> testic
>
>
>
> ---------------------------------------------------------------------
> For help using this (nmap-dev) mailing list, send a blank email to
> nmap-dev-help_at_insecure.org . List run by ezmlm-idx (www.ezmlm.org).
>
>
>
>
Received on Jan 16 2002

[ Nmap | Sec Tools | Mailing Lists | Site News | About/Contact | Advertising | Privacy ]
edgeos