1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-09 14:11:29 +00:00
Commit Graph

314 Commits

Author SHA1 Message Date
dmiller
9370f5bd5d Strip carriage returns (\r) from output to prevent spoofing 2016-09-21 03:55:12 +00:00
tudor
7f1ec2b806 o.numhosts_scanned and o.numhosts_up are now printed as unsigned ints with %u 2016-08-09 14:31:59 +00:00
tudor
c860732097 Limited unnecessary calls to alloc_vsprintf 2016-08-07 16:19:53 +00:00
vincent
32efc8b28c Use FQDN_LEN instead of MAXHOSTNAMELEN for DNS name buffers
This closes #140 (issue #140), namely "Use correct lengths 
for FQDN, not MAXHOSTNAMELEN"
2016-07-26 14:06:22 +00:00
vincent
0f22680426 Correct format string specifiers
The formats has been tested and verified on Mac OS X 10.8.5,
Mac OS X 10.11.5 and Ubuntu 14.04 LTS, all on x86_64 machines
and OSs. It mainly silences warnings. There were no warnings on
Ubuntu but a few on Mac OS, so the fix is intended to silence
warnings on Mac OS whithout triggering new warnings on other OSs.
Example of warnings previously encountered:

netutil.cc:2828:74: warning: format specifies type 'unsigned short'
but the argument has type 'int' [-Wformat]
2016-07-01 11:44:26 +00:00
dmiller
6e33d6ac3c Bump date in copyright headers 2016-04-04 15:38:44 +00:00
dmiller
e124565c58 Use time_t instead of long and double for storing uptime
Fixes #275.

This results in fewer casts and less subtraction than the previous
method, and should still be portable. Only division and subtraction and
difftime are performed on the value, so it will not overflow. And the
TCP timestamp itself is a 32-bit value, so it can't refer to a time
farther in the past than the 32-bit epoch. One explicit cast (to long
long) is used in order to ensure the format string can handle any
conceivable value according to the compiler and avoid a warning message.
2016-01-13 20:53:39 +00:00
dmiller
dd0050598b Print service info for unlisted ports when service tunnel is detected 2015-12-20 05:34:56 +00:00
dmiller
5e47450bdc Use forward-declaration of class FingerPrintResults in Target.h 2015-06-30 04:04:51 +00:00
henri
b55ff2d68f Don't associate nsock logging info to a nspool.
Make current loglevel and current log callback global
to the library. Attaching them to the nsock pool doesn't
bring any benefit and prevents from logging activity in
code sections that don't have access to a pool (such as
proxy chain specification parsing).

Updated external calls and nsock tests accordingly.
2015-06-27 08:21:53 +00:00
dmiller
638a123ba6 Move osscan structs from global_structures to osscan2.h 2015-06-23 15:53:05 +00:00
dmiller
68409b2226 Update copyright date to 2015 2015-06-03 13:01:29 +00:00
dmiller
c0628fd141 Report IPv4 and IPv6 addresses resolved for each host
Previously, we would only request IPv4 addresses by default, or only
IPv6 when scanning with -6. Now, we'll request both (by not passing an
address family in the hints to getaddrinfo) and report them all in the
"Other addresses" line. This should encourage more users to scan with
-6. Additionally, it allows us to catch and report attempts to scan
IPv6-only hosts via IPv4, where previously we would just say "Failed to
resolve"

