1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-22 07:29:01 +00:00
Commit Graph

4571 Commits

Author SHA1 Message Date
david
3b18401d5d Do SSL_read in the same place as a normal socket read in ncat_broker.c
so that read errors for both can be handled in the same place. SSL_read
errors were not being handled at all, which would cause the Ncat broker
to use 100% CPU after a client disconnected. The problem was reported by
Kris at http://seclists.org/nmap-dev/2009/q2/0840.html.
2009-07-10 21:57:45 +00:00
david
df2611a5be [Ncat] Ncat now prints a message like "Connection refused." by
default when a socket error occurs. This used to require -v, but
printing no message at all could make a failed connection look like
success in a case like
  ncat remote < short-file
2009-07-10 20:08:41 +00:00
david
98af0bba24 Add an append_raw method to the Table class to add an unformatted string
to a table. This is going to be for script output.
2009-07-10 01:25:39 +00:00
david
47e79670b6 Add a comment explaining how the NSE_YIELD, NSE_DESTRUCTOR et al.
registry keys are used.
2009-07-09 22:56:04 +00:00
josh
e42d963ec1 [Ncat] Reworked the test program ncat/test/test-cmdline-split and added
additional cases.  Also rewrote cmdline_split in ncat_posix.c
2009-07-09 04:00:35 +00:00
david
36b12c9a21 Make decoding of the "chunked" transfer encoding more robust in
http.lua. Previously the code was not careful about checking its input,
and would loop forever if it got something non-hex where it expected a
hex chunk-size. See http://seclists.org/nmap-dev/2009/q3/0013.html.

This code raises an error whenever decoding fails for whatever reason.
It also handles chunk extensions. The reference is section 3.6.1 of
RFC 2616.
2009-07-09 03:07:31 +00:00
david
871629626e Simplify and comment getinterfaces_siocgifconf to make its structure
more clear: We call several different ioctls on each interface and use
the results to populate the interface_info array.
2009-07-09 00:09:25 +00:00
david
1d5f68a080 Remove a bogus leftover use of a valid pointer as a throwaway variable
in getinterfaces. This was the cause of an overlapping memcpy reported
at http://seclists.org/nmap-dev/2009/q2/0713.html.

In the code, sin is a pointer that holds the address of the IP address
configured for an interface. It is copied into a tmpifr.ifr_addr before
each ioctl, perhaps because that is required on some platforms even
though on Linux only ifr_name is needed by the ioctl. When the ioctl
returns, it overwrites whatever was in ifr_addr because that member is
in a union, so sin is kept in order to restore the address again before
the next ioctl.

In the code that handles SIOCGIFNETMASK, sin was mistakenly used as a
temporary pointer and redirected to &tmpifr.ifr_addr. This caused all
future memcpys before ioctl to copy tmpifr.ifr_addr to itself, rather
than copying in the IP address of the interface.

The throwaway sin assignment was not even used; the code that used it
was modified in r2751. So now we just keep sin pointing where it should
the whole time.
2009-07-08 23:09:35 +00:00
fyodor
4e9d7c17a5 update Nmap version number to 4.90RC1, rebuild generated files, except for man pages which are problematic at the moment 2009-07-08 22:32:49 +00:00
david
73fd225180 Add payload.cc and payload.h to the Windows build file. 2009-07-08 21:47:35 +00:00
david
e9d8897cde Use strtol, not strtoll, for Windows compatibility. 2009-07-08 21:46:11 +00:00
david
be55765315 Break up the getinterfaces function, which did one thing for Windows and
another thing otherwise in a big if/else. Now getinterfaces just does
caching and getinterfaces_dnet or getinterfaces_siocgifconf does the
actual interface lookup.
2009-07-08 21:42:03 +00:00
fyodor
599a5cc62f Some changes from chat w/David yesterday 2009-07-08 21:37:02 +00:00
david
cd820ba39b Show the host and port when a script throws an error. 2009-07-08 19:32:40 +00:00
david
ba2e2299f7 Make Ncat --broker imply --listen. 2009-07-08 03:55:12 +00:00
daniel
479bc55652 Consolidate SCTP related TODO items in a dedicated TODO.sctp file,
as suggested by Fyodor in private mail.
2009-07-07 19:03:46 +00:00
luis
395a881514 Modified UDP-payload-related code to make it independent of the NmapOps class so it can be reused by other apps like Nping. More info at http://seclists.org/nmap-dev/2009/q3/0051.html 2009-07-07 18:22:16 +00:00
luis
73c8600bc7 Modified UDP-payload-related code to make it independent of the NmapOps class so it can be reused by other apps like Nping. More info at http://seclists.org/nmap-dev/2009/q3/0051.html 2009-07-07 18:21:30 +00:00
luis
2b4e4e7a8d Fixed a bug in devname2ipaddr(). The IP returned by the function was always 2.0.0.0 due to an error handling a pointer. Check http://seclists.org/nmap-dev/2009/q3/0047.html for detailed information. Also, devname2ipaddr() now makes sure we are dealing with AF_INET devices (currently the getinterfaces() function already skips non AF_INET interfaces, but this way it won't break if that changes in the future.) 2009-07-07 14:37:19 +00:00
fyodor
fca6e39c60 Note Tom's version detection improvements 2009-07-07 06:46:16 +00:00
fyodor
a678608afd add probe for Apache JServ Protocol (AJP) and a match line for Apache Jserv 1.3 from Tom Sellers 2009-07-07 06:42:03 +00:00
fyodor
97f3bb4502 added Traffic Spicer ICAP signature by Tom Sellers 2009-07-07 06:38:49 +00:00
fyodor
b82d5e6fd3 Changes from NSE meeting 2009-07-07 04:15:54 +00:00
josh
f05fa16549 Added a test program to ncat/test to test the cmdline_split function in
ncat/ncat_posix.c.  This is done in preparation for an eventual rewrite of
cmdline_split.
2009-07-07 01:18:53 +00:00
batrick
90a712ae2b Patch to libraries that were inappropriately using globals.
Often two (or more) scripts using the same library would
overwrite the globals each was using. This would result
in (at best) an error or (at worst) a deadlock.

