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

113 Commits

Author SHA1 Message Date
dmiller
f92265c91b Fix a double-free and cache problem in nmap_dns 2015-08-29 11:32:52 +00:00
dmiller
aa359738c1 Use POSIX-specified s6_addr element of struct in6_addr. http://seclists.org/nmap-dev/2015/q3/174 2015-08-01 19:42:34 +00:00
gio
6fdae80e41 Update request id on resend, bug discovered by bonsaiviking 2015-07-30 06:27:53 +00:00
gio
30b63ffa68 Remove non used lookup_cached_host, add whiteline between method definitions 2015-07-30 06:27:50 +00:00
gio
18b6b9c350 Use nbase u8 as buffer type 2015-07-30 06:27:46 +00:00
gio
aec4aac98f Fixed possible stack overflow with special crafted input discovered by bonsaiviking with fuzzing 2015-07-30 06:27:41 +00:00
gio
361f18fa87 Finer tests discovered and fixed other subtle bug thanks to them 2015-07-30 06:27:38 +00:00
gio
94e8a7acd3 Implemented more testing fixed some subtle bug thanks to it 2015-07-30 06:27:35 +00:00
gio
65aea074d1 Split declarations to header 2015-07-30 06:27:25 +00:00
gio
72c32299a0 Initialize DNS request id to random number 2015-07-30 06:27:22 +00:00
gio
4bf2731f44 Try to process also truncated DNS packets 2015-07-30 06:27:19 +00:00
gio
3039ebe9c0 Fixed error handling, a NXDomain end resolution tentatives 2015-07-30 06:27:16 +00:00
gio
15840e1793 Move sockadd_storage helpers functions to appropriate files 2015-07-30 06:27:13 +00:00
gio
e090e0901d Ported DNS answers parsing to IPv6 2015-07-30 06:27:09 +00:00
gio
d10e155f30 Add human readeable DNS ipv* packets generation 2015-07-30 06:27:06 +00:00
gio
cdd487580b Port cache and /etc/hosts reading to ipv6 2015-07-30 06:27:03 +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
henri
b75233ce98 Consistently renamed nsi_XXX calls into nsock_iod_XXX
This is part of the effort to make nsock expose only
nsock_ prefixed symbols and simplify the API.
2015-06-27 08:21:33 +00:00
henri
0348359f60 Enforce nsock naming scheme.
convert nsp_* calls into nsock_pool_*. Separate words with underscores
where appropriate.
2015-06-27 08:21:16 +00:00
dmiller
84d0e45641 Remove some unneeded includes of utils.h 2015-06-23 15:52:55 +00:00
dmiller
68409b2226 Update copyright date to 2015 2015-06-03 13:01:29 +00:00
dmiller
d1b34d407b Don't try nameservers from a different AF than our spoofed source. 2014-11-17 19:35:49 +00:00
dmiller
5adfb3b1de Update copyright notice to 2014 2014-08-16 01:52:33 +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
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
d33tah
e3d1c178e3 Add newlines at the EOF in conformance to Daniel's coding standards
proposal. This only affects Nmap's root directory. We might also need to
modify the code which autogenerates Nmap's source code files such as IPv6
fingerprinting code.
2014-06-18 10:18:58 +00:00
dmiller
3f0d0c16f9 Spellcheck on Nmap, Nsock, Nbase source files 2014-02-20 18:44:12 +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
dmiller
1ef698cb7e Adjust ipaddr length by 1 byte (null already accounted for) 2013-11-25 21:11:49 +00:00
dmiller
acbf533dcb Fix buffer overflow in parse_resolvconf()
String ipaddr was allocated without allowing space for the null
terminator, resulting in a 1-byte overflow. Caught with clang
-fsanitize=address

Also, fmt was being initialized with sizeof(ipaddr), which happened to
be correct, but should not necessarily be so. We don't care about the
size of the structure, but rather the length of an address in string
notation.
2013-11-25 18:35:49 +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
4e70079eb2 Assert that we are dealing with IPv4 targets in reverse DNS. 2013-04-22 21:56:08 +00:00
henri
8902a7c1bb Let our DNS resolver use nsock proxy chains. 2013-04-22 19:33:28 +00:00
david
6d83daa08c Check if an interface is known to pcap before adding its name servers.
Kenneth Frazier reported that sometimes Nmap would use name servers from
inactive interfaces. Let's try checking the interface GUIDs against
those known by libpcap.
http://seclists.org/nmap-dev/2013/q1/292
2013-03-05 06:14:02 +00:00
david
6afc8bf728 Put an initializer in the loop control. 2013-03-03 05:51:59 +00:00
david
28604535c4 Hardcode constant "CurrentControlSet" parameter.
I don't find anywhere in the history where this value has ever varied.
This is an old post from Doug where he mentions possibly different
values, but they appear to have been unused.
http://seclists.org/nmap-dev/2006/q1/147
2013-03-03 03:06:42 +00:00
david
6784954eee Use more automatic memory management in nmap_dns.cc. 2013-01-25 06:26:23 +00:00
david
c11ceacc1f Get rid of some struct typedefs.
C++ does this automatically. We don't need typedefs here, just some
forward declarations.
2013-01-25 06:26:22 +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
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
422b43be22 Call nsp_setdevice after nsp_new in our Nsock pools.
The exceptions are the calls in ncat/ncat_connect.c and
nping/EchoServer.cc. Ncat doesn't have an option for the interface, and
I think Nping's -e option is only meant to apply to probes, not to the
echo server listener.
2012-10-03 15:43:18 +00:00
david
40eb708922 Show gai_strerror in some error messages. 2012-09-15 17:56:14 +00:00
david
113e0b975f Break out resolve and resolve_numeric.
Besides the confusingness of the nodns argument being negatively
phrased, it had the value 0 in every existing call. Split out the nodns
special case into a separate function resolve_numeric.

This also has the side effect of changing the number of parameters to
the resolve function, which will cause a compile error for any calls I
might have missed changing when I changed the return code meaning in the
previous commit.

Ncat has its own copy of resolve, which obeys the global o.nodns rather
than a parameter. I'm leaving that alone for now. But give it the same
resolve_internal function, and make resolve call it with different flags
depending on the value of o.nodns.
2012-09-15 17:56:11 +00:00
david
0e738370ee Make resolve return a getaddrinfo error code.
The only error we can have apart from a getaddrinfo error is a list of
zero addresses; return EAI_NONAME in that case.

This unfortunately inverts the truth value of the return code of
resolve; 0 now means success.
2012-09-15 17:56:08 +00:00