Closes #76
2015-03-11 04:14:26 +00:00
dmiller
54c737a377 Update location of fingerprint submitter. 2015-02-12 05:02:47 +00:00
dmiller
d0b360b1a2 normalize capitalization for ttl output 2014-09-03 04:49:48 +00:00
dmiller
5adfb3b1de Update copyright notice to 2014 2014-08-16 01:52:33 +00:00
jay
05772dd1e5 Change default output mode to show TTL info with --reason directly (no need of --reason -v). Also, remove TTL column and move TTL info to REASON column. See http://seclists.org/nmap-dev/2014/q3/289 for discussion on this 2014-08-15 14:07:25 +00:00
jay
8d5ec9e310 Reapply r33420, r33421. Fix a missing right parenthesis. https://xkcd.com/859/ 2014-08-15 12:09:22 +00:00
fyodor
f6f59a7cd7 Auto regeneration with latest template files, etc. 2014-08-13 22:57:43 +00:00
jay
d4cf544df6 Fix a missing bracket at the end of the IMPORTANT NMAP LICENSE TERMS part in each file 2014-08-02 19:29:50 +00:00
jay
d70f5b364a Show TTL in default output if "--reason -v" is asked for. 2014-07-22 01:55:04 +00:00
dmiller
1320ea9ca2 Remove leftover debugging statement 2014-06-26 04:01:44 +00:00
dmiller
a0a94f9303 Properly handle interfaces with NULL addresses
Some vsnprintf implementations (or perhaps some compiler options?) don't
like formatting NULL as %s, and will segfault (ran into this with
libstdc++ on Solaris). We don't get bug reports because at least some
(including mine on Ubuntu) will simply format it as "(null)".

This patch adds explicit checking for NULL to avoid the segfault
condition.
2014-06-26 02:53:57 +00:00
d33tah
a80c90608c sed -i 's/if ( /if (/g' *.cc *.h; sed -i 's/for ( /for (/g' *.cc *.h; sed -i 's/( /(/g' nmap_amigaos.h tcpip.h service_scan.cc
There's still quite a lot of code like this, nse_openssl.cc being most
messy IMHO. Also, I left out "if( something )" syntax.
2014-06-25 15:40:54 +00:00
d33tah
421176fc00 Get rid of double newline at the EOF I accidentally introduced in the
last commit.
2014-06-18 11:30:02 +00:00
dmiller
3f0d0c16f9 Spellcheck on Nmap, Nsock, Nbase source files 2014-02-20 18:44:12 +00:00
fyodor
74ebf1c892 remove an orphan parameter from fatal() call. Problem noted by Gisle Vanem 2014-02-14 06:17:53 +00:00
dmiller
c9714990c7 Remove trailing whitespace from C/C++ files
https://secwiki.org/w/Nmap/Code_Standards
2014-02-12 20:25:51 +00:00
d33tah
4816358475 Replace all tab characters at the beginnings of lines with 8 spaces.
Mixed indentation annoyed my vim.
2014-01-05 19:14:26 +00:00
dmiller
866db7eea3 Revert r32528, was not tested on Windows 2013-11-27 13:32:05 +00:00
dmiller
9c36367eea header file cleanup
see http://seclists.org/nmap-dev/2013/q4/168

Move some includes out of nmap.h: nmap.h gets included lots of places,
and unconditionally included math.h, ctype.h, errno.h, stdio.h,
sys/stat.h, fcntl.h, sys/types.h, and stdarg.h. This commit moves those
includes into the .cc files where they are necessary and out of nmap.h

Remove redundant include global_structures.h, included from nmap.h

Removed redundant code included from nmap.h

Removing #include nbase.h when nmap.h is included (redundant)

Remove duplicate #include lines

