1 this will allow the deep use of the -e option and some other
6 diff -r -u nmap-3.10ALPHA3/NmapOps.h nmap-3.10ALPHA3IX/NmapOps.h
7 --- nmap-3.10ALPHA3/NmapOps.h 2002-09-16 04:54:43.000000000 +0200
8 +++ nmap-3.10ALPHA3IX/NmapOps.h 2002-11-10 11:24:26.000000000 +0100
10 // setPacketTrace(false) has been called
11 void setPacketTrace(bool pt) { pTrace = pt; }
15 int spoofsource; /* -S used */
17 diff -r -u nmap-3.10ALPHA3/nmap.cc nmap-3.10ALPHA3IX/nmap.cc
18 --- nmap-3.10ALPHA3/nmap.cc 2002-09-16 05:00:21.000000000 +0200
19 +++ nmap-3.10ALPHA3IX/nmap.cc 2002-11-10 10:07:53.000000000 +0100
22 {"version", no_argument, 0, 'V'},
23 {"verbose", no_argument, 0, 'v'},
24 + {"count", no_argument, 0, 'c'},
25 {"debug", optional_argument, 0, 'd'},
26 {"help", no_argument, 0, 'h'},
27 {"max_parallelism", required_argument, 0, 'M'},
31 case 'v': o.verbose++; break;
32 + case 'c': o.count=1; break;
37 " -p <range> ports to scan. Example range: '1-1024,1080,6666,31337'\n"
38 " -F Only scans ports listed in nmap-services\n"
39 " -v Verbose. Its use is recommended. Use twice for greater effect.\n"
40 + " -c Counting stats\n"
41 " -P0 Don't ping hosts (needed to scan www.microsoft.com and others)\n"
42 "* -Ddecoy_host1,decoy2[,...] Hide scan using many decoys\n"
43 " -6 scans via IPv6 rather than IPv4\n"
44 diff -r -u nmap-3.10ALPHA3/scan_engine.cc nmap-3.10ALPHA3IX/scan_engine.cc
45 --- nmap-3.10ALPHA3/scan_engine.cc 2002-09-16 06:39:58.000000000 +0200
46 +++ nmap-3.10ALPHA3IX/scan_engine.cc 2002-11-10 15:31:11.000000000 +0100
60 + int lastcheckedtime;
61 struct sockaddr_storage sock;
62 struct sockaddr_in *sin = (struct sockaddr_in *) &sock;
67 starttime = time(NULL);
68 + lastcheckedtime = 0;
70 if (scantype != SYN_SCAN)
71 ack_number = get_random_uint();
73 current->state = PORT_TESTING;
75 /* if (!testinglist) testinglist = current; */
78 + if ( time(NULL) != lastcheckedtime ) {
79 + lastcheckedtime = time(NULL);
80 + log_write(LOG_STDOUT, "Tried: %5d (%d resends) \nP/S: %8.2f ETS: %7.0f \e[28D\e[A", itimes , iresends , (double) ( itimes ) / ( 1 + lastcheckedtime - starttime ) , (double) ( numports - itimes + iresends ) / ( (double) itimes / ( 1 + lastcheckedtime - starttime ) ) );
81 + log_flush(LOG_STDOUT);
85 ss.numqueries_outstanding++;
86 gettimeofday(¤t->sent[0], NULL);
87 if ((scantype == SYN_SCAN) || (scantype == WINDOW_SCAN) ||
89 current->state = PORT_FRESH;
91 current->sd[0] = current->sd[1] = current->sd[2] = -1;
94 log_write(LOG_STDOUT, "Preparing for retry, nonresponsive port %lu noted\n", current->portno);
100 + int lastcheckedtime;
104 int newstate = 999; /* This ought to break something if used illegally */
105 struct portinfo *scan, *openlist, *current, *testinglist, *next;
106 @@ -1334,6 +1351,7 @@
107 fatal("Unknown scan type for super_scan"); }
109 starttime = time(NULL);
110 + lastcheckedtime = 0;
112 if (o.debugging || o.verbose)
113 log_write(LOG_STDOUT, "Initiating %s against %s\n", scantype2str(scantype), target->NameIP(hostname, sizeof(hostname)));
114 @@ -1416,6 +1434,14 @@
115 /* lets send a packet! */
116 current->state = PORT_TESTING;
117 /* if (!testinglist) testinglist = current; */
120 + if ( time(NULL) != lastcheckedtime ) {
121 + lastcheckedtime = time(NULL);
122 + log_write(LOG_STDOUT, "Tried: %5d (%d resends) \nP/S: %8.2f ETS: %7.0f \e[28D\e[A", itimes , iresends , (double) itimes / ( 1 + lastcheckedtime - starttime ) , (double) ( numports - itimes + iresends ) / ( (double) ( itimes + iresends ) / ( 1 + lastcheckedtime - starttime ) ) );
123 + log_flush(LOG_STDOUT);
126 numqueries_outstanding++;
127 gettimeofday(¤t->sent[0], NULL);
129 @@ -1637,6 +1663,7 @@
130 for(current = openlist; current; current = (current->next >= 0)? &scan[current->next] : NULL) {
131 current->state = PORT_FRESH;
135 log_write(LOG_STDOUT, "Preparing for retry, open port %lu noted\n", current->portno);