Thread: [Javanetsim-cvs] IceScan csubtarget.h, 1.37, 1.38 icedbs.h, 1.4, 1.5 icediscover.h, 1.25, 1.26 icep
Status: Beta
Brought to you by:
darkkey
From: Alexander B. <da...@us...> - 2006-12-17 09:59:45
|
Update of /cvsroot/javanetsim/IceScan In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv19563 Modified Files: csubtarget.h icedbs.h icediscover.h iceparams.h icescan.cc Log Message: Index: icescan.cc =================================================================== RCS file: /cvsroot/javanetsim/IceScan/icescan.cc,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** icescan.cc 16 Dec 2006 20:44:18 -0000 1.32 --- icescan.cc 17 Dec 2006 09:59:39 -0000 1.33 *************** *** 14,38 **** "\t-v[v[v[v]]]]: verbose levels\n" "HOST DISCOVERY:\n" ! "\t default is PA and PE.\n" "\t-P0: skip host discovery\n" "\t-PA: ACK Ping host discovery\n" ! "\t-PR: ARP host discovery\n" "\t-PE/PT/PM: ICMP Echo/Timestamp/Mask host discovery\n" "\t-PU: UDP Ping discovery\n" ! "\t-r: no reverse-dns lookups\n" "SCAN TYPES:\n" ! "\t default id tcp connect()\n" "\t-ST/SA/SS/SW: tcp connect()/ACK/SYN/Window scan\n" ! "\t-SB: udp NetBIOS scan\n" ! "\t-SI: IP Protocol scan\n" ! "\t-SN/SF/SX: stealth tcp Null/FIN/XMAS scan\n" ! "\t-SU: udp scan.\n" ! "\t-S0: no scan\n" ! "\t--scanflags <flags>: Customize TCP scan flags (SF/SX/SN scans)\n" ! "PORTS SPECIFICATION:\n" "\t-p <port range>: specify port range to scan (default 1-1024).\n" "\t You can use: 1-10; 1; 1-10,12-14; etc.\n" "MISC:\n" ! "\t--uid0: assume that the current user is fully privileged.\n" "\t-V: print version and exit\n" "\t-?: this message\n\n", name); --- 14,41 ---- "\t-v[v[v[v]]]]: verbose levels\n" "HOST DISCOVERY:\n" ! "\t default is PA and PE.\n" "\t-P0: skip host discovery\n" "\t-PA: ACK Ping host discovery\n" ! "\t-PR: ARP host discovery\n" "\t-PE/PT/PM: ICMP Echo/Timestamp/Mask host discovery\n" "\t-PU: UDP Ping discovery\n" ! "\t-r: no reverse-dns lookups\n" "SCAN TYPES:\n" ! "\t default id tcp connect()\n" "\t-ST/SA/SS/SW: tcp connect()/ACK/SYN/Window scan\n" ! "\t-SB: udp NetBIOS scan\n" ! "\t-SI: IP Protocol scan\n" ! "\t-SN/SF/SX: stealth tcp Null/FIN/XMAS scan\n" ! "\t-SU: udp scan.\n" ! "\t-S0: no scan\n" ! "\t--scanflags <flags>: Customize TCP scan flags (SF/SX/SN scans)\n" ! "PORTS SPECIFICATION:\n" "\t-p <port range>: specify port range to scan (default 1-1024).\n" "\t You can use: 1-10; 1; 1-10,12-14; etc.\n" + "INTERFACES AND SPOOFING:\n" + "\t--list-interfaces: list all interfaces\n" + "\t-i <iface-number>: use interface <iface-number> for pcap/source interface.\n" "MISC:\n" ! "\t--uid0: assume that the current user is fully privileged.\n" "\t-V: print version and exit\n" "\t-?: this message\n\n", name); *************** *** 127,130 **** --- 130,137 ---- }else if(!strcmp(argv[i], "--uid0")){ par->forceuid = true; + }else if(!strcmp(argv[i], "--list-interfaces")){ + listdev_pcap(); + std::cout << std::endl; + exit(0); }else{ std::cout << "Invalid option: -" << argv[i][1] << std::endl; *************** *** 161,164 **** --- 168,178 ---- break; + case 'i': + if(i+1 < argc){ //UGLY, need more check!!! + par->source_iface = atoi(argv[i+1]); + } + i++; + break; + case 'S': *************** *** 301,304 **** --- 315,320 ---- int main(int argc, char *argv[]){ + //listdev_pcap(); + ice_service_name_database isnd("services"); ice_mac_name_database ismd("ieee-oui.txt"); Index: icedbs.h =================================================================== RCS file: /cvsroot/javanetsim/IceScan/icedbs.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** icedbs.h 15 Dec 2006 15:48:51 -0000 1.4 --- icedbs.h 17 Dec 2006 09:59:39 -0000 1.5 *************** *** 20,24 **** if(!in){ ! std::cout << "Can't open service names database!" << std::endl; } else { while(!in.eof()){ --- 20,24 ---- if(!in){ ! std::cout << "Warning: Can't open service names database!" << std::endl; } else { while(!in.eof()){ *************** *** 78,82 **** if(!in){ ! std::cout << "Can't open service names database!" << std::endl; } else { while(!in.eof()){ --- 78,82 ---- if(!in){ ! std::cout << "Warning: Can't open MAC vendors database!" << std::endl; } else { while(!in.eof()){ Index: iceparams.h =================================================================== RCS file: /cvsroot/javanetsim/IceScan/iceparams.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** iceparams.h 16 Dec 2006 21:05:28 -0000 1.14 --- iceparams.h 17 Dec 2006 09:59:39 -0000 1.15 *************** *** 26,29 **** --- 26,31 ---- bool forceuid; + int source_iface; + // Target Index: icediscover.h =================================================================== RCS file: /cvsroot/javanetsim/IceScan/icediscover.h,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** icediscover.h 16 Dec 2006 21:05:28 -0000 1.25 --- icediscover.h 17 Dec 2006 09:59:39 -0000 1.26 *************** *** 12,16 **** #define ACK_PING_STANDART_PORT 80 #else ! #define ACK_PING_STANDART_PORT 135 #endif --- 12,16 ---- #define ACK_PING_STANDART_PORT 80 #else ! #define ACK_PING_STANDART_PORT 80 #endif *************** *** 31,35 **** --- 31,39 ---- s.shutdown(); + #ifdef WIN32 + if(rc != SOCKET_ERROR && rc != ICESOCK_TIMEOUT){ + #else if(!rc){ + #endif if(par->verbose>0) *out << "Ack host discovery successfull!" << iceoutput::endl; return true; *************** *** 90,100 **** } ! char hostname[ICEMAXHOSTNAME]; char buf[1500]; //1500 == standart IP Packet size ! int len = recvfrom(r.get_socketid(), buf, sizeof(buf), 0, NULL, NULL); if(len > 0){ ! struct ip *ip = (struct ip *) buf; int hdrlen = ip->ip_hl << 2; --- 94,108 ---- } ! char hostname[ICEMAXHOSTNAME]; char buf[1500]; //1500 == standart IP Packet size ! sockaddr_in source; ! int fromlen = sizeof(source); ! ! int len = recvfrom(r.get_socketid(), buf, sizeof(buf), 0, (sockaddr*)&source, &fromlen); if(len > 0){ ! //DBGOUTPUT("!!!!"); ! struct ip *ip = (struct ip *) buf; int hdrlen = ip->ip_hl << 2; Index: csubtarget.h =================================================================== RCS file: /cvsroot/javanetsim/IceScan/csubtarget.h,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** csubtarget.h 16 Dec 2006 21:05:28 -0000 1.37 --- csubtarget.h 17 Dec 2006 09:59:39 -0000 1.38 *************** *** 352,593 **** return max; ! } ! ! /* This function implements any type of raw tcp scan, ! * e.g. ACK, FIN and etc. ! */ ! void raw_tcp_scan(icestring scan_type){ ! std::map <int, scanning_port> scanning_ports; ! struct sockaddr_in saddress; ! int len; ! int MAGIC_PORT = 54678; //ugly, need to check ! char local_hostname[80]; ! ! if(par->verbose > 0) ! *out << "Starting TCP " << scan_type << " scan against " << hostname.c_str() << "...\n"; ! ! #if (__CYGWIN__ || WIN32) //UGLY!!! ! if(par->forceuid){ ! #else ! if(getuid() || par->forceuid){ ! #endif ! out->line("UID isn't 0, so can't create raw socket/load pcap => no RAW tcp scan..."); ! return; ! } ! ! pcap_t* p = init_pcap(); //check for NULL ! ! if(p == NULL){ ! out->line("Can't open pcap: no raw tcp scan. Exitting."); ! return; ! } ! ! raw = true; ! domain = (int) SOCK_RAW; ! ! len = make_sockname(saddress, hostname.c_str(), 0, domain); ! ! if(gethostname(local_hostname, 80)) exit(-1); ! ! icestring source(local_hostname); ! ! init_scanning_ports(hostname, par, (int) SOCK_RAW, scanning_ports); ! ! crawsocket rawsend(AF_INET, (int) SOCK_RAW, IPPROTO_RAW); ! crawsocket rawrecv(AF_INET, (int) SOCK_RAW, IPPROTO_TCP); ! ! rawrecv.nonblock(true); ! ! int one = 1; ! const int *val = &one; ! if (rawsend.setsockopt (IPPROTO_IP, IP_HDRINCL, val, sizeof (one)) < 0) ! perror("Setsockopt HDRINCL:"); ! ! int l = scanning_ports.size()/MAX_PACKETS; ! if(scanning_ports.size() % MAX_PACKETS != 0) l++; ! ! char filter_exp[256]; ! ! sprintf(filter_exp, "port %d host %s tcp", MAGIC_PORT, hostname.c_str()); ! ! pcap_filter(p, filter_exp); ! ! int maxat; ! ! int covar = 10000; ! ! int attempts = 0; ! while(attempts++ < 5){ ! int j = 0; ! while(j < l){ ! std::map <int, scanning_port>::iterator i = scanning_ports.begin(); ! //DBGOUTPUT(attempts); ! maxat = 0; ! for(int k=0; k < MAX_PACKETS*j; k++) i++; ! for(int k = j*MAX_PACKETS; (k < (j+1)*MAX_PACKETS) && i!= scanning_ports.end(); ++i, k++){ ! if(! (*i).second.done ){ ! switch(par->scan_type){ ! case FIN_SCAN: ! rawsend.send_tcp_raw(source, hostname, MAGIC_PORT, (*i).first, 0, 0, TH_FIN | par->tcpflags, 0, 0, 0); ! break; ! case NULL_SCAN: ! rawsend.send_tcp_raw(source, hostname, MAGIC_PORT, (*i).first, 0, 0, par->tcpflags, 0, 0, 0); ! break; ! case XMAS_SCAN: ! rawsend.send_tcp_raw(source, hostname, MAGIC_PORT, (*i).first, 0, 0, TH_FIN | TH_URG | TH_PUSH | par->tcpflags, 0, 0, 0); ! break; ! case WINDOW_SCAN: ! case ACK_SCAN: ! rawsend.send_tcp_raw(source, hostname, MAGIC_PORT, (*i).first, 0, 0, TH_ACK, 0, 0, 0); ! break; ! case SYN_SCAN: ! rawsend.send_tcp_raw(source, hostname, MAGIC_PORT, (*i).first, 0, 0, TH_SYN, 0, 0, 0); ! break; ! } ! gettimeofday(&((*i).second.tv), 0); - //DBGOUTPUT("Sending:" << (*i).second.attempt); ! (*i).second.attempt++; ! ! maxat++; ! recieve_tcp_raw(p, rawsend, source, saddress, scanning_ports, MAGIC_PORT, 10, 0); ! } ! } ! j++; ! //iceusleep(1000); ! recieve_tcp_raw(p, rawsend, source, saddress, scanning_ports, MAGIC_PORT, (maxat) * covar + 10000, maxat); ! ! //DBGOUTPUT(covar); } ! } ! for(std::map <int, scanning_port>::iterator i = scanning_ports.begin(); i!= scanning_ports.end(); ++i){ ! if(! (*i).second.done){ ! (*i).second.done = true; ! set_port_status((*i).first, get_no_response_status(), "tcp"); ! } ! } ! ! scanning_ports.clear(); ! show_ports(); ! ! if(par->verbose>0) ! *out << "TCP " << scan_type << " scan finished.\n"; ! close_pcap(p); } ! int recieve_tcp_raw(pcap_t* p, crawsocket &rawsend, icestring &source, struct sockaddr_in &saddress, std::map <int, scanning_port> &scanning_ports, int MAGIC_PORT, int timeout, int packets){ ! int bytes; ! char *response; ! struct iphdr *ip; ! struct tcphdr *tcp; ! unsigned int len; ! int maxtimeval = 0; ! struct timeval tv1, tv2, tv3; ! gettimeofday(&tv1, 0); ! bool stop = false; ! int port; ! ! //DBGOUTPUT("!!!!!"); ! //while( bytes = rawrecv.recvfrom(response, 65535, 0, NULL) > 0){ ! while(!stop){ ! response = readip_pcap(p, &len, NULL); ! port = 0; ! if(response){ ! ip = (struct iphdr *) response; ! if(ip->saddr = saddress.sin_addr.s_addr && ip->protocol == IPPROTO_TCP){ ! tcp = (struct tcphdr *) (response + 4 * ip->ihl); ! if ((tcp->th_flags & TH_RST) && (par->scan_type == FIN_SCAN || par->scan_type == NULL_SCAN || par->scan_type == XMAS_SCAN)) { ! port = ntohs(tcp->th_sport); ! if(scanning_ports.find(port) != scanning_ports.end()){ ! if(!scanning_ports[port].done){ ! set_port_status(port, PORT_CLOSED, "tcp"); ! scanning_ports[port].done = true; ! } ! } ! }else if ((tcp->th_flags & TH_RST) && (par->scan_type == WINDOW_SCAN)) { ! int port = ntohs(tcp->th_sport); ! if(scanning_ports.find(port) != scanning_ports.end()){ ! if(!scanning_ports[port].done){ ! scanning_ports[port].done = true; ! if(tcp->th_win == 0){ ! set_port_status(port, PORT_CLOSED, "tcp"); ! }else{ ! set_port_status(port, PORT_OPEN, "tcp"); ! } ! } ! } ! }else if ((tcp->th_flags & TH_RST) && (par->scan_type == ACK_SCAN)) { ! int port = ntohs(tcp->th_sport); ! if(scanning_ports.find(port) != scanning_ports.end()){ ! if(!scanning_ports[port].done){ ! set_port_status(port, PORT_UNFILTERED, "tcp"); ! scanning_ports[port].done = true; ! } ! } ! }else if ((tcp->th_flags & TH_RST) && (par->scan_type == SYN_SCAN)) { ! int port = ntohs(tcp->th_sport); ! if(port != MAGIC_PORT){ ! if(scanning_ports.find(port) != scanning_ports.end()){ ! if(!scanning_ports[port].done){ ! scanning_ports[port].done = true; ! set_port_status(port, PORT_CLOSED, "tcp"); ! } ! } ! } ! }else if ((tcp->th_flags & (TH_ACK|TH_SYN)) && (par->scan_type == SYN_SCAN)) { ! int port = ntohs(tcp->th_sport); ! if(port != MAGIC_PORT){ ! if(scanning_ports.find(port) != scanning_ports.end()){ ! if(!scanning_ports[port].done){ ! set_port_status(port, PORT_OPEN, "tcp"); ! rawsend.send_tcp_raw(source, hostname, MAGIC_PORT, port, 0, 0, TH_RST, 0, 0, 0); ! scanning_ports[port].done = true; ! } ! } ! } } ! //bzero(response, 65534); ! } } ! gettimeofday(&tv2, 0); ! ! if(port){ ! if(SUB_TIMEVALS(tv2,scanning_ports[port].tv) > maxtimeval) ! maxtimeval = SUB_TIMEVALS(tv2,scanning_ports[port].tv); ! } ! ! if(SUB_TIMEVALS(tv2,tv1) >= timeout || SUB_TIMEVALS(tv2,tv1) > MAX_RAW_WAIT + packets * 500) ! stop = true; ! } ! ! return maxtimeval; } void shutdown_scansocket(int j){ --- 352,592 ---- return max; ! } ! /* This function implements any type of raw tcp scan, ! * e.g. ACK, FIN and etc. ! */ ! void raw_tcp_scan(icestring scan_type){ ! std::map <int, scanning_port> scanning_ports; ! struct sockaddr_in saddress; ! int len; ! int MAGIC_PORT = 54678; //ugly, need to check ! char local_hostname[80]; ! if(par->verbose > 0) ! *out << "Starting TCP " << scan_type << " scan against " << hostname.c_str() << "...\n"; ! ! #if (__CYGWIN__ || WIN32) //UGLY!!! ! if(!par->forceuid){ ! #else ! if(!getuid() || !par->forceuid){ ! #endif ! out->line("UID isn't 0, so can't create raw socket/load pcap => no RAW tcp scan..."); ! return; ! } ! ! pcap_t* p = init_pcap(par->source_iface); //check for NULL ! ! if(p == NULL){ ! out->line("Can't open pcap: no raw tcp scan. Exitting."); ! return; ! } ! ! raw = true; ! domain = (int) SOCK_RAW; ! ! len = make_sockname(saddress, hostname.c_str(), 0, domain); ! ! if(gethostname(local_hostname, 80)) exit(-1); ! ! icestring source(local_hostname); ! ! init_scanning_ports(hostname, par, (int) SOCK_RAW, scanning_ports); ! ! crawsocket rawsend(AF_INET, (int) SOCK_RAW, IPPROTO_RAW); ! //crawsocket rawrecv(AF_INET, (int) SOCK_RAW, IPPROTO_TCP); ! //rawrecv.nonblock(true); ! ! int one = 1; ! const int *val = &one; ! if (rawsend.setsockopt (IPPROTO_IP, IP_HDRINCL, val, sizeof (one)) < 0) ! perror("Setsockopt HDRINCL:"); ! ! int l = scanning_ports.size()/MAX_PACKETS; ! if(scanning_ports.size() % MAX_PACKETS != 0) l++; ! ! char filter_exp[256]; ! ! sprintf(filter_exp, "port %d host %s tcp", MAGIC_PORT, hostname.c_str()); ! ! pcap_filter(p, filter_exp); ! ! int maxat; ! ! int covar = 10000; ! ! int attempts = 0; ! while(attempts++ < 5){ ! int j = 0; ! while(j < l){ ! std::map <int, scanning_port>::iterator i = scanning_ports.begin(); ! //DBGOUTPUT(attempts); ! maxat = 0; ! for(int k=0; k < MAX_PACKETS*j; k++) i++; ! for(int k = j*MAX_PACKETS; (k < (j+1)*MAX_PACKETS) && i!= scanning_ports.end(); ++i, k++){ ! if(! (*i).second.done ){ ! switch(par->scan_type){ ! case FIN_SCAN: ! rawsend.send_tcp_raw(source, hostname, MAGIC_PORT, (*i).first, 0, 0, TH_FIN | par->tcpflags, 0, 0, 0); ! break; ! case NULL_SCAN: ! rawsend.send_tcp_raw(source, hostname, MAGIC_PORT, (*i).first, 0, 0, par->tcpflags, 0, 0, 0); ! break; ! case XMAS_SCAN: ! rawsend.send_tcp_raw(source, hostname, MAGIC_PORT, (*i).first, 0, 0, TH_FIN | TH_URG | TH_PUSH | par->tcpflags, 0, 0, 0); ! break; + case WINDOW_SCAN: + case ACK_SCAN: + rawsend.send_tcp_raw(source, hostname, MAGIC_PORT, (*i).first, 0, 0, TH_ACK, 0, 0, 0); + break; ! case SYN_SCAN: ! rawsend.send_tcp_raw(source, hostname, MAGIC_PORT, (*i).first, 0, 0, TH_SYN, 0, 0, 0); ! break; ! } ! gettimeofday(&((*i).second.tv), 0); ! //DBGOUTPUT("Sending:" << (*i).second.attempt); ! (*i).second.attempt++; ! maxat++; ! recieve_tcp_raw(p, rawsend, source, saddress, scanning_ports, MAGIC_PORT, 10, 0); } ! } ! j++; ! //iceusleep(1000); ! ! recieve_tcp_raw(p, rawsend, source, saddress, scanning_ports, MAGIC_PORT, (maxat) * covar + 10000, maxat); ! //DBGOUTPUT(covar); ! } } + + for(std::map <int, scanning_port>::iterator i = scanning_ports.begin(); i!= scanning_ports.end(); ++i){ + if(! (*i).second.done){ + (*i).second.done = true; + set_port_status((*i).first, get_no_response_status(), "tcp"); + } + } ! scanning_ports.clear(); ! ! show_ports(); ! ! if(par->verbose>0) ! *out << "TCP " << scan_type << " scan finished.\n"; ! ! close_pcap(p); ! } ! ! int recieve_tcp_raw(pcap_t* p, crawsocket &rawsend, icestring &source, struct sockaddr_in &saddress, std::map <int, scanning_port> &scanning_ports, int MAGIC_PORT, int timeout, int packets){ ! int bytes; ! char *response; ! struct iphdr *ip; ! struct tcphdr *tcp; ! unsigned int len; ! int maxtimeval = 0; ! struct timeval tv1, tv2, tv3; ! gettimeofday(&tv1, 0); ! bool stop = false; ! int port; ! ! //DBGOUTPUT("!!!!!"); ! //while( bytes = rawrecv.recvfrom(response, 65535, 0, NULL) > 0){ ! while(!stop){ ! response = readip_pcap(p, &len, NULL); ! port = 0; ! if(response){ ! ip = (struct iphdr *) response; ! if(ip->saddr = saddress.sin_addr.s_addr && ip->protocol == IPPROTO_TCP){ ! tcp = (struct tcphdr *) (response + 4 * ip->ihl); ! if ((tcp->th_flags & TH_RST) && (par->scan_type == FIN_SCAN || par->scan_type == NULL_SCAN || par->scan_type == XMAS_SCAN)) { ! port = ntohs(tcp->th_sport); ! if(scanning_ports.find(port) != scanning_ports.end()){ ! if(!scanning_ports[port].done){ ! set_port_status(port, PORT_CLOSED, "tcp"); ! scanning_ports[port].done = true; ! } ! } ! }else if ((tcp->th_flags & TH_RST) && (par->scan_type == WINDOW_SCAN)) { ! int port = ntohs(tcp->th_sport); ! if(scanning_ports.find(port) != scanning_ports.end()){ ! if(!scanning_ports[port].done){ ! scanning_ports[port].done = true; ! if(tcp->th_win == 0){ ! set_port_status(port, PORT_CLOSED, "tcp"); ! }else{ ! set_port_status(port, PORT_OPEN, "tcp"); ! } ! } ! } ! }else if ((tcp->th_flags & TH_RST) && (par->scan_type == ACK_SCAN)) { ! int port = ntohs(tcp->th_sport); ! if(scanning_ports.find(port) != scanning_ports.end()){ ! if(!scanning_ports[port].done){ ! set_port_status(port, PORT_UNFILTERED, "tcp"); ! scanning_ports[port].done = true; ! } ! } ! }else if ((tcp->th_flags & TH_RST) && (par->scan_type == SYN_SCAN)) { ! int port = ntohs(tcp->th_sport); ! if(port != MAGIC_PORT){ ! if(scanning_ports.find(port) != scanning_ports.end()){ ! if(!scanning_ports[port].done){ ! scanning_ports[port].done = true; ! set_port_status(port, PORT_CLOSED, "tcp"); ! } ! } ! } ! }else if ((tcp->th_flags & (TH_ACK|TH_SYN)) && (par->scan_type == SYN_SCAN)) { ! int port = ntohs(tcp->th_sport); ! if(port != MAGIC_PORT){ ! if(scanning_ports.find(port) != scanning_ports.end()){ ! if(!scanning_ports[port].done){ ! set_port_status(port, PORT_OPEN, "tcp"); ! rawsend.send_tcp_raw(source, hostname, MAGIC_PORT, port, 0, 0, TH_RST, 0, 0, 0); ! scanning_ports[port].done = true; ! } } ! } } ! //bzero(response, 65534); ! } } + gettimeofday(&tv2, 0); + + if(port){ + if(SUB_TIMEVALS(tv2,scanning_ports[port].tv) > maxtimeval) + maxtimeval = SUB_TIMEVALS(tv2,scanning_ports[port].tv); + } + + if(SUB_TIMEVALS(tv2,tv1) >= timeout || SUB_TIMEVALS(tv2,tv1) > MAX_RAW_WAIT + packets * 500) + stop = true; + } + + return maxtimeval; + } void shutdown_scansocket(int j){ *************** *** 723,729 **** switch(sopt){ case 0: ! #ifdef __CYGWIN__ ! //case 1: ! if(false){ #else if(FD_ISSET(scan_sockets[(*i).second.socket_ptr].sid, &fd_r)){ --- 722,727 ---- switch(sopt){ case 0: ! #ifdef __CYGWIN__ ! if(false){ #else if(FD_ISSET(scan_sockets[(*i).second.socket_ptr].sid, &fd_r)){ |