1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-09 06:01:28 +00:00
Commit Graph

106 Commits

Author SHA1 Message Date
david
5067f767b7 Add the new <target> element to XML output.
This element is intended to report information about command-line target
specifications. Now it's used with status="skipped" to indicate that a
specification was ignored.
2012-05-04 15:04:41 +00:00
david
ac8b76ec81 Rework a loop to give access to the condition. 2012-04-27 06:27:03 +00:00
david
f511045723 Make the two versions of target_needs_new_hostgroup the same.
Up to data structure differences. I'm not sure why they differed to
begin with, though I remember writing the comment that explains that
they differed. This is related to a problem reported by Daniel Miller:
http://seclists.org/nmap-dev/2012/q1/675.
2012-04-17 22:55:09 +00:00
david
89987139db Fix the check for duplicate addresses in target_needs_new_hostgroup. 2012-04-17 22:55:09 +00:00
david
2fa4737b7d Correct a comment. 2012-04-17 03:35:32 +00:00
fyodor
684f42c4ad One more adjustment to the license text. Notes that Zenmap, Ncat, and Nping use this license. Note that contributions made directly in the src repository are treated the same as those in the mailing list. 2012-03-01 06:53:35 +00:00
fyodor
e96a7b7b24 Update the headers for each code file. This updates code copyright dates to 2012, notes the awesome NSE in the list of technology, and slightly rewords the derivative works clarification 2012-03-01 06:32:23 +00:00
david
6cbd5a9a58 Allow --exclude and --excludefile together. 2011-12-08 23:16:57 +00:00
david
262ec8f7d7 Keep a std::string in scope when accessing its c_str.
The std::string was being created and deleted in a single statement, so
its c_str pointer pointed to freed memory. This could be seen with

valgrind nmap --exclude foo
2011-07-29 20:43:31 +00:00
david
9a64d66a1e Clarify an ambiguous if/else. 2011-07-19 21:40:32 +00:00
weilin
1dcf652410 Added ND ping for local IPv6 nets, merging from /nmap-exp/weilin/nmap-nd. 2011-07-19 02:31:54 +00:00
colin
dc4e67dffc Fixed broken --exclude in nmap.
--exclude 1.2.3.4,5.6.7.8 now works.
2011-06-21 18:05:25 +00:00
david
5f99b2ad9e Remove addrset_init from load_exclude_{file,string}.
That's the responsibility of calling code; also, these should
accumulate.
2011-06-21 16:16:19 +00:00
colin
83ded596c4 Updated comment to state correct location of addrset 2011-06-20 22:06:11 +00:00
colin
e02b218925 Updated targets to correctly check from errors in the addrset functions and call fatal 2011-06-20 21:57:58 +00:00
colin
6cd1cee328 Merging from nmap-exp/colin/nmap-addrset, nmap-exp/colin/nbase-addrset, and /nmap-exp/colin/ncat-addrset
Ported addrset from ncat to nbase. Made --exclude and --exclude-file options use addrset. As a side effect IPv6 Excludes work.
2011-06-20 20:46:41 +00:00
david
ea99942f25 Revert r24116 and r24117; the addrset functions need to go in a C
library instead.
2011-06-18 23:52:25 +00:00
colin
221d8db694 Merging from nmap-exp/colin/nmap-addrset and /nmap-exp/colin/ncat-addrset
Ported addrset from ncat to libnetutil. Made --exclude and --exclude-file options use addrset. As a side effect IPv6 Excludes work.
2011-06-17 19:58:03 +00:00
david
4aa4a154f9 Merge from /nmap-exp/david/nmap-ipv6.
This is raw IPv6 packet support for most port and ping scans, Neighbor
Discovery, and traceroute.
2011-06-08 01:24:48 +00:00
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