1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 04:31:29 +00:00

Spellcheck on Nmap, Nsock, Nbase source files

This commit is contained in:
dmiller
2014-02-20 18:44:12 +00:00
parent b8873f42cd
commit 3f0d0c16f9
52 changed files with 145 additions and 145 deletions

View File

@@ -511,7 +511,7 @@ void FPNetworkControl::response_reception_handler(nsock_pool nsp, nsock_event ns
enum nse_status status = nse_status(nse);
enum nse_type type = nse_type(nse);
const u8 *rcvd_pkt = NULL; /* Points to the captured packet */
size_t rcvd_pkt_len = 0; /* Lenght of the captured packet */
size_t rcvd_pkt_len = 0; /* Length of the captured packet */
struct timeval pcaptime; /* Time the packet was captured */
struct sockaddr_storage sent_ss;
struct sockaddr_storage rcvd_ss;
@@ -1240,7 +1240,7 @@ void FPHost::__reset() {
/* Returns the IP address of the target associated with the FPHost in
* stuct sockaddr_storage format. */
* struct sockaddr_storage format. */
const struct sockaddr_storage *FPHost::getTargetAddress() {
return this->target_host->TargetSockAddr();
}
@@ -1253,7 +1253,7 @@ const struct sockaddr_storage *FPHost::getTargetAddress() {
* - A closed TCP port.
* - A closed UDP port.
*
* When not enough information is found in the Target, the neccessary port
* When not enough information is found in the Target, the necessary port
* numbers are generated randomly. */
int FPHost::choose_osscan_ports() {
Port *tport = NULL;
@@ -1356,7 +1356,7 @@ int FPHost::update_RTO(int measured_rtt_usecs, bool retransmission) {
if (this->srtt == -1 && this->rttvar == -1) {
this->srtt = measured_rtt_usecs;
this->rttvar = measured_rtt_usecs/2;
this->rto = this->srtt + MAX(500000, 4*this->rttvar); /* Asume a granularity of 1/2 sec */
this->rto = this->srtt + MAX(500000, 4*this->rttvar); /* Assume a granularity of 1/2 sec */
} else {
/* RFC 2988: When a subsequent RTT measurement R' is made, a host MUST set
@@ -1424,7 +1424,7 @@ void FPHost6::init(Target *tgt, FPNetworkControl *fpnc) {
this->target_host->FPR = new FingerPrintResultsIPv6;
this->target_host->osscanSetFlag(OS_PERF);
/* Choose TCP/UDP ports for the prbes. */
/* Choose TCP/UDP ports for the probes. */
this->choose_osscan_ports();
/* Build the list of OS detection probes */
@@ -2537,7 +2537,7 @@ void FPProbe::reset() {
free(this->probe_id);
this->probe_id = NULL;
/* Also call FPPacket::__reset() to free any exising packet information */
/* Also call FPPacket::__reset() to free any existing packet information */
this->__reset();
}
@@ -2586,7 +2586,7 @@ int FPProbe::incrementRetransmissions() {
/* Returns the number of times the probe has been replied. This applies for
* timed probes, which may be retransmitted even if we got a reply (becase
* timed probes, which may be retransmitted even if we got a reply (because
* another timed probe timeout and we had to retransmit all of them to keep
* the timing accurate). */
int FPProbe::getReplies() const {

View File

@@ -429,7 +429,7 @@ class FPHost {
};
/* This class represents IPv6 hosts to be fingerprinted. The class performs
* OS detection asynchronously. To use it, shedule() must be called at regular
* OS detection asynchronously. To use it, schedule() must be called at regular
* intervals until done() returns true. After that, status() will indicate
* whether the host was successfully matched with a particular OS or not. */
class FPHost6 : public FPHost {

View File

@@ -313,7 +313,7 @@ static bool strnulleq(const char *s, const char *t) {
return strcmp(s, t) == 0;
}
// Go through any previously enterted classes to see if this is a dupe;
// Go through any previously entered classes to see if this is a dupe;
bool FingerPrintResults::classAlreadyExistsInResults(struct OS_Classification *OSC) {
int i;

View File

@@ -166,11 +166,11 @@ class FingerPrintResults {
returned */
const struct OS_Classification_Results *getOSClassification();
int osscan_opentcpport; /* Open TCP port used for scannig (if one found --
int osscan_opentcpport; /* Open TCP port used for scanning (if one found --
otherwise -1) */
int osscan_closedtcpport; /* Closed TCP port used for scannig (if one found --
int osscan_closedtcpport; /* Closed TCP port used for scanning (if one found --
otherwise -1) */
int osscan_closedudpport; /* Closed UDP port used for scannig (if one found --
int osscan_closedudpport; /* Closed UDP port used for scanning (if one found --
otherwise -1) */
int distance; /* How "far" is this FP gotten from? */
int distance_guess; /* How "far" is this FP gotten from? by guessing based on ttl. */
@@ -179,7 +179,7 @@ class FingerPrintResults {
between sending 1st tseq probe and sending first ICMP echo probe.
Zero means we didn't see any ratios (the tseq probes weren't
sent), 1 is ideal, and larger values are undesirable from a
consistancy standpoint. */
consistency standpoint. */
double maxTimingRatio;
/* If the fingerprint is of potentially poor quality, we don't want to

View File

@@ -227,7 +227,7 @@ const char *MACPrefix2Corp(const u8 *prefix) {
contains that string. Sets the first three bytes in mac_data and
returns true for the first matching entry found. If no entries
match, leaves mac_data untouched and returns false. Note that this
is not particularly efficient and so should be rewriteen if it is
is not particularly efficient and so should be rewritten if it is
called often */
bool MACCorp2Prefix(const char *vendorstr, u8 *mac_data) {
std::map<int, char *>::iterator i;

View File

@@ -140,7 +140,7 @@ const char *MACPrefix2Corp(const u8 *prefix);
contains that string. Sets the first three bytes in mac_data and
returns true for the first matching entry found. If no entries
match, leaves mac_data untouched and returns false. Note that this
is not particularly efficient and so should be rewriteen if it is
is not particularly efficient and so should be rewritten if it is
called often */
bool MACCorp2Prefix(const char *vendorstr, u8 *mac_data);

View File

@@ -418,7 +418,7 @@ void NmapOps::ValidateOptions() {
privreq = "WinPcap version 3.1 or higher and\n\
iphlpapi.dll. You seem to be missing one or both of these. Winpcap is\n\
available from http://www.winpcap.org. iphlpapi.dll comes with Win98 and\n\
later operating sytems and NT 4.0 with SP4 or greater. For previous windows\n\
later operating systems and NT 4.0 with SP4 or greater. For previous Windows\n\
versions, you may be able to take iphlpapi.dll from another system and place\n\
it in your system32 dir (e.g. c:\\windows\\system32).\n\
On Windows Vista and Windows 7, The WinPcap NPF service must be started by an\n\

View File

@@ -167,7 +167,7 @@ class NmapOps {
is not necessarily used. */
bool RawScan();
void ValidateOptions(); /* Checks that the options given are
reasonable and consistant. If they aren't, the
reasonable and consistent. If they aren't, the
function may bail out of Nmap or make small
adjustments (quietly or with a warning to the
user). */
@@ -241,7 +241,7 @@ class NmapOps {
/* These functions retrieve and set the Round Trip Time timeouts, in
milliseconds. The set versions do extra processing to insure sane
values and to adjust each other to insure consistance (e.g. that
values and to adjust each other to insure consistence (e.g. that
max is always at least as high as min) */
int maxRttTimeout() { return max_rtt_timeout; }
int minRttTimeout() { return min_rtt_timeout; }
@@ -289,7 +289,7 @@ class NmapOps {
bool open_only;
int scanflags; /* if not -1, this value should dictate the TCP flags
for the core portscaning routine (eg to change a
for the core portscanning routine (eg to change a
FIN scan into a PSH scan. Sort of a hack, but can
be very useful sometimes. */

View File

@@ -325,7 +325,7 @@ class Target {
unsigned int flags; /* HOST_UNKNOWN, HOST_UP, or HOST_DOWN. */
struct timeout_info to;
char *hostname; // Null if unable to resolve or unset
char * targetname; // The name of the target host given on the commmand line if it is a named host
char * targetname; // The name of the target host given on the command line if it is a named host
struct probespec traceroute_probespec;
std::list <TracerouteHop> traceroute_hops;

View File

@@ -238,7 +238,7 @@ private:
* Nmap will pop future targets from this queue. */
std::queue<std::string> queue;
/* A cache to save scanned targets specifiactions.
/* A cache to save scanned targets specifications.
* (These are targets that were pushed to Nmap scan queue) */
std::set<std::string> history;

View File

@@ -162,7 +162,7 @@ struct udpprobeinfo {
struct in_addr target;
};
/* The runtime statistics used to decide how fast to proced and how
/* The runtime statistics used to decide how fast to proceed and how
many ports we can try at once */
struct scanstats {
int packet_incr;

View File

@@ -182,7 +182,7 @@ struct idle_proxy_info {
int senddelay; /* Delay between sending pr0be SYN packets to target
(in microseconds) */
int max_senddelay; /* Maximum time we are allowed to wait between
sending pr0bes (when we send a bunch in a row.
sending probes (when we send a bunch in a row.
In microseconds. */
pcap_t *pd; /* A Pcap descriptor which (starting in
@@ -295,7 +295,7 @@ static int ipid_proxy_probe(struct idle_proxy_info *proxy, int *probes_sent,
proxy->host.TargetSockAddr(&ss, &sslen);
res = send_ip_packet(proxy->rawsd, proxy->ethptr, &ss, ipv6_packet, packetlen);
if (res == -1)
fatal("Error occured while trying to send IPv6 packet");
fatal("Error occurred while trying to send IPv6 packet");
free(ipv6_packet);
}
sent++;
@@ -453,7 +453,7 @@ static void ipv6_force_fragmentation(struct idle_proxy_info *proxy, Target *targ
ipv6_packet = build_icmpv6_raw(proxy->host.v6sourceip(), proxy->host.v6hostip(), 0x00, 0x0000, o.ttl, seq , pingid, ICMPV6_ECHO, 0x00, data, sizeof(data) , &packetlen);
res = send_ip_packet(proxy->rawsd, proxy->ethptr, &ss, ipv6_packet, packetlen);
if (res == -1)
fatal("Error occured while trying to send ICMPv6 Echo Request to the idle host");
fatal("Error occurred while trying to send ICMPv6 Echo Request to the idle host");
free(ipv6_packet);
gettimeofday(&ipv6_packet_send_time, NULL);
@@ -493,7 +493,7 @@ static void ipv6_force_fragmentation(struct idle_proxy_info *proxy, Target *targ
ipv6_packet = build_icmpv6_raw(proxy->host.v6sourceip(), proxy->host.v6hostip(), 0x00, 0x0000, o.ttl, 0x00 , 0x00, 0x02, 0x00, data, sizeof(data) , &packetlen);
res = send_ip_packet(proxy->rawsd, proxy->ethptr, &ss, ipv6_packet, packetlen);
if (res == -1)
fatal("Error occured while trying to send spoofed ICMPv6 Echo Request to the idle host");
fatal("Error occurred while trying to send spoofed ICMPv6 Echo Request to the idle host");
free(ipv6_packet);
@@ -506,7 +506,7 @@ static void ipv6_force_fragmentation(struct idle_proxy_info *proxy, Target *targ
ipv6_packet = build_icmpv6_raw(target->v6hostip(), proxy->host.v6hostip(), 0x00, 0x0000, o.ttl, seq , pingid, ICMPV6_ECHO, 0x00, data, sizeof(data) , &packetlen);
res = send_ip_packet(proxy->rawsd, proxy->ethptr, &ss, ipv6_packet, packetlen);
if (res == -1)
fatal("Error occured while trying to send ICMPv6 Echo Request to the idle host");
fatal("Error occurred while trying to send ICMPv6 Echo Request to the idle host");
free(ipv6_packet);
@@ -521,7 +521,7 @@ static void ipv6_force_fragmentation(struct idle_proxy_info *proxy, Target *targ
usleep(10000);
res = send_ip_packet(proxy->rawsd, proxy->ethptr, &ss, ipv6_packet, packetlen);
if (res == -1)
fatal("Error occured while trying to send ICMPv6 PTB to the idle host");
fatal("Error occurred while trying to send ICMPv6 PTB to the idle host");
free(ipv6_packet);
}
@@ -628,7 +628,7 @@ static void initialize_idleproxy(struct idle_proxy_info *proxy, char *proxyName,
proxy->host.setTargetSockAddr(&ss, sslen);
/* Lets figure out the appropriate source address to use when sending
the pr0bez */
the probes */
proxy->host.TargetSockAddr(&ss, &sslen);
if (!nmap_route_dst(&ss, &rnfo))
fatal("Unable to find appropriate source address and device interface to use when sending packets to %s", proxyName);
@@ -698,7 +698,7 @@ static void initialize_idleproxy(struct idle_proxy_info *proxy, char *proxyName,
sequence_base = get_random_u32();
/* Yahoo! It is finally time to send our pr0beZ! */
/* Yahoo! It is finally time to send our probes! */
while (probes_sent < NUM_IPID_PROBES) {
if (o.scan_delay)
@@ -732,7 +732,7 @@ static void initialize_idleproxy(struct idle_proxy_info *proxy, char *proxyName,
&packetlen);
res = send_ip_packet(proxy->rawsd, proxy->ethptr, &ss, ipv6_packet, packetlen);
if (res == -1)
fatal("Error occured while trying to send IPv6 packet");
fatal("Error occurred while trying to send IPv6 packet");
free(ipv6_packet);
}
@@ -875,7 +875,7 @@ static void initialize_idleproxy(struct idle_proxy_info *proxy, char *proxyName,
log_write(LOG_PLAIN, "Idle scan using zombie %s (%s:%hu); Class: %s\n", proxy->host.HostName(), proxy->host.targetipstr(), proxy->probe_port, ipidclass2ascii(proxy->seqclass));
break;
default:
fatal("Idle scan zombie %s (%s) port %hu cannot be used because IP ID sequencability class is: %s. Try another proxy.", proxy->host.HostName(), proxy->host.targetipstr(), proxy->probe_port, ipidclass2ascii(proxy->seqclass));
fatal("Idle scan zombie %s (%s) port %hu cannot be used because IP ID sequence class is: %s. Try another proxy.", proxy->host.HostName(), proxy->host.targetipstr(), proxy->probe_port, ipidclass2ascii(proxy->seqclass));
}
proxy->latestid = ipids[probes_returned - 1];
@@ -926,7 +926,7 @@ static void initialize_idleproxy(struct idle_proxy_info *proxy, char *proxyName,
&packetlen);
res = send_ip_packet(proxy->rawsd, proxy->ethptr, &ss, ipv6_packet, packetlen);
if (res == -1)
fatal("Error occured while trying to send IPv6 packet ");
fatal("Error occurred while trying to send IPv6 packet ");
free(ipv6_packet);
}
}
@@ -1071,7 +1071,7 @@ static int idlescan_countopen2(struct idle_proxy_info *proxy,
fatal("%s: Failed to open ethernet device (%s)", __func__, target->deviceName());
} else eth.ethsd = NULL;
/* I start by sending out the SYN pr0bez */
/* I start by sending out the SYN probes */
for (pr0be = 0; pr0be < numports; pr0be++) {
if (o.scan_delay)
enforce_scan_delay(NULL);
@@ -1099,7 +1099,7 @@ static int idlescan_countopen2(struct idle_proxy_info *proxy,
&packetlen);
res = send_ip_packet(proxy->rawsd, eth.ethsd ? &eth : NULL, &ss, packet, packetlen);
if (res == -1)
fatal("Error occured while trying to send IPv6 packet");
fatal("Error occurred while trying to send IPv6 packet");
free(packet);
}
}
@@ -1348,7 +1348,7 @@ static int idle_treescan(struct idle_proxy_info *proxy, Target *target,
adjust_idle_timing(proxy, target, retry2, retrycount);
} else {
if (o.debugging)
error("Adjusting timing because my first scan of %d ports, starting with %hu found %d open, while second scan yeilded %d", secondHalfSz, ports[firstHalfSz], flatcount2, retrycount);
error("Adjusting timing because my first scan of %d ports, starting with %hu found %d open, while second scan yielded %d", secondHalfSz, ports[firstHalfSz], flatcount2, retrycount);
adjust_idle_timing(proxy, target, flatcount2, retrycount);
}
@@ -1432,7 +1432,7 @@ void idle_scan(Target *target, u16 *portarray, int numports,
scan is sort of tree structured (we scan a group and then divide
it up and drill down in subscans of the group), we split the port
space into smaller groups and then call a recursive
divide-and-counquer function to find the open ports */
divide-and-conquer function to find the open ports */
while (portidx < numports) {
portsleft = numports - portidx;
/* current_groupsz is doubled below because idle_subscan cuts in half */

View File

@@ -137,7 +137,7 @@
class Target;
/* Handles the scan types where no positive-acknowledgement of open
/* Handles the scan types where no positive-acknowledgment of open
port is received (those scans are in pos_scan). Super_scan
includes scans such as FIN/XMAS/NULL/Maimon/UDP and IP Proto scans */
void idle_scan(Target *target, u16 *portarray, int numports,

View File

@@ -55,7 +55,7 @@ int getopt_reset(void)
/* this is the plain old UNIX getopt, with GNU-style extensions. */
/* if you're porting some piece of UNIX software, this is all you need. */
/* this supports GNU-style permution and optional arguments */
/* this supports GNU-style permutation and optional arguments */
static int _getopt(int argc, char * argv[], const char *opts)
{

View File

@@ -1,7 +1,7 @@
/***************************************************************************
* nbase.h -- The main include file exposing the external API for *
* libnbase, a library of base (often compatability) routines. Programs *
* libnbase, a library of base (often compatibility) routines. Programs *
* using libnbase can guarantee the availability of functions like *
* (v)snprintf and inet_pton. This library also provides consistency and *
* extended features for some functions. It was originally written for *
@@ -134,7 +134,7 @@
/* NOTE -- libnbase offers the following features that you should probably
* be aware of:
*
* * 'inline' is defined to what is neccessary for the C compiler being
* * 'inline' is defined to what is necessary for the C compiler being
* used (which may be nothing)
*
* * snprintf, inet_pton, memcpy, and bzero are
@@ -155,7 +155,7 @@
* * IPv6 structures like 'sockaddr_storage' are provided if they do
* not already exist.
*
* * Various Windows -> UNIX compatability definitions are added (such as defining EMSGSIZE to WSAEMSGSIZE)
* * Various Windows -> UNIX compatibility definitions are added (such as defining EMSGSIZE to WSAEMSGSIZE)
*/
#if HAVE_CONFIG_H
@@ -234,7 +234,7 @@ typedef int32_t s32;
typedef uint64_t u64;
typedef int64_t s64;
/* Mathematicial MIN/MAX/ABS (absolute value) macros */
/* Mathematical MIN/MAX/ABS (absolute value) macros */
#ifndef MAX
#define MAX(x,y) (((x)>(y))?(x):(y))
#endif
@@ -488,7 +488,7 @@ char *format_bytecount(unsigned long long bytes, char *buf, size_t buflen);
/* Compare a canonical option name (e.g. "max-scan-delay") with a
user-generated option such as "max_scan_delay" and returns 0 if the
two values are considered equivalant (for example, - and _ are
two values are considered equivalent (for example, - and _ are
considered to be the same), nonzero otherwise. */
int optcmp(const char *a, const char *b);

View File

@@ -202,7 +202,7 @@ int sockaddr_storage_equal(const struct sockaddr_storage *a,
/* This function is an easier version of inet_ntop because you don't
need to pass a dest buffer. Instead, it returns a static buffer that
you can use until the function is called again (by the same or another
thread in the process). If there is a wierd error (like sslen being
thread in the process). If there is a weird error (like sslen being
too short) then NULL will be returned. */
const char *inet_ntop_ez(const struct sockaddr_storage *ss, size_t sslen);

View File

@@ -1,6 +1,6 @@
/***************************************************************************
* nbase_misc.c -- Some small miscelaneous utility/compatability *
* nbase_misc.c -- Some small miscellaneous utility/compatibility *
* functions. *
* *
***********************IMPORTANT NMAP LICENSE TERMS************************
@@ -222,7 +222,7 @@ int sockaddr_storage_equal(const struct sockaddr_storage *a,
/* This function is an easier version of inet_ntop because you don't
need to pass a dest buffer. Instead, it returns a static buffer that
you can use until the function is called again (by the same or another
thread in the process). If there is a wierd error (like sslen being
thread in the process). If there is a weird error (like sslen being
too short) then NULL will be returned. */
const char *inet_ntop_ez(const struct sockaddr_storage *ss, size_t sslen) {
@@ -606,7 +606,7 @@ unsigned long nbase_crc32(unsigned char *buf, int len)
* CRC-32C (Castagnoli) Cyclic Redundancy Check.
* Taken straight from Appendix C of RFC 4960 (SCTP), with the difference that
* the remainder register (crc32) is initialized to 0xffffffffL rather than ~0L,
* for correct operation on platforms where unisigned long is longer than 32
* for correct operation on platforms where unsigned long is longer than 32
* bits.
*/
@@ -695,13 +695,13 @@ unsigned long nbase_adler32(unsigned char *buf, int len)
* that the caller is supposed to free().
* */
char *hexdump(const u8 *cp, u32 length){
static char asciify[257]; /* Stores cha6acter table */
static char asciify[257]; /* Stores character table */
int asc_init=0; /* Flag to generate table only once */
u32 i=0, hex=0, asc=0; /* Array indexes */
u32 line_count=0; /* For byte count at line start */
char *current_line=NULL; /* Current line to write */
char *buffer=NULL; /* Dynamic buffer we return */
#define LINE_LEN 74 /* Lenght of printed line */
#define LINE_LEN 74 /* Length of printed line */
char line2print[LINE_LEN]; /* Stores current line */
char printbyte[16]; /* For byte conversion */
int bytes2alloc; /* For buffer */

View File

@@ -1,7 +1,7 @@
/***************************************************************************
* nbase_str.c -- string related functings in the nbase library. These *
* were written by fyodor@nmap.org . *
* nbase_str.c -- string related functions in the nbase library. These *
* were written by fyodor@nmap.org . *
* *
***********************IMPORTANT NMAP LICENSE TERMS************************
* *

View File

@@ -1,6 +1,6 @@
/***************************************************************************
* nbase_time.c -- Some small time-related utility/compatability *
* nbase_time.c -- Some small time-related utility/compatibility *
* functions. *
* *
***********************IMPORTANT NMAP LICENSE TERMS************************

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* nbase_winunix.h -- Misc. compatability routines that generally try to *
* nbase_winunix.h -- Misc. compatibility routines that generally try to *
* reproduce UNIX-centric concepts on Windows. *
* *
***********************IMPORTANT NMAP LICENSE TERMS************************
@@ -159,7 +159,7 @@
<system_error> doesn't compile, so we pretend not to have C++0x to
avoid it. */
#define _INC_ERRNO /* suppress errno.h */
#define _ERRNO_H_ /* Also for errno.h suppresion */
#define _ERRNO_H_ /* Also for errno.h suppression */
#define _SYSTEM_ERROR_
#undef _HAS_CPP0X
#define _HAS_CPP0X 0

View File

@@ -1,6 +1,6 @@
/* Note -- this file was obtained from tcpdump-2000-9-17 CVS snapshot *
* ( www.tcpdump.org). It has been modified slightly for *
* compatability with libnbase. Modification details may be in the *
* compatibility with libnbase. Modification details may be in the *
* nbase CHANGELOG - fyodor@nmap.org */

View File

@@ -692,7 +692,7 @@ Updates system-independent Nmap files. By default the new files are installed to
-r, --repo REPO use REPO as SVN repository and path (default %s).\n\
-v, --verbose be more verbose.\n\
--username USERNAME use this username.\n\
--password PASSWORE use this password.\n\
--password PASSWORD use this password.\n\
", program_name, install_dir, install_dir, DEFAULT_SVN_REPO);
free(install_dir);
}

View File

@@ -275,7 +275,7 @@ static void printusage(int rc) {
" --script-trace: Show all data sent and received\n"
" --script-updatedb: Update the script database.\n"
" --script-help=<Lua scripts>: Show help about scripts.\n"
" <Lua scripts> is a comma separted list of script-files or\n"
" <Lua scripts> is a comma-separated list of script-files or\n"
" script-categories.\n"
#endif
"OS DETECTION:\n"
@@ -575,8 +575,8 @@ void parse_options(int argc, char **argv) {
{"proxy", required_argument, 0, 0},
{"osscan_limit", no_argument, 0, 0}, /* skip OSScan if no open ports */
{"osscan-limit", no_argument, 0, 0}, /* skip OSScan if no open ports */
{"osscan_guess", no_argument, 0, 0}, /* More guessing flexability */
{"osscan-guess", no_argument, 0, 0}, /* More guessing flexability */
{"osscan_guess", no_argument, 0, 0}, /* More guessing flexibility */
{"osscan-guess", no_argument, 0, 0}, /* More guessing flexibility */
{"fuzzy", no_argument, 0, 0}, /* Alias for osscan_guess */
{"packet_trace", no_argument, 0, 0}, /* Display all packets sent/rcv */
{"packet-trace", no_argument, 0, 0}, /* Display all packets sent/rcv */
@@ -1539,7 +1539,7 @@ void apply_delayed_options() {
* --We are doing a raw sock scan and NOT pinging anyone */
if (o.SourceSockAddr() && !*o.device) {
if (ipaddr2devname(o.device, o.SourceSockAddr()) != 0) {
fatal("Could not figure out what device to send the packet out on with the source address you gave me! If you are trying to sp00f your scan, this is normal, just give the -e eth0 or -e ppp0 or whatever. Otherwise you can still use -e, but I find it kindof fishy.");
fatal("Could not figure out what device to send the packet out on with the source address you gave me! If you are trying to sp00f your scan, this is normal, just give the -e eth0 or -e ppp0 or whatever. Otherwise you can still use -e, but I find it kind of fishy.");
}
}

2
nmap.h
View File

@@ -315,7 +315,7 @@ void *realloc();
#endif
/* Maximum number of extra hostnames, OSs, and devices, we
consider when outputing the extra service info fields */
consider when outputting the extra service info fields */
#define MAX_SERVICE_INFO_FIELDS 5
/* We wait at least 100 ms for a response by default - while that

View File

@@ -168,7 +168,7 @@
// http://www.hcsw.org
/*
* DNS Caching and ageing added by Eddie Bell ejlbell@gmail.com 2007
* DNS Caching and aging added by Eddie Bell ejlbell@gmail.com 2007
*/
// TODO:
@@ -581,7 +581,7 @@ static int process_result(u32 ia, char *result, int action, u16 id) {
do_possible_writes();
// Close DNS servers if we're all done so that we kill
// all events and return from nsock_loop immediatley
// all events and return from nsock_loop immediateley
if (total_reqs == 0)
close_dns_servers();
return 1;

View File

@@ -325,7 +325,7 @@ void bounce_scan(Target *target, u16 *portarray, int numports,
error("Your FTP bounce server doesn't allow privileged ports, skipping them.");
while (i < numports && portarray[i] < 1024) i++;
if (!portarray[i]) {
fatal("And you didn't want to scan any unpriviliged ports. Giving up.");
fatal("And you didn't want to scan any unprivileged ports. Giving up.");
}
}
} else { /* Not an error message */

View File

@@ -13,7 +13,7 @@
--
-- A few notes about the safety of the engine, that is, the ability for
-- a script developer to crash or otherwise stall NSE. The purpose of noting
-- these attack vectors is more to show the difficulty in accidently
-- these attack vectors is more to show the difficulty in accidentally
-- breaking the system than to indicate a user may wish to break the
-- system through these means.
-- - A script writer can use the undocumented Lua function newproxy
@@ -125,7 +125,7 @@ local unpack = table.unpack;
do -- Add loader to look in nselib/?.lua (nselib/ can be in multiple places)
local function loader (lib)
lib = lib:gsub("%.", "/"); -- change Lua "module seperator" to directory separator
lib = lib:gsub("%.", "/"); -- change Lua "module separator" to directory separator
local name = "nselib/"..lib..".lua";
local type, path = cnse.fetchfile_absolute(name);
if type == "file" then
@@ -162,7 +162,7 @@ local NSE_YIELD_VALUE = {};
do
-- This is the method by which we allow a script to have nested
-- coroutines. If a sub-thread yields in an NSE function such as
-- nsock.connect, then we propogate the yield up. These replacements
-- nsock.connect, then we propagate the yield up. These replacements
-- to the coroutine library are used only by Script Threads, not the engine.
local function handle (co, status, ...)
@@ -1176,7 +1176,7 @@ do -- Load script arguments (--script-args)
return "", eqj-1;
else
error("Value around '"..sub(str, start, start+10)..
"' is invalid or is unterminated by a valid seperator");
"' is invalid or is unterminated by a valid separator");
end
end
-- Takes 'str' at index 'start' and parses a table.

View File

@@ -1,7 +1,7 @@
/* OpenSSL library for lua
* adapted from lmd5 library (http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/)
* Original code written by Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br>
* Adapted for NMap by Thomas Buchanan <tbuchanan@thecompassgrp.net>
* Adapted for Nmap by Thomas Buchanan <tbuchanan@thecompassgrp.net>
* bignum and rand_bytes functions added by Sven Klemm <sven@c3d2.de>
*/

View File

@@ -298,7 +298,7 @@ static int time_to_tm(const ASN1_TIME *t, struct tm *result)
/* "In coming up with the worlds least efficient machine-readable time
encoding format, the ISO nevertheless decided to forgo the encoding of
centuries, a problem which has been kludged around by redefining the time
as UTCTime if the date is 2049 or ealier, and GeneralizedTime if the date
as UTCTime if the date is 2049 or earlier, and GeneralizedTime if the date
is 2050 or later."
http://www.cs.auckland.ac.nz/~pgut001/pubs/x509guide.txt */
if (year < 50)
@@ -357,8 +357,8 @@ static void tm_to_table(lua_State *L, const struct tm *tm)
/* Omit tm_wday and tm_yday. */
}
/* This is a helper function for x509_validity_to_table. It takes teh given
ASN1_TIME and covnerts it to a value on the stack, which is one of
/* This is a helper function for x509_validity_to_table. It takes the given
ASN1_TIME and converts it to a value on the stack, which is one of
nil, if the time is NULL;
a date table, if the date can be parsed; and
a string of the raw bytes, if the date cannot be parsed. */
@@ -375,7 +375,7 @@ static void asn1_time_to_obj(lua_State *L, const ASN1_TIME *s)
}
}
/* This is a helper functino for x509_validity_to_table. It builds a table with
/* This is a helper function for x509_validity_to_table. It builds a table with
the two members "notBefore" and "notAfter", whose values are what is returned
from asn1_time_to_obj. */
static void x509_validity_to_table(lua_State *L, const X509 *cert)

View File

@@ -567,7 +567,7 @@ nsock_event_id nsock_reconnect_ssl(nsock_pool nsp, nsock_iod nsiod,
/* Read up to nlines lines (terminated with \n, which of course inclues \r\n),
* or until EOF, or until the timeout, whichever comes first. Note that
* NSE_STATUS_SUCCESS will be returned in the case of EOF or tiemout if at least
* NSE_STATUS_SUCCESS will be returned in the case of EOF or timeout if at least
* 1 char has been read. Also note that you may get more than 'nlines' back --
* we just stop once "at least" 'nlines' is read */
nsock_event_id nsock_readlines(nsock_pool nsp, nsock_iod nsiod,

View File

@@ -1015,7 +1015,7 @@ void process_event(mspool *nsp, gh_list_t *evlist, msevent *nse, int ev) {
do_actual_pcap_read(nse);
}
/* if already received smth */
/* if already received something */
if (fs_length(&(nse->iobuf)) > 0)
handle_pcap_read_result(nsp, nse, NSE_STATUS_SUCCESS);

View File

@@ -487,7 +487,7 @@ void msevent_delete(mspool *nsp, msevent *nse) {
else
nsock_log_debug(nsp, "msevent_delete (IOD #%li) (EID #%li)", nse->iod->id, nse->id);
/* First free the IOBuf inside it if neccessary */
/* First free the IOBuf inside it if necessary */
if (nse->type == NSE_TYPE_READ || nse->type == NSE_TYPE_WRITE) {
fs_free(&nse->iobuf);
}

View File

@@ -1,6 +1,6 @@
/***************************************************************************
* nsock_internal.h -- PRIVATE interface definitions for the guts of the *
* nsock paralle socket event library. Applications calling this library *
* nsock parallel socket event library. Applications calling this library *
* should NOT include this. even LOOK at these :). *
* *
***********************IMPORTANT NSOCK LICENSE TERMS***********************

View File

@@ -1,6 +1,6 @@
/***************************************************************************
* nsock_iod.c -- This contains the functions relating to nsock_iod (and *
* its nsock internal manifistation -- nsockiod. This is is similar to a *
* its nsock internal manifestation -- nsockiod. This is is similar to a *
* file descriptor in that you create it and then use it to initiate *
* connections, read/write data, etc. *
* *

View File

@@ -213,7 +213,7 @@ static int nsock_pcap_try_open(mspool *nsp, mspcap *mp, const char *dev,
/* Convert new nsiod to pcap descriptor. Other parameters have
* the same meaning as for pcap_open_live in pcap(3).
* device : pcap-style device name
* snaplen : size of packet to be copied to hanler
* snaplen : size of packet to be copied to handler
* promisc : whether to open device in promiscuous mode
* bpf_fmt : berkeley filter
* return value: NULL if everything was okay, or error string

View File

@@ -63,7 +63,7 @@
/* Read up to nlines lines (terminated with \n, which of course includes \r\n),
* or until EOF, or until the timeout, whichever comes first. Note that
* NSE_STATUS_SUCCESS will be returned in the case of EOF or tiemout if at least
* NSE_STATUS_SUCCESS will be returned in the case of EOF or timeout if at least
* 1 char has been read. Also note that you may get more than 'nlines' back --
* we just stop once "at least" 'nlines' is read */
nsock_event_id nsock_readlines(nsock_pool nsp, nsock_iod ms_iod,

View File

@@ -72,7 +72,7 @@
#include <openssl/rand.h>
struct sslinfo {
/* SSL_ERROR_NONE, SSL_ERROR_WANT_CONNECT, SSL_ERROR_WAINT_READ, or
/* SSL_ERROR_NONE, SSL_ERROR_WANT_CONNECT, SSL_ERROR_WANT_READ, or
* SSL_ERROR_WANT_WRITE */
int ssl_desire;
};

View File

@@ -254,7 +254,7 @@ void FingerPrint::sort() {
/* Compare an observed value (e.g. "45") against an OS DB expression (e.g.
"3B-47" or "8|A" or ">10"). Return true iff there's a match. The syntax uses
< (less than)
> (greather than)
> (greater than)
+ (non-zero)
| (or)
- (range)
@@ -536,7 +536,7 @@ double compare_fingerprints(const FingerPrint *referenceFP, const FingerPrint *o
reference fingerprint DB. The results are stored in in FPR (which
must point to an instantiated FingerPrintResultsIPv4 class) -- results
will be reverse-sorted by accuracy. No results below
accuracy_threshhold will be included. The max matches returned is
accuracy_threshold will be included. The max matches returned is
the maximum that fits in a FingerPrintResultsIPv4 class. */
void match_fingerprint(const FingerPrint *FP, FingerPrintResultsIPv4 *FPR,
const FingerPrintDB *DB, double accuracy_threshold) {

View File

@@ -180,7 +180,7 @@ double compare_fingerprints(const FingerPrint *referenceFP, const FingerPrint *o
reference fingerprint DB. The results are stored in in FPR (which
must point to an instantiated FingerPrintResultsIPv4 class) -- results
will be reverse-sorted by accuracy. No results below
accuracy_threshhold will be included. The max matches returned is
accuracy_threshold will be included. The max matches returned is
the maximum that fits in a FingerPrintResultsIPv4 class. */
void match_fingerprint(const FingerPrint *FP, FingerPrintResultsIPv4 *FPR,
const FingerPrintDB *DB, double accuracy_threshold);

View File

@@ -244,7 +244,7 @@ int get_initial_ttl_guess(u8 ttl) {
/* This function takes an array of "numSamples" IP IDs and analyzes
them to determine their sequenceability classification. It returns
them to determine their sequence classification. It returns
one of the IPID_SEQ_* classifications defined in nmap.h . If the
function cannot determine the sequence, IPID_SEQ_UNKNOWN is returned.
This islocalhost argument is a boolean specifying whether these
@@ -3197,7 +3197,7 @@ bool HostOsScan::processTIcmpResp(HostOsScanStats *hss, struct ip *ip, int reply
hss->storedIcmpReply = replyNo;
return true;
} else if (hss->storedIcmpReply == replyNo) {
/* This is a dunplicated icmp reply. */
/* This is a duplicated icmp reply. */
return false;
}
@@ -3295,7 +3295,7 @@ bool HostOsScan::get_tcpopt_string(struct tcp_hdr *tcp, int mss, char *result, i
* MSS, Sack Permitted, Timestamp with both value not zero, Nop, WScale with value 2
*/
/* Be aware of the max increament value for p in parsing,
/* Be aware of the max increment value for p in parsing,
* now is 5 = strlen("Mxxxx") <-> MSS Option
*/
while (length > 0 && (p - result) < (maxlen - 5)) {
@@ -3708,7 +3708,7 @@ int OSScan::os_scan(std::vector<Target *> &Targets) {
if (ip6_targets.size() > 0)
res6 = this->os_scan_ipv6(ip6_targets);
/* If both scans were succesful, return OK */
/* If both scans were successful, return OK */
if (res4 == OP_SUCCESS && res6 == OP_SUCCESS)
return OP_SUCCESS;
else

View File

@@ -293,7 +293,7 @@ class HostOsScanStats {
std::list<OFProbe *> probesActive;
/* A record of total number of probes that have been sent to this
* host, including restranmited ones. */
* host, including retransmitted ones. */
unsigned int num_probes_sent;
/* Delay between two probes. */
unsigned int sendDelayMs;

View File

@@ -2,7 +2,7 @@
/***************************************************************************
* output.cc -- Handles the Nmap output system. This currently involves *
* console-style human readable output, XML output, Script |<iddi3 *
* output, and the legacy greppable output (used to be called "machine *
* output, and the legacy grepable output (used to be called "machine *
* readable"). I expect that future output forms (such as HTML) may be *
* created by a different program, library, or script using the XML *
* output. *
@@ -529,7 +529,7 @@ static char *formatScriptOutput(ScriptResult sr) {
#endif /* NOLUA */
/* Prints the familiar Nmap tabular output showing the "interesting"
ports found on the machine. It also handles the Machine/Greppable
ports found on the machine. It also handles the Machine/Grepable
output and the XML output. It is pretty ugly -- in particular I
should write helper functions to handle the table creation */
void printportoutput(Target *currenths, PortList *plist) {
@@ -817,7 +817,7 @@ void printportoutput(Target *currenths, PortList *plist) {
#ifndef NOLUA
if (o.script) {
ScriptResults::const_iterator ssr_iter;
//Sort the results before outputing them on the screen
//Sort the results before outputting them on the screen
current->scriptResults.sort(scriptid_lessthan);
for (ssr_iter = current->scriptResults.begin();
ssr_iter != current->scriptResults.end(); ssr_iter++) {
@@ -939,7 +939,7 @@ char *logfilename(const char *str, struct tm *tm) {
/* This is the workhorse of the logging functions. Usually it is
called through log_write(), but it can be called directly if you are dealing
with a vfprintf-style va_list. YOU MUST SANDWHICH EACH EXECUTION IF THIS CALL
with a vfprintf-style va_list. YOU MUST SANDWICH EACH EXECUTION OF THIS CALL
BETWEEN va_start() AND va_end() calls. */
void log_vwrite(int logt, const char *fmt, va_list ap) {
char *writebuf;
@@ -2090,7 +2090,7 @@ void printserviceinfooutput(Target *currenths) {
// The following 2 lines (from portlist.h) tell us that we don't need to
// worry about free()ing anything in the serviceDeductions struct. pass in
// an allocated struct serviceDeductions (don't wory about initializing, and
// an allocated struct serviceDeductions (don't worry about initializing, and
// you don't have to free any internal ptrs.
currenths->ports.getServiceDeductions(p->portno, p->proto, &sd);

View File

@@ -2,7 +2,7 @@
/***************************************************************************
* output.h -- Handles the Nmap output system. This currently involves *
* console-style human readable output, XML output, Script |<iddi3 *
* output, and the legacy greppable output (used to be called "machine *
* output, and the legacy grepable output (used to be called "machine *
* readable"). I expect that future output forms (such as HTML) may be *
* created by a different program, library, or script using the XML *
* output. *
@@ -132,7 +132,7 @@
#define OUTPUT_H
#define LOG_NUM_FILES 4 /* # of values that actual files (they must come first */
#define LOG_FILE_MASK 15 /* The mask for log typs in the file array */
#define LOG_FILE_MASK 15 /* The mask for log types in the file array */
#define LOG_NORMAL 1
#define LOG_MACHINE 2
#define LOG_SKID 4
@@ -177,7 +177,7 @@ void win32_fatal_raw_sockets(const char *devname);
#endif
/* Prints the familiar Nmap tabular output showing the "interesting"
ports found on the machine. It also handles the Machine/Greppable
ports found on the machine. It also handles the Machine/Grepable
output and the XML output. It is pretty ugly -- in particular I
should write helper functions to handle the table creation */
void printportoutput(Target *currenths, PortList *plist);
@@ -200,7 +200,7 @@ void log_write(int logt, const char *fmt, ...)
called through log_write(), but it can be called directly if you
are dealing with a vfprintf-style va_list. Unlike log_write, YOU
CAN ONLY CALL THIS WITH ONE LOG TYPE (not a bitmask full of them).
In addition, YOU MUST SANDWHICH EACH EXECUTION IF THIS CALL BETWEEN
In addition, YOU MUST SANDWICH EACH EXECUTION OF THIS CALL BETWEEN
va_start() AND va_end() calls. */
void log_vwrite(int logt, const char *fmt, va_list ap);

View File

@@ -293,7 +293,7 @@ void serviceDeductions::populateFullVersionString(char *buf, size_t n) const {
strncat(dst, " ", spaceleft);
spaceleft--;
}
// This time we need to trucate inside of the () so we have spaceleft - 2
// This time we need to truncate inside of the () so we have spaceleft - 2
strncat(dst, "(", spaceleft);
if (spaceleft - 2 < strlen(extrainfo)) {
strncat(dst, extrainfo, spaceleft - 5);
@@ -567,7 +567,7 @@ int PortList::getPortState(u16 portno, u8 protocol) {
}
/* Return true if nothing special is known about this port; i.e., it's in the
default state as defiend by setDefaultPortState and every other data field is
default state as defined by setDefaultPortState and every other data field is
unset. */
bool PortList::portIsDefault(u16 portno, u8 protocol) {
return lookupPort(portno, protocol) == NULL;
@@ -617,7 +617,7 @@ Port *PortList::nextPort(const Port *cur, Port *next,
if (cur) {
proto = INPROTO2PORTLISTPROTO(cur->proto);
assert(port_map[proto]!=NULL); // Hmm, it's not posible to handle port that doesn't have anything in map
assert(port_map[proto]!=NULL); // Hmm, it's not possible to handle port that doesn't have anything in map
assert(cur->proto!=IPPROTO_IP || cur->portno<256);
mapped_pno = port_map[proto][cur->portno];
mapped_pno++; // we're interested in next port after current
@@ -759,8 +759,8 @@ u16 *PortList::port_map[PORTLIST_PROTO_MAX];
u16 *PortList::port_map_rev[PORTLIST_PROTO_MAX];
int PortList::port_list_count[PORTLIST_PROTO_MAX];
/* This function must be runned before any PortList object is created.
* It must be runned for every used protocol. The data in "ports"
/* This function must be run before any PortList object is created.
* It must be run for every used protocol. The data in "ports"
* should be sorted. */
void PortList::initializePortMap(int protocol, u16 *ports, int portcount) {
int i;
@@ -789,7 +789,7 @@ void PortList::initializePortMap(int protocol, u16 *ports, int portcount) {
/* Cycles through the 0 or more "ignored" ports which should be
consolidated for Nmap output. They are returned sorted by the
number of prots in the state, starting with the most common. It
number of ports in the state, starting with the most common. It
should first be called with PORT_UNKNOWN to obtain the most popular
ignored state (if any). Then call with that state to get the next
most popular one. Returns the state if there is one, but returns

View File

@@ -278,7 +278,7 @@ class PortList {
// will be NULL if unavailable. Note that this function makes its
// own copy of sname and product/version/extrainfo. This function
// also takes care of truncating the version strings to a
// 'reasonable' length if necessary, and cleaning up any unprinable
// 'reasonable' length if necessary, and cleaning up any unprintable
// chars. (these tests are to avoid annoying DOS (or other) attacks
// by malicious services). The fingerprint should be NULL unless
// one is available and the user should submit it. tunnel must be
@@ -304,7 +304,7 @@ class PortList {
/* Cycles through the 0 or more "ignored" ports which should be
consolidated for Nmap output. They are returned sorted by the
number of prots in the state, starting with the most common. It
number of ports in the state, starting with the most common. It
should first be called with PORT_UNKNOWN to obtain the most popular
ignored state (if any). Then call with that state to get the next
most popular one. Returns the state if there is one, but returns

View File

@@ -422,7 +422,7 @@ static int update_state_summary(state_reason_summary_t *head, reason_t reason_id
return 0;
}
/* Converts Port objects and their corrosponsing state_reason structures into
/* Converts Port objects and their corresponding state_reason structures into
* state_reason_summary structures using update_state_summary */
static unsigned int get_state_summary(state_reason_summary_t *head, PortList *Ports, int state) {
Port *current = NULL;

View File

@@ -1,8 +1,8 @@
/***************************************************************************
* scan_engine.cc -- Includes much of the "engine" functions for scanning, *
* such as ultra_scan. It also includes dependant functions such as those *
* for collecting SYN/connect scan responses. *
* such as ultra_scan. It also includes dependent functions such as those *
* for collecting SYN/connect scan responses. *
* *
***********************IMPORTANT NMAP LICENSE TERMS************************
* *
@@ -287,7 +287,7 @@ public:
enum UPType { UP_UNSET, UP_IP, UP_CONNECT, UP_ARP, UP_ND } type; /* The type of probe this is */
/* Sets this UltraProbe as type UP_IP and creates & initializes the
internal IPProbe. The relevent probespec is necessary for setIP
internal IPProbe. The relevant probespec is necessary for setIP
because pspec.type is ambiguous with just the ippacket (e.g. a
tcp packet could be PS_PROTO or PS_TCP). */
void setIP(u8 *ippacket, u32 iplen, const probespec *pspec);
@@ -358,7 +358,7 @@ public:
}
u8 tryno; /* Try (retransmission) number of this probe */
u8 pingseq; /* 0 if this is not a scanping. Otherwise a posative ping seq#. */
u8 pingseq; /* 0 if this is not a scanping. Otherwise a positive ping seq#. */
/* If true, probe is considered no longer active due to timeout, but it
may be kept around a while, just in case a reply comes late */
bool timedout;
@@ -483,7 +483,7 @@ public:
HostScanStats(Target *t, UltraScanInfo *UltraSI);
~HostScanStats();
int freshPortsLeft(); /* Returns the number of ports remaining to probe */
int next_portidx; /* Index of the next port to probe in the relevent
int next_portidx; /* Index of the next port to probe in the relevant
ports array in USI.ports */
bool sent_arp; /* Has an ARP probe been sent for the target yet? */
@@ -578,7 +578,7 @@ public:
probespec) that have met the current maximum tryno, and are on
ice until that tryno increases (so we can retransmit again), or
solidifies (so we can mark the port firewalled or whatever). The
tryno of benh members is bench_tryno. If the maximum tryno
tryno of bench members is bench_tryno. If the maximum tryno
increases, everyone on the bench is moved to the retry_stack.
*/
std::vector<probespec> probe_bench;
@@ -628,7 +628,7 @@ public:
and marking of remaining timedout ports firewalled or whatever is
appropriate. If mayincrease is non-NULL, it is set to whether
the allowedTryno may increase again. If it is false, any probes
which have reached the given limit may be dealth with. */
which have reached the given limit may be dealt with. */
unsigned int allowedTryno(bool *capped, bool *mayincrease);
@@ -910,7 +910,7 @@ void UltraProbe::setND(u8 *ndpkt, u32 ndlen) {
}
/* Sets this UltraProbe as type UP_IP and creates & initializes the
internal IPProbe. The relevent probespec is necessary for setIP
internal IPProbe. The relevant probespec is necessary for setIP
because pspec.type is ambiguous with just the ippacket (e.g. a
tcp packet could be PS_PROTO or PS_TCP). */
void UltraProbe::setIP(u8 *ippacket, u32 len, const probespec *pspec) {
@@ -1135,7 +1135,7 @@ bool GroupScanStats::sendOK(struct timeval *when) {
return false;
/* We need to stop sending if it has been a long time since
the last listen call, at least for systems such as Windoze that
the last listen call, at least for systems such as Windows that
don't give us a proper pcap time. Also for connect scans, since
we don't get an exact response time with them either. */
recentsends = USI->gstats->probes_sent - USI->gstats->probes_sent_at_last_wait;
@@ -1465,7 +1465,7 @@ bool HostScanStats::nextTimeout(struct timeval *when) {
and marking of remaining timedout ports firewalled or whatever is
appropriate. If mayincrease is non-NULL, it is set to whether
the allowedTryno may increase again. If it is false, any probes
which have reached the given limit may be dealth with. */
which have reached the given limit may be dealt with. */
unsigned int HostScanStats::allowedTryno(bool *capped, bool *mayincrease) {
std::list<UltraProbe *>::iterator probeI;
UltraProbe *probe = NULL;
@@ -1747,7 +1747,7 @@ void UltraScanInfo::Init(std::vector<Target *> &Targets, struct scan_lists *pts,
rawsd = nmap_raw_socket();
if (rawsd < 0)
pfatal("socket troubles in %s", __func__);
/* We do not wan't to unblock the socket since we want to wait
/* We do not want to unblock the socket since we want to wait
if kernel send buffers fill up rather than get ENOBUF, and
we won't be receiving on the socket anyway
unblock_socket(rawsd);*/
@@ -2824,7 +2824,7 @@ static bool ultrascan_port_pspec_update(UltraScanInfo *USI,
if (newstate != PORT_OPEN) {
if (noresp_open_scan) {
hss->target->ports.setPortState(portno, proto, newstate);
} /* Otherwise The old open takes precendence */
} /* Otherwise The old open takes precedence */
}
break;
case PORT_CLOSED:
@@ -3202,7 +3202,7 @@ static UltraProbe *sendConnectScanProbe(UltraScanInfo *USI, HostScanStats *hss,
hss->num_probes_active++;
/* It would be convenient if the connect() call would never succeed
or permanantly fail here, so related code cood all be localized
or permanently fail here, so related code cood all be localized
elsewhere. But the reality is that connect() MAY be finished now. */
if (rc != -1) {
@@ -4642,7 +4642,7 @@ static bool get_pcap_result(UltraScanInfo *USI, struct timeval *stime) {
/* UDP hdr, or TCP hdr up to seq #, or SCTP hdr up to vtag */
((USI->tcp_scan || USI->udp_scan || USI->sctp_scan) && encaps_len < 8)
/* prot scan has no headers coming back, so we don't reserve the
8 xtra bytes */
8 extra bytes */
) {
if (o.debugging)
error("Received short ICMP packet (%u bytes)", datalen);
@@ -4771,7 +4771,7 @@ static bool get_pcap_result(UltraScanInfo *USI, struct timeval *stime) {
/* UDP hdr, or TCP hdr up to seq #, or SCTP hdr up to vtag */
((USI->tcp_scan || USI->udp_scan || USI->sctp_scan) && encaps_len < 8)
/* prot scan has no headers coming back, so we don't reserve the
8 xtra bytes */
8 extra bytes */
) {
if (o.debugging)
error("Received short ICMPv6 packet (%u bytes)", datalen);
@@ -5161,7 +5161,7 @@ static int get_ping_pcap_result(UltraScanInfo *USI, struct timeval *stime) {
/* UDP hdr, or TCP hdr up to seq #, or SCTP hdr up to vtag */
((USI->tcp_scan || USI->udp_scan || USI->sctp_scan) && encaps_len < 8)
/* prot scan has no headers coming back, so we don't reserve the
8 xtra bytes */
8 extra bytes */
) {
if (o.debugging)
error("Received short ICMP or ICMPv6 packet (%u bytes)", datalen);

View File

@@ -429,7 +429,7 @@ void ServiceProbeMatch::InitMatch(const char *matchtext, int lineno) {
// The next part is a perl style regular expression specifier, like:
// m/^220 .*smtp/i Where 'm' means a normal regular expressions is
// used, the char after m can be anything (within reason, slash in
// this case) and tells us what delieates the end of the regex.
// this case) and tells us what delineates the end of the regex.
// After the delineating character are any single-character
// options. ('i' means "case insensitive", 's' means that . matches
// newlines (both are just as in perl)
@@ -517,9 +517,9 @@ void ServiceProbeMatch::InitMatch(const char *matchtext, int lineno) {
// ServiceProbeMatch, returns the details of the match (service
// name, version number if applicable, and whether this is a "soft"
// match. If the buf doesn't match, the serviceName field in the
// structure will be NULL. The MatchDetails sructure returned is
// structure will be NULL. The MatchDetails structure returned is
// only valid until the next time this function is called. The only
// exception is that the serviceName field can be saved throughought
// exception is that the serviceName field can be saved throughout
// program execution. If no version matched, that field will be
// NULL.
const struct MatchDetails *ServiceProbeMatch::testMatch(const u8 *buf, int buflen) {
@@ -1397,7 +1397,7 @@ int AllProbes::check_excluded_port(unsigned short portno, int proto)
// If the buf doesn't match, the serviceName field in the structure
// will be NULL. The MatchDetails returned is only valid until the
// next time this function is called. The only exception is that the
// serviceName field can be saved throughought program execution. If
// serviceName field can be saved throughout program execution. If
// no version matched, that field will be NULL. This function may
// return NULL if there are no match lines at all in this probe.
const struct MatchDetails *ServiceProbe::testMatch(const u8 *buf, int buflen, int n = 0) {
@@ -1996,7 +1996,7 @@ static void startNextProbe(nsock_pool nsp, nsock_iod nsi, ServiceGroup *SG,
end_svcprobe(nsp, (svc->softMatchFound)? PROBESTATE_FINISHED_SOFTMATCHED : PROBESTATE_FINISHED_NOMATCH, SG, svc, NULL);
}
} else {
// The finisehd probe was not a NULL probe. So we close the
// The finished probe was not a NULL probe. So we close the
// connection, and if further probes are available, we launch the
// next one.
if (!isInitial)
@@ -2059,7 +2059,7 @@ static void startNextProbe(nsock_pool nsp, nsock_iod nsi, ServiceGroup *SG,
should end the service with its successful match. If the tunnel
results can be determined with no more effort, 0 is also returned.
For example, a service that already matched as "ssl/ldap" will be
chaned to "ldap" with the tunnel being SSL and 0 will be returned.
changed to "ldap" with the tunnel being SSL and 0 will be returned.
That is a special case.
*/
@@ -2299,7 +2299,7 @@ static void servicescan_connect_handler(nsock_pool nsp, nsock_event nse, void *m
break;
case NSE_STATUS_KILL:
/* User probablby specified host_timeout and so the service scan is
/* User probably specified host_timeout and so the service scan is
* shutting down */
end_svcprobe(nsp, PROBESTATE_INCOMPLETE, SG, svc, nsi);
return;
@@ -2308,7 +2308,7 @@ static void servicescan_connect_handler(nsock_pool nsp, nsock_event nse, void *m
fatal("Unexpected nsock status (%d) returned for connection attempt", (int)status);
}
}
// We may have room for more pr0bes!
// We may have room for more probes!
launchSomeServiceProbes(nsp, SG);
return;
}
@@ -2340,7 +2340,7 @@ static void servicescan_write_handler(nsock_pool nsp, nsock_event nse, void *myd
return;
if (status == NSE_STATUS_KILL) {
/* User probablby specified host_timeout and so the service scan is
/* User probably specified host_timeout and so the service scan is
shutting down */
end_svcprobe(nsp, PROBESTATE_INCOMPLETE, SG, svc, nsi);
return;
@@ -2357,7 +2357,7 @@ static void servicescan_write_handler(nsock_pool nsp, nsock_event nse, void *myd
error("Got nsock WRITE response with status %s - aborting this service", nse_status2str(status));
end_svcprobe(nsp, PROBESTATE_INCOMPLETE, SG, svc, nsi);
// We may have room for more pr0bes!
// We may have room for more probes!
launchSomeServiceProbes(nsp, SG);
return;
@@ -2537,7 +2537,7 @@ static void servicescan_read_handler(nsock_pool nsp, nsock_event nse, void *myda
socket_strerror(err));
}
} else if (status == NSE_STATUS_KILL) {
/* User probablby specified host_timeout and so the service scan is
/* User probably specified host_timeout and so the service scan is
shutting down */
end_svcprobe(nsp, PROBESTATE_INCOMPLETE, SG, svc, nsi);
return;
@@ -2545,7 +2545,7 @@ static void servicescan_read_handler(nsock_pool nsp, nsock_event nse, void *myda
fatal("Unexpected status (%d) in NSE_TYPE_READ callback.", (int) status);
}
// We may have room for more pr0bes!
// We may have room for more probes!
launchSomeServiceProbes(nsp, SG);
return;
}

View File

@@ -161,7 +161,7 @@ struct MatchDetails {
// The line number of this match in nmap-service-probes.
int lineno;
// The product/verson/info for the service that was matched (Or NULL)
// The product/version/info for the service that was matched (Or NULL)
// zero-terminated.
const char *product;
const char *version;
@@ -199,7 +199,7 @@ class ServiceProbeMatch {
// match. If the buf doesn't match, the serviceName field in the
// structure will be NULL. The MatchDetails returned is only valid
// until the next time this function is called. The only exception
// is that the serviceName field can be saved throughought program
// is that the serviceName field can be saved throughout program
// execution. If no version matched, that field will be NULL.
const struct MatchDetails *testMatch(const u8 *buf, int buflen);
// Returns the service name this matches
@@ -327,7 +327,7 @@ class ServiceProbe {
// If the buf doesn't match, the serviceName field in the structure
// will be NULL. The MatchDetails returned is only valid until the
// next time this function is called. The only exception is that the
// serviceName field can be saved throughought program execution. If
// serviceName field can be saved throughout program execution. If
// no version matched, that field will be NULL. This function may
// return NULL if there are no match lines at all in this probe.
const struct MatchDetails *testMatch(const u8 *buf, int buflen, int n);

View File

@@ -73,7 +73,7 @@ struct ip
u_short ip_id; /* identification */
u_short ip_off; /* fragment offset field */
#define IP_RF 0x8000 /* reserved fragment flag */
#define IP_DF 0x4000 /* dont fragment flag */
#define IP_DF 0x4000 /* don't fragment flag */
#define IP_MF 0x2000 /* more fragments flag */
#define IP_OFFMASK 0x1fff /* mask for fragmenting bits */
u_int8_t ip_ttl; /* time to live */

View File

@@ -2083,7 +2083,7 @@ void broadcast_socket(int sd) {
len) into buf . Give up after 'seconds'. Returns the number of
bytes read (or -1 in the case of an error. It only does one recv
(it will not keep going until len bytes are read). If timedout is
not NULL, it will be set to zero (no timeout occured) or 1 (it
not NULL, it will be set to zero (no timeout occurred) or 1 (it
did). */
int recvtime(int sd, char *buf, int len, int seconds, int *timedout) {

View File

@@ -459,7 +459,7 @@ u8 *build_igmp_raw(const struct in_addr *source, const struct in_addr *victim,
const char *data, u16 datalen, u32 *packetlen);
// Returns whether the packet receive time value obtaned from libpcap
// Returns whether the packet receive time value obtained from libpcap
// (and thus by readip_pcap()) should be considered valid. When
// invalid (Windows and Amiga), readip_pcap returns the time you called it.
bool pcap_recv_timeval_valid();
@@ -520,7 +520,7 @@ bool getNextHopMAC(const char *iface, const u8 *srcmac, const struct sockaddr_st
int get_link_offset(char *device);
/* If rcvdtime is non-null and a packet is returned, rcvd will be
filled with the time that packet was captured from the wire by
pcap. If linknfo is not NULL, lnknfo->headerlen and
pcap. If linknfo is not NULL, lnkinfo->headerlen and
lnkinfo->header will be filled with the appropriate values. */
char *readipv4_pcap(pcap_t *pd, unsigned int *len, long to_usec,
struct timeval *rcvdtime, struct link_header *linknfo, bool validate);
@@ -537,7 +537,7 @@ int read_na_pcap(pcap_t *pd, u8 *sendermac, struct sockaddr_in6 *senderIP, long
and returns 1. If it times out and reads no arp requests, returns
0. to_usec is the timeout period in microseconds. Use 0 to avoid
blocking to the extent possible, and -1 to block forever. Returns
-1 or exits if ther is an error. */
-1 or exits if there is an error. */
int read_arp_reply_pcap(pcap_t *pd, u8 *sendermac, struct in_addr *senderIP,
long to_usec, struct timeval *rcvdtime);
@@ -563,7 +563,7 @@ void broadcast_socket(int sd);
len) into buf . Give up after 'seconds'. Returns the number of
bytes read (or -1 in the case of an error. It only does one recv
(it will not keep going until len bytes are read). If timedout is
not NULL, it will be set to zero (no timeout occured) or 1 (it
not NULL, it will be set to zero (no timeout occurred) or 1 (it
did). */
int recvtime(int sd, char *buf, int len, int seconds, int *timedout);