Add ifndef guards to a few .h files
2013-11-26 20:55:29 +00:00
d33tah
ccd0c02a4c Add a lacking space in the license comment. The command I used to do this is:
for file in `grep "* including the terms and conditions of this license text as well.       \*" * -r --files-with-match `; do sed "s/\* including the terms and conditions of this license text as well.       \*/* including the terms and conditions of this license text as well.        */g" -i $file; done
2013-09-11 19:06:20 +00:00
fyodor
6e01ecd452 Update an email address, fix a typo, and slightly reword a sentence. 2013-07-30 00:02:00 +00:00
fyodor
83fb10ec56 Update the Nmap copyright/license files. This isn't the new Nmap Public Source License we've been discussing on the list, but rather just a 'quick patch' to hopefully prevent some of the abuse we've been seeing from companies lately. More details on the changes will be posted to the dev list. Also, the copyright year was updated to 2013 (which is the only change to Nsock license statements). 2013-07-28 22:05:05 +00:00
david
6238087e9b Compare string contents, not pointer values.
This bug was introduced in r30334. We want to compare the contents of
the strings, not their addresses. This bug caused host script results to
be printed in arbitrary, perhaps not even well-defined, order.
2013-06-14 17:26:43 +00:00
david
7684b43072 Formatting. 2013-06-13 15:22:17 +00:00
david
8c7e0881ec Remove misleading comments.
There is more than just sorting going on here; it's also whether some
output is written.
2013-06-13 15:22:13 +00:00
david
13abd4df8a Restore empty rpc_info field to gnmap port output from r29619.
Patch by Daniel Miller.
2013-04-17 22:48:31 +00:00
david
8e20e6a65b Show route metrics in --iflist. 2013-02-01 05:01:58 +00:00
henri
809f1eda68 Merged nsock-logging from nmap-exp/henri/nsock-logging/
Reworked the logging infrastructure to make it more flexible
and consistent.

Updated nmap, nping and ncat accordingly.  Nsock log level can
now be adjusted at runtime by pressing d/D in nmap.
2012-12-15 10:59:30 +00:00
fyodor
d81c7040f0 Update my email address in the places which had the old one 2012-12-10 01:34:21 +00:00
fyodor
6a42ef47c0 Update the Nmap and Nsock source code headers to note new Nmap dev mailing list email address and a better URL for Nmap license. 2012-12-06 01:21:42 +00:00
david
015e84908e Simplify comparescriptids and rename to scriptid_lessthan. 2012-12-04 03:06:19 +00:00
david
5eb62f3169 Give comparescriptids static scope. 2012-12-04 03:06:18 +00:00
david
2419afabbd Double the buffer space for OS generations.
Jan Kaestle reported an assertion failure caused by the list growing too
long.
http://seclists.org/nmap-dev/2012/q4/273
2012-11-21 01:37:30 +00:00
david
37639cf132 Fix --send-ip check in win32_fatal_raw_sockets.
The meaning of this test was accidentally inverted in r29931. It is
supposed to give a fatal error when trying to scan on an non-Ethernet
device, unless you have also used the --send-ip option.
2012-10-31 15:34:52 +00:00
david
03d4b03d2c Get rid of "using namespace std".
Importing the whole std namespace caused a problem with Clang and the
punning of bind and std::bind.

http://seclists.org/nmap-dev/2012/q4/58

The Web's opinion of "using namespace std" also seems to be more against
than for.
2012-10-11 04:45:50 +00:00
david
19d1115ef1 Allow win32_fatal_raw_sockets to take a NULL devname. 2012-10-03 15:43:19 +00:00
david
b2a1ff8e54 Fix broken protocol lookup.
For some reason (probably by imitation of nmap_getservbyport), protocol
numbers, which are byte values 0–255, had htons called on them after
being read from nmap-protocols. On little-endian platforms, this turned
them into integers 0x0100, 0x0200, 0x0300, etc.

protocol_table is supposed to be an array of 256 linked lists, linking
all the protocol names of the same number. Because of the above htons
conversion, all protocols mapped to bucket 0 on lookup instead. Perhaps
in an attempt to work around this broken lookup, all protocols were
inserted into bucket 0 on init; all other buckets were empty. This
worked on little-endian platforms, but on big-endian platforms where
htons is a no-op, all protocol numbers but 0 mapped to an empty linked
list.

Remove all the htons stuff and just look things up by integers. Use the
same mapping on initial insertion and on lookup, so that the buckets are
acutally populated.

This was noticed by hejianet.
http://seclists.org/nmap-dev/2012/q3/1005
2012-09-25 05:08:09 +00:00
david
fe185dfc24 Show OS scan guesses in XML even without --osscan-guess. 2012-09-18 17:03:47 +00:00