The patch changes the global accesses to local.
2009-07-07 00:20:52 +00:00
david
f6b10157f7 Fix a bug: in deciding whenther to print the diff for a port, a port in
host B was being check to see if it was an extraport in host A.
2009-07-06 22:27:53 +00:00
david
cf5dd5cfd5 Add some things to think about before defining an external data file for
probe payloads.
2009-07-06 19:25:43 +00:00
david
9cc985d870 Fix incomplete merge from /nmap-exp/david/nmap-payloads in r14071
noticed by Daniel Roethlisberger.
2009-07-06 18:53:23 +00:00
david
329ae2fe5c Add a UDP payload (GenericLines) for the echo port. 2009-07-06 18:41:06 +00:00
david
3f8392d974 Add CHANGELOG entry for UDP payloads and add guidelines for payloads to
payloads.cc.
2009-07-06 18:34:29 +00:00
david
2ad8804e64 Merge r10423:14069 from /nmap-exp/david/nmap-payloads. This adds UDP
payload sending by default for certain UDP ports. See
http://seclists.org/nmap-dev/2009/q3/0022.html.
2009-07-06 18:03:50 +00:00
fyodor
eb57221fce Add suggestion that Ndiff be able to show NSE script result changes 2009-07-05 22:49:41 +00:00
daniel
82f698becf Mark the __attribute__ ifndefs merged to upstream libdnet r653. 2009-07-05 21:08:52 +00:00
daniel
f2f66722d8 Making struct packing explicit for sctp.h too. 2009-07-05 21:02:43 +00:00
joao
52bb4f7cd0 dns-zone-transfer.nse now accepts new syntax argument table
comments updated
2009-07-05 10:01:10 +00:00
joao
bfa10a3499 whois.nse now accepts new syntax for table arguments.
comments updated.
2009-07-05 10:00:21 +00:00
joao
53c5e64c43 Fixed local/global issues with some vars 2009-07-05 09:59:02 +00:00
fyodor
549f3927a8 trivial typo fix 2009-07-05 09:38:34 +00:00
luis
98aedb8d1c Fixed a bug in --data-length parsing. User input was not being checked and in some cases that resulted in useless buffer allocations and unpredictable payload lengths. Check http://seclists.org/nmap-dev/2009/q2/0763.html for a complete description of the problem. 2009-07-04 21:15:13 +00:00
fyodor
7da44a92ef Add suggestion of enhancing Ndiff man page 2009-07-04 03:08:37 +00:00
fyodor
ae33f827b3 Note that James Levine wrote an old utility named Ndiff back in 2000 which served a similar purpose 2009-07-04 03:04:33 +00:00
david
9cbde2f3a0 Factor out Ethernet and socket sending function to avoid a big if-else
in send_ip_packet.
2009-07-03 18:52:54 +00:00
david
7eb63c1c2d On some BSD systems, we have to byte-swap the ip_len and ip_off fields before
sending. In send_ip_packet, unswap them after sending so that the buffer is
returned unmodified. Do the packet trace after unswapping the values so that
the correct length and fragmentation offset are reported. On Mac OS X, an
ip_len of 60 (0x003c) was being reported as 15360 (0x3c00) and when ip_off had
the DF flag set (0x4000), it looked like a fragmentation offset of 512
(0x0040 * 8).
2009-07-03 18:27:31 +00:00
david
a4c92f83e7 Use the preprocessor defines IP_DF and IP_OFFMASK instead of literal
0x4000 and 8191.
2009-07-03 18:11:15 +00:00
daniel
1cfb3558c9 Cleanup and introduction of a special section for changes to libdnet
which have been merged to the upstream libdnet repository and thus
do not have to be re-applied when the libdnet version included with
Nmap is updated in the future.
2009-07-03 18:07:20 +00:00
daniel
2ed58055ee Setting eol-style native in preparation of cleanups to NMAP_MODIFICATIONS. 2009-07-03 17:52:54 +00:00
batrick
1963fe7b96 Removed some code that did nothing. 2009-07-03 04:05:10 +00:00
josh
9c374417eb Fixed a formatting mistake in libdnet-stripped/src/intf.c and updated
NMAP_MODIFICATIONS to reflect a bug fix.
2009-07-02 20:33:38 +00:00
josh
294b15ce81 Fixed two memory leaks and a case where an open file may not be closed. 2009-07-02 03:36:43 +00:00
batrick
fa404e03c9 [NSE] This patch is related to the change to eliminate the reliance on
GC for collecting socket locks [1].

If a thread does not close any sockets it creates, and then
returns (or errors), the thread and sockets will keep their "lock" until
garbage collected. This would be the same situation as before in this
particular case (reliance on GC).

To fix this, I have changed the socket unlock system to close all the sockets
of a thread not yielded and remove its "lock".

[1] http://seclists.org/nmap-dev/2009/q2/0624.html
2009-07-02 02:41:11 +00:00