Skip to content

Commit

Permalink
Spellcheck on Nmap, Nsock, Nbase source files
Browse files Browse the repository at this point in the history
  • Loading branch information
bonsaiviking committed Feb 20, 2014
1 parent b8873f4 commit 3f0d0c1
Show file tree
Hide file tree
Showing 52 changed files with 145 additions and 145 deletions.
14 changes: 7 additions & 7 deletions FPEngine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
}
Expand All @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 */
Expand Down Expand Up @@ -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();
}

Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion FPEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion FingerPrintResults.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
8 changes: 4 additions & 4 deletions FingerPrintResults.h
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion MACLookup.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion MACLookup.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion NmapOps.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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:https://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\
Expand Down
6 changes: 3 additions & 3 deletions NmapOps.h
Original file line number Diff line number Diff line change
Expand Up @@ -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). */
Expand Down Expand Up @@ -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; }
Expand Down Expand Up @@ -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. */

Expand Down
2 changes: 1 addition & 1 deletion Target.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion TargetGroup.h
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ class NewTargets {
* 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;

Expand Down
2 changes: 1 addition & 1 deletion global_structures.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
30 changes: 15 additions & 15 deletions idle_scan.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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++;
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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);

Expand All @@ -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);

Expand All @@ -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);
}

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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);
}

Expand Down Expand Up @@ -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];
Expand Down Expand Up @@ -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);
}
}
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
}
Expand Down Expand Up @@ -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);
}

Expand Down Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion idle_scan.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion nbase/getopt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
10 changes: 5 additions & 5 deletions nbase/nbase.h
Original file line number Diff line number Diff line change
@@ -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 *
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion nbase/nbase_ipv6.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Loading

0 comments on commit 3f0d0c1

Please sign in to comment.