1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-07 13:11:28 +00:00
Commit Graph

87 Commits

Author SHA1 Message Date
fyodor
86e59a8c4e Update copyright statements from 2010 to 2011 2011-01-21 00:04:16 +00:00
david
7653cf7d4a Move COPYING.OpenSSL to OpenSSL.txt, update copyright notices to match. 2010-10-30 03:01:50 +00:00
david
fc9d35fed9 Add a symbolic constant for INITIAL_ARP_RTT_TIMEOUT. 2010-09-17 16:46:09 +00:00
david
c8106e0ef3 Let --min-rtt-timeout be a lower bound on the initial timeout for ARP
scan. ARP scan had a hardcoded initial timeout of 100 ms, which could be
lower than the minimum requested. The default minimum timeout is also
100 ms, so this has no effect if --min-rtt-timeout is not used.
2010-09-17 16:35:01 +00:00
kris
57664a51cf Committing MTU-related changes:
* Adding path-mtu.nse for Path MTU Discovery
* Nmap now stores the MTU for interfaces (from SIOCGIFMTU or libdnet)
* Scripts can access the MTU for host.interface via host.interface_mtu
* Nmap prints the MTU for interfaces in --iflist
2010-08-24 01:47:12 +00:00
kris
578a26e552 Remove unused variables -- I'm not sure if these were ever actually used 2010-07-26 18:08:36 +00:00
david
77df357acd Check for target->deviceName == NULL in target_needs_new_hostgroup in
targets.cc, and return false if it is so. This indicates that we are not
doing a raw scan. target->deviceName != NULL is necessary before
checking target->directlyConnected(), otherwise you get this assertion
failure when doing any non-root scan (such as -sT or -sL) as root with
two or more targets:

nmap: Target.cc:369: bool Target::directlyConnected() const: Assertion `directly_connected == 0 || directly_connected == 1' failed.
Aborted

This is how the logic originally worked, and I accidentally broke it in
r17892.
2010-06-25 05:34:08 +00:00
luis
da126c8b78 Merged nmap-dedup branch from nmap-exp/luis/nmap-dedup. This completes the Nmap/Nping code de-duplication phase. 2010-06-22 17:24:34 +00:00
david
2a8d0f2301 Break apart host groups when a new host has the same address as one already in
the current host group. This was already done in nexthost but only affected
ping scanning. Here in nmap.cc it takes effect for port scanning.
2010-06-09 03:12:38 +00:00
david
58e1d664a6 Force a new host group whenever the next host has the same IP address as
one already present in the current group. This is because ultra_scan
does not cope with multiple targets sharing the same IP address. However
this alone isn't enough to force a new host group, because the loop in
nmap.cc concatenates groups that nexthost splits apart, with its own
duplicate logic for breaking up groups.
2010-06-07 23:43:07 +00:00
david
a70b8dd5fd Break apart target_needs_new_hostgroup to it's easier to read, not just
one big expression. Also fix a dumb bug I just introduced where I was
comparing the same value with itself.
2010-06-07 22:36:21 +00:00
david
f6358d1f3a Factor out the logic that decides if a target needs to go into a
different host group. Also insert the target into the group only after
we're sure we want it, instead of provisionally inserting it and then
removing it after we find it's unwanted.
2010-06-07 22:13:20 +00:00
david
138745fda6 Remove the unused gethostnum static function. I think this was used in
checking responses for weird_responses, which we don't do anymore.
2010-06-07 21:27:04 +00:00
david
2111c0ab54 Fix up indentation in targets.cc. 2010-06-07 21:25:53 +00:00
fyodor
1aecac420f Update copyright year from 2009 to 2010 2010-05-03 21:20:25 +00:00
david
398e53b3de Keep trace of the list of addresses a name resolved to, and print out
how many there were if there were more than one.
2009-10-27 06:08:04 +00:00
david
c9fb13b4bb Add methods to TargetGroup to record the name or address that was the
"base address" from which a group of addresses were derived, for example
in "scanme.nmap.org/24", "scanme.nmap.org" would be the base address.
Use these methods to set the target name of that one host even when
addresses come from a netmask.
2009-10-26 23:15:43 +00:00
david
89019cb221 Split the load_exclude function into load_exclude_file and
load_exclude_string. Use read_host_from_file in load_exclude_file to
support comments like in -iL files.
2009-09-29 02:06:56 +00:00
david
0e2d5af0f9 Factor out the function that reads a host specification from an input
file.
2009-09-29 01:15:17 +00:00
david
2b8d091252 Include traceroute in NmapOps::RawScan. 2009-07-17 23:41:08 +00:00
david
401fa9d2d3 Be more careful about checking address families in hostInExclude.
Before, a variable was set to NULL if it was not AF_INET, and was later
dereferenced in handling target groups containing IPv4 addresses. This
never actually caused a problem because Nmap's -6 switch is global, so
if an AF_INET6 address was passed to hostInExclude, none of the target
groups could have contained IPv4 addresses and the NULL dereference
would not have occurred. It might have broken easily in the future
though. Now the IPv4 target groups make sure they are dealing with an
AF_INET address.
2009-07-16 02:47:44 +00:00
david
0b508999c1 Fixed a memory bug (access of freed memory) when loading exclude
targets with --exclude. This was reported to occasionally cause a
crash. Will Cladek reported the bug and contributed an initial
patch.
2009-06-14 23:00:33 +00:00
daniel
50830f7488 o Added initial SCTP port scanning support to Nmap. SCTP is
a layer 4 protocol used mostly for telephony related applications.
  This brings the following new features:
  o SCTP INIT chunk port scan (-sY): open ports return an INIT-ACK
    chunk, closed ones an ABORT chunk.  This is the SCTP equivalent
    of a TCP SYN stealth scan.
  o SCTP COOKIE-ECHO chunk port scan (-sZ): open ports are silent,
    closed ports return an ABORT chunk.
  o SCTP INIT chunk ping probes (-PY): host discovery using SCTP
    INIT chunk packets.
  o SCTP-specific IP protocol scan (-sO -p sctp).
  o SCTP-specific traceroute support (--traceroute).
  o The ability to use the deprecated Adler32 algorithm as specified
    in RFC 2960 instead of CRC32C from RFC 4960 (--adler32).
  o 42 well-known SCTP ports were added to the nmap-services file.
  Part of the work on SCTP support was kindly sponsored by
  Compass Security AG, Switzerland.  [Daniel Roethlisberger]
2009-06-03 23:15:45 +00:00
david
fac82a011b Only increment o.numhosts_scanned when we have truly finished scanning a
host, which means that it is either found down or else all
port/script/traceroute/etc. scanning is finished. In r12798 I made it be
updated as soon as DNS resolution happened, to make the status display
"X undergoing Ping Scan" accurate. However the main loop also uses this
variable to count how many addresses have been generated so it knows
when to stop scanning random addresses. If -iR was used, only the first
hostgroup out of all the random addresses would be fully scanned and
then the scan would end. This change fixes that and also makes the
output more like it was pre-r12798; for example, if you had done name
resolution on 1024 hosts with --max-hostgroup 8, and had found the 8th
up host at the 280th one pinged, the output was
Stats: 0:00:29 elapsed; 1016 hosts completed (8 up), 8 undergoing Connect Scan
and is now
Stats: 0:00:29 elapsed; 272 hosts completed (8 up), 8 undergoing Connect Scan
2009-05-04 22:59:35 +00:00
fyodor
d0e21e1d03 Suggest that people send patches to nmap-dev rather than to me directly 2009-04-15 00:37:03 +00:00
david
7872aafa5d Update the global o.numhosts_scanning variable within ultra_scan, so
that it is set properly for ping scan. Previously status reports during
ping scan always looked like

Stats: 25:34:33 elapsed; 991232 hosts completed (72530 up), 0 undergoing Ping Scan

Note the "0 undergoing". Now that number will be set to 4096 or whatever
the current ping scan group size happens to be.
2009-03-31 18:29:52 +00:00
fyodor
eccc235d5a Increase copyright year to 2009, simplify/reword some derivative works text, and remove a confusing clause about selling proprietary front-ends to Nmap 2009-03-31 04:16:12 +00:00
daniel
d170d5d02d Remove unused pingstyle enum left over from the massping migration. 2009-03-13 10:28:59 +00:00
david
aef760f2f3 Add patch from Henri Doreau that makes --excludefile properly handle files with
no terminating newline.
2009-01-14 22:20:18 +00:00
david
e37bb72cd1 Remove the unused HOST_FIREWALLED and HOST_BROADCAST flags. The only flags used
are HOST_UNKNOWN, HOST_UP, and HOST_DOWN, and they're not "flags" as such
because they are mutually exclusive.
2008-12-04 17:20:07 +00:00
michael
d01c5071cd Nmap will no longer misreport a localhost-response during PN scans, it will now be reported as 'user-set'. 2008-07-29 17:01:31 +00:00
michael
5f390306be A fix to r8309, this uses an error message already in nmap instead of the one I added 2008-06-18 01:55:25 +00:00
michael
78c3a83c87 Added an error message for when the user specifies a device(-e) that doesnt have a route to the target IP in windows.
This was caught by another error message later on, but it was ambiguous and unrelated to the actual problem.
2008-06-17 22:50:37 +00:00
david
6992d545e1 Remove unused pingtype parameter from massping. ultra_scan gets the ping type
from o.pingtype.
2008-05-29 18:20:33 +00:00
michael
9f1c28ad9c This patch reorganizes the way ping probes are handled internally.
Previously the ping probe data structures were stored in NmapOps,
now they will be stored in the scan_lists struct. All other changes
auxiliary to this reorganization.
2008-05-29 07:49:37 +00:00
fyodor
779b96a197 trivial copyright text tweak: filename nmap-os-fingerprints has changed to nmap-os-db 2008-05-22 20:45:32 +00:00
fyodor
10b54b773b minor license template updates from Kris--fix gnu.org link to GPLv2 (moved) and openssl license filename (COPYING.OpenSSL) 2008-05-05 04:10:00 +00:00
fyodor
5551c5a311 o Fixed a bunch of code to avoid compilation warning messages (at
least on some Linux machines) [Andrew J. Bennieston]
2008-04-09 02:11:20 +00:00
fyodor
1accc12fb2 fix typo in legal header found by Leigh Zhao (missing word: of) 2008-02-28 18:52:06 +00:00
fyodor
61b976a45c o Nmap now saves the target name (if any) specified on the command
line, since this can differ from the reverse DNS results.  It can be
  particularly important when doing HTTP tests against virtual hosts.
  The data can be accessed from target->HostName() from Nmap proper
  and host.targetname from NSE scripts.  The NSE HTTP library now uses
  this for the Host header.  Thanks to Sven Klemm for adding this
  useful feature.
2008-02-04 22:10:29 +00:00
fyodor
29c912f394 URL change from http://insecure.org/nmap/* to http://nmap.org/* 2008-01-17 07:22:03 +00:00
fyodor
8220c8a42f update copyright line at the top of files from 1996-2006 to 1996-2008 2007-12-22 06:32:03 +00:00
kris
1b1fcc753b Adding a new ping type: IPProto Ping. It's used with '-PO'. I've changed references to -P0 (zero) to -PN throughout the source code and refguide.xml 2007-10-28 00:05:03 +00:00
david
0a2764f198 Remove massping.
2 files changed, 1301 deletions(-)

Would that all patches could be like that.
2007-10-12 03:46:46 +00:00
david
c76cdc8e44 Make the old massping be used when NEW_MASSPING is undefined in targets.h. This
is the last revision that contains massping.
2007-10-12 03:38:38 +00:00
david
302547375b Look out, world, here comes the Nmap massping migration!
This is the merging of the code that was previously in
/nmap-exp/david/nmap-massping-migration. These are all the big changes
that get rid of massping in favor of doing host discovery using
ultra_scan.

For now, there is a toggle that turns these new changes off. Undefine
NEW_MASSPING in targets.cc to go back to the old code. All of that will
be deleted eventually.

There are likely a few more changes that will be made to this system in
the near future. Those will be made in
/nmap-exp/david/nmap-massping-migration and merged back.

Don't release this just yet, because I'm going to make a few more
commits real quick to remove some debugging stuff.

(Note to self: this merge back was from r5693 in
/nmap-exp/david/nmap-massping-migration.)
2007-08-27 23:58:23 +00:00
david
338b1913d8 Fix some switch-case logic in massping that made all connection-refused responses look like syn-acks when doing TCP connect ping scan. 2007-08-23 20:23:57 +00:00
kris
0b50c16b38 Adding Snprintf() and Vsnprintf() to nbase/nbase_str.c. This is because of Windows' stupid implementation where it doesn't write a NULL byte at the end of the buffer if the result is truncated. I would've just #defined snprintf and vsnprintf to some wrapper function for Windows, but this doesn't work as libdnet and libpcap (and libpcap includes under mswin32) define snprintf to _snprintf and vsnprintf to _vsnprintf like we do, and through the many defines they end up being available in the Nmap sources. Vsnprintf() uses vsnprintf() (and writes a NULL byte at the end if truncated), and Snprintf uses Vsnprintf(). 2007-08-14 06:46:54 +00:00
fyodor
6c06f51bd7 merge soc07 r5100 - Changing fprintf(stderr, )'s to error()'s (or fatal() if followed by and exit()). Besides providing consistency, this also allows more errors to actually be logged with --log-errors. 2007-08-11 05:16:56 +00:00
fyodor
8d74bbcd8a merge soc07 r4871:4884 and r4888 - renaming __FUNCTION__ to __func__ and changing hardcoded func names to __func__ 2007-08-11 04:06:09 +00:00