1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-14 03:39:02 +00:00
Commit Graph

7705 Commits

Author SHA1 Message Date
henri
f9881bab18 In hostrule: return false if mountport is nil (prevents from crashing when accessed as a table, a couple lines below). 2012-09-10 14:45:21 +00:00
henri
e255be0990 In hostrule: return false if mountport is nil (prevent from crashing when accessed as a table, a couple line below). 2012-09-10 14:11:38 +00:00
henri
0f521a8697 Indentation fixes:
$ indent -nut -i2 -kr -br -brs -brf -l0 -bad -npcs -nprs -ncs nbase_memalloc.c
2012-09-10 08:20:25 +00:00
david
0674925f73 Skip over entire ifreq struct in NEXTIFR.
On platforms supporting sa_len, NEXTIFR would skip over sa_len bytes
starting at the beginning of ifr_addr, and assume that was the end of
the struct. (The idea being that a large address such as a sockaddr_in6
could overflow the nominal struct boundary.) This logic was wrong when
there was something else in the union bigger than sa_len; we would
increment into somewhere in the middle of the same struct.

This exhibited itself on NetBSD, where struct ifreq has a
sockaddr_storage member in its internal union:
struct	ifreq {
	char	ifr_name[IFNAMSIZ];		/* if name, e.g. "en0" */
	union {
		struct	sockaddr ifru_addr;
		struct	sockaddr ifru_dstaddr;
		struct	sockaddr ifru_broadaddr;
		struct	sockaddr_storage ifru_space;

No, we skip over sa_len bytes, or to the nominal end of the struct,
whichever is larger.

Unix Network Programming gets this wrong too; in figure 17.8 they do
ptr += sizeof(ifr->ifr_name) + max(sizeof(struct sockaddr), ifr->ifr_addr.sa_len);
2012-09-10 01:17:28 +00:00
david
6f61403f52 Don't use exit in APR_CHECK_WORKING_GETADDRINFO.
For the same reason as in r29737.
2012-09-08 19:45:38 +00:00
david
cb68c85409 Don't use exit in PCAP_IS_SUITABLE.
John Spencer reported that musl libc doesn't automatically include
<stdlib.h>, as Glibc does, so the configure check was wrongly failing.

conftest.c: In function 'main':
conftest.c:35:5: error: implicit declaration of function 'exit'
2012-09-08 19:44:24 +00:00
david
4d6f81122c Better break down structured output in smb-os-discovery.
smb.get_os already returns something that is fairly well structured, so
basically return that. Keep the "os" and "lanmanager" fields separate,
though they are combined as "os (lanmanager)" for normal output. Combine
"time" and "timezone" into a single "date" output.
2012-09-08 17:05:39 +00:00
david
d9b73da3a1 Give sample return values for smb.get_os. 2012-09-08 17:05:33 +00:00
david
afd483a2d6 Key digest output convention. 2012-09-08 16:22:23 +00:00
david
170df4fa54 Add docs section on structured output conventions.
Covering stdnse.format_timestamp.
2012-09-08 16:09:21 +00:00
david
87bce81b8c Use stdnse.format_timestamp in scripts that output structured dates. 2012-09-08 16:09:15 +00:00
david
e9b2a8aa5d Add stdnse.format_timestamp function.
This function follows RFC 3339 and is going to be the standard formatter
for dates and times in structured output.
2012-09-08 16:09:04 +00:00
david
ac87c9b251 Add stdnse.date_to_timestamp function.
This takes a broken-down date table, as produced by os.date("*t"), and
converts it into an integer number of seconds since the epoch UTC,
interpreting it as a time in a given time zone. Simply passing a date
table to os.time is not good enough, because os.time always assumes the
date table represents a local time; i.e., you will get different results
from running os.time({year=2012,month=1,day=1,hour=12,min=0,sec=0})
depending on what time zone you run it in.
2012-09-08 16:08:58 +00:00
henri
f366c0d191 Don't always assume that 'safe=1' was set. Added a check for 'unsafe' in ms08-67 2012-09-08 09:36:25 +00:00
paulino
ed65dd66d3 Removes the script from the "safe" category. 2012-09-07 23:44:58 +00:00
paulino
d7234e2582 Renames http-method-tamper to http-vuln-cve2010-0738 and adds the new version of http-method-tamper.
The new version improves the detection mechanism to cover PHP environments with .htaccess files and adds spidering to locate password protected resources automatically.
2012-09-07 23:42:39 +00:00
dmiller
00e37443ed Update @output luadoc on ssl-date 2012-09-07 16:39:02 +00:00
dmiller
a456186e77 Keep delta readable in Normal output
per http://seclists.org/nmap-dev/2012/q3/756
2012-09-07 16:37:47 +00:00
dmiller
b8604e066c ssl-date date formatting issues
Fix date format string to format as UTC (prepend "!") instead of local
time. Also changed "offset" xmloutput elem to "delta" to match http-date
2012-09-07 15:18:33 +00:00
robert
1a726ba337 Updated hashes to include PHP 5.3.15, 5.3.16, 5.4.5 and 5.4.6. 2012-09-07 10:03:05 +00:00
david
5ab8e37be6 Recognize WSAEADDRINUSE in handle_connect_result.
This happens on Windows when two sockets bind to the same local port and
connect to the same remote port on a remote host. I tried this on Linux;
Linux prevents the second bind from succeeding.

http://seclists.org/nmap-dev/2012/q2/513
2012-09-06 20:11:08 +00:00
david
66c296e27f Use socket_strerror in Nsock callback traces.
Otherwise WinSock error numbers are not understood; you get "Unknown
error" instead of "Only one usage of each socket address
(protocol/network address/port) is normally permitted." for example.
2012-09-06 20:11:04 +00:00
david
3ae9ba63be Make sockets temporarily blocking in ncat_send and ncat_broadcast.
It is possible to send so quickly that we start getting EAGAIN on sends.
In listen mode, this means that some sends can get lost. This patch,
adapted from one by Alex Weber, makes sockets blocking for the duration
of the send. This is not as nice as retrying the send through an event
mechanism, but should at least be correct.

http://seclists.org/nmap-dev/2012/q3/670

Compare a similar patch in r13552, which applied to --exec mode.
2012-09-06 18:17:27 +00:00
david
39f2e06d42 Return size, not 0, in ncat_broadcast when o.recvonly is true.
This is what ncat_send does.
2012-09-06 18:17:21 +00:00
henri
f35cf8b93a Fixed indentation. 2012-09-05 20:55:42 +00:00
henri
902000afad Report an error instead of crashing when pipeline_go() returns nil. 2012-09-05 20:55:04 +00:00
henri
db4b8dc603 Added an extra level of indirection to let the compiler properly expand the macro.
See: http://gcc.gnu.org/onlinedocs/cpp/Stringification.html
2012-09-03 13:39:43 +00:00
david
832f815d33 Use smartly chosen destination ports instead of o.magic_port in -sO.
Using o.magic_port, which is usually used for our source address, or
otherwise is somewhat randomly generated, doesn't make sense here.
Instead, use the same destination ports that we use for host discovery:
80 for TCP and SCTP, and 40125 for UDP.

http://seclists.org/nmap-dev/2012/q3/663
2012-09-02 22:47:45 +00:00
david
f3feb4ec39 Define integer DEFAULT_{TCP,UDP,SCTP}_PROBE_PORT.
These are used to derive the strings
DEFAULT_{TCP,UDP,SCTP}_PROBE_PORT_SPEC.
2012-09-02 22:47:30 +00:00
david
640714f63d Use a more sophisticated configure check for epoll.
This is from the GNU Autoconf archive.

http://www.gnu.org/software/autoconf-archive/ax_have_epoll.html

http://seclists.org/nmap-dev/2012/q3/598
http://seclists.org/nmap-dev/2012/q3/657
2012-09-02 22:47:09 +00:00
patrik
b8ce3d3274 Removed debug print statement 2012-09-02 22:45:16 +00:00
david
f7873c0089 Resolve strict-aliasing problems in ip6_ntop.
addr-util.c:191:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
2012-09-01 03:29:39 +00:00
david
3b55096ab4 Index nmap.list_intefaces return value from 1, not 0. 2012-09-01 03:19:00 +00:00
patrik
f9e457ec7c nse-check-globals cleanup 2012-08-31 15:22:29 +00:00
patrik
13411ab6d1 Fixed a bunch of errors related to inproper responses from webservers. 2012-08-31 15:17:14 +00:00
patrik
b14a8518a3 replaced try/catch with silent failure 2012-08-31 14:59:25 +00:00
dmiller
e5129cf8bf Update ip-geolocation-geobytes for structured output
Also fixed error handling as reported here:
http://seclists.org/nmap-dev/2012/q3/693
2012-08-31 11:46:44 +00:00
aca
c13d7c719a Added msrpc-enum script and msrpc lua changes 2012-08-31 10:00:54 +00:00
dmiller
9c199916b8 ssl-known-key: return if sslcert fails 2012-08-30 23:29:06 +00:00
patrik
fe25ec912f fixed bug that would result in a crash when the browser service would return
an empty result.
2012-08-30 18:39:49 +00:00
patrik
0a0db9f835 Fixed library bug, failing to return _ENV; 2012-08-29 19:11:04 +00:00
david
1b93346162 Update condvar doc example to match r29695. 2012-08-29 10:22:17 +00:00
patrik
6c97e0721d nse-check-globals cleanup 2012-08-29 05:42:27 +00:00
patrik
448bb5a71b fixed a bug in a loop where the script would wait for a condition that was
supposed to be signalled by other threads which were no longer running.
2012-08-29 05:37:56 +00:00
dmiller
c71478d91f Fix interfaces bug in broadcast-listener
Reported here: http://seclists.org/nmap-dev/2012/q3/672
2012-08-28 23:07:28 +00:00
david
c5d3bf247b Add CPE for Minix services. 2012-08-28 14:30:20 +00:00
david
3931741c1d Fix format string errors in Ncat logging functions. 2012-08-28 14:30:08 +00:00
david
13c19f637e Add noreturn and format annotations for Ncat logging functions. 2012-08-28 14:29:49 +00:00
david
f9867163da Use bye in place of fatal. 2012-08-28 14:29:37 +00:00
david
f45f2f394e Ignore supposed replies with nonsense pingseq/tryno.
If we get a reply that doesn't pass the simple comparison using the
current value of USI->seqmask, then ignore it. Previously we emitted the
message "Bad Sequence number from host %s.\n" and allowed the reply to
match any probe. This only matters when using -g because otherwise we
encode that information in the source port. I think we have addressed
what was mentioned in the TODO comment in r15986. Allowing promiscuous
matching, as was done before, causes the same spurious closed port issue
that was addressed in r29686.
2012-08-28 14:29:23 +00:00