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

994 Commits

Author SHA1 Message Date
henri
16ea382e9b Added a maximum number of retries to mitigate a remote DoS in the RPC
packets parsing code. The number was chosen high to avoid decreasing
accuracy. It's just about having an upper limit.
2012-10-20 14:59:53 +00:00
robert
8430ba2792 Added support for SQL Server 2012 (tested against RTM and fully patched), and added version numbers for latest service packs on older versions of SQL Server (as they've not been updated for far too long). 2012-10-18 06:45:47 +00:00
patrik
855a82fbc3 refactoring and code cleanup 2012-10-14 19:15:39 +00:00
patrik
89dab3fe14 code re-factoring and cleanup 2012-10-10 22:19:49 +00:00
patrik
121cc35de6 nse_check_globals cleanup 2012-10-07 12:54:31 +00:00
patrik
40b1c4705b check_globals cleanup 2012-10-07 12:39:21 +00:00
patrik
81b6bae5eb Squashed commit of the following:
commit e5cb0a18d5474730310f1797016e1106c33ca059
Author: Patrik Karlsson <patrik@cqure.net>
Date:   Sun Oct 7 10:47:35 2012 +0200

    compatibility fixes to spnego authentication in smb and smbauth libraries

    the spnego authentication blob now decodes properly in wireshark
    fixes in spnego authentication for both Window 2003 and Windows 7
2012-10-07 08:54:34 +00:00
henri
1f31f2e991 Typos 2012-10-06 21:24:50 +00:00
henri
ff60e9f9e0 Typos 2012-10-06 21:19:22 +00:00
patrik
6cfa5aea0f o [NSE] Added oracle-brute-stealth which exploits CVE-2012-3137, a weakness
in the Oracle O5LOGIN authentication scheme. [Dhiru Kholia]
2012-10-06 19:59:45 +00:00
patrik
655f766445 reverted bad commits 2012-10-06 19:38:15 +00:00
patrik
10a34f626a Squashed commit of the following:
commit 5de9e4fa623f88a9b48ef0704244ff843005573a
Author: Patrik Karlsson <patrik@cqure.net>
Date:   Sat Oct 6 21:19:08 2012 +0200

    Applied patch from Dhiru Kholia adding oracle-brute-stealth and needed changes

    reworked the patch slightly and added;
    - support for specifying account on command line
    - johnfile argument for writing hashes directly to file
2012-10-06 19:25:13 +00:00
patrik
2e5a448aa5 Revert "Squashed commit of the following:"
This reverts commit 71f5f22e79bdb44fffa14edd5d3ffa570efde8ed.
2012-10-06 19:25:04 +00:00
david
b19647254d Typo. 2012-09-23 21:15:20 +00:00
dmiller
520651a9ed Check for timeout when trying reserved ports
rpc.Comm.Connect was trying to bind to 424 reserved ports, which is
overkill. Since nsock doesn't do an actual bind(2) call until
socket:connect for TCP, that meant up to 424 connect calls, each of
which is currently leaking a socket. This commit contains 3 fixes:

1. Add nmap.new_socket calls for non-privileged code path that were
moved inside the privileged loop to originally address the leak.

2. Check for TIMEOUT on each of the TCP connect calls and abandon the
Connect, avoiding many timeouts.

3. Try 10 random reserved ports (from 1 to 1024) instead of 400+.
Should be good odds of finding one unused, even when lots of threads are
trying (though empirical results would be helpful). Also, this should
reduce load since thread n won't need to fail n-1 bind attempts.
2012-09-21 02:39:48 +00:00
david
23625913a8 Create (and close) a new socket in rpc Connect, don't reuse one.
It appears that connecting more than one with the same nse_nsock socket
leaks socket descriptor. For example,

local s = nmap.new_socket()
s:connect(host, port) --> TIMEOUT
s:connect(host, port) --> TIMEOUT
s:close()

leaks a socket descriptor, the one used in the first connect. Nsock
should really take care of this, but let's do this workaround because
rpc-grind has been causing problems due to using the above pattern:

http://seclists.org/nmap-dev/2012/q3/864
http://seclists.org/nmap-dev/2012/q3/872
http://seclists.org/nmap-dev/2012/q3/949

The difficulty is that the rpc library will tolerate around 400 of those
timeouts per RPC connection, which leads to rapidly running out of
descriptors.
2012-09-21 01:08:14 +00:00
david
cc126ea7d4 Fix removal (assignment to nil) of elements in stdnse.output_table.
There was a reverse table that was meant to map keys to their position
in the order table, to make it easy to table.remove an entry from order.
But removing something from order would shift the indices of all
following elements by 1, and those elements were not updated
correspondingly in the reverse table. Instead, do a linear lookup for
the the element to remove from order, after checking that the element
exists at all.

http://seclists.org/nmap-dev/2012/q3/905
2012-09-20 06:47:42 +00:00
david
8f39b485a0 Add cassandra scripts from Vlatko Kosturjak. 2012-09-20 06:30:48 +00:00
david
a4a046ac4c Let dnet:ip_send take a destination address.
Previously we always took the destination address from the packet
buffer, which failed for IPv6 link-local addresses because the packet
buffer does not contain the scope id.
2012-09-15 17:56:19 +00:00
david
44c5c227d3 Revert "Document dnet:ip_send to take a destination address."
This reverts r29795. It's not finished yet.
2012-09-15 15:06:15 +00:00
david
78cf2dfb06 Document dnet:ip_send to take a destination address. 2012-09-15 15:05:11 +00:00
david
6d0e34ad7b nmap.ip_send is for both IPv4 and IPv6. 2012-09-15 07:27:27 +00:00
kroosec
ca43a6d59f Added http fingerprints by Jesper Kückelhahn for Sitecore CMS. 2012-09-12 21:57:49 +00:00
david
d9b73da3a1 Give sample return values for smb.get_os. 2012-09-08 17:05:33 +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
patrik
b8ce3d3274 Removed debug print statement 2012-09-02 22:45:16 +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
aca
c13d7c719a Added msrpc-enum script and msrpc lua changes 2012-08-31 10:00:54 +00:00
patrik
0a0db9f835 Fixed library bug, failing to return _ENV; 2012-08-29 19:11:04 +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
tomsellers
5ba2007d69 Added or enhanced support for the following data types:
SQLTEXT       = 0x23 - text
GUIDTYPE      = 0x24 - uniqueidentifier
NTEXTTYPE     = 0x63 - unicode text (ntext)
BITNTYPE      = 0x68 - boolean
DECIMALNTYPE  = 0x6A - decimal
NUMERICNTYPE  = 0x6C - numeric
FLTNTYPE      = 0x6D - float/real/double
MONEYNTYPE    = 0x6E - money / smallmoeny
BIGBINARYTYPE = 0xAD - binary
BIGCHARTYPE   = 0xAF - char
SQLNCHAR      = 0xEF - unicode char (nchar)

Added detection and handling of null values when processing query responses from the server.
Added DoneProc response token support
Reordered ColumnData and ColumnInfo parsers by data type code to make updates easier.
2012-08-24 10:32:44 +00:00
aca
fd32aec639 Merged http-slowloris-check 2012-08-24 09:19:30 +00:00
jah
0936515cd9 Restored the hyphen character, in get_ips_from_range, to a lua string pattern for ip ranges such as "10.0.0.0 - 10.1.0.0" 2012-08-21 01:16:49 +00:00
dmiller
4728d7437d Fixes to rpc-grind
NSE: rpc-grind Connect(): RPC library does not support: nil protocol
NSE: rpc-grind Connect(): RPC library does not support: rpcbind version
81578896

These errors caused by ChkProgram and ChkVersion called from
rpc.Comm.Connect. Added a dummy program in rpc-grind and a check for
self.checkprogver in ChkVersion, and everything works great.

Also fixed portrule to only fail if the non-rpcbind service name was not
the result of table lookup. Was failing on port 2049 (in nmap-services
as "nfs") without -sV.
2012-08-18 03:32:50 +00:00
patrik
4157e63c9e nse_check_globals fixup 2012-08-17 05:37:59 +00:00
dmiller
9fbd30f191 Use ISO8601 time for smb-os-discovery 2012-08-16 15:46:37 +00:00
dmiller
86d1f0db47 Fix ARP decoder in packetdecoders.lua
Was throwing an exception when parsing a packet with a source IP that
had a fourth octet greater than 127, since the %d format specifier used
in the dups check is for signed integers, and the IP is little-endian.
Switched to %u (unsigned int) and it works great.
2012-08-15 19:25:44 +00:00
kroosec
8ff4cebbf7 Moved EIGRP decoding in packetdecoders.lua to use eigrp.lua library. 2012-08-15 09:17:20 +00:00
kroosec
f4917e6ce9 Added eigrp.lua library. 2012-08-15 01:47:30 +00:00
aca
3a44307320 Copy/paste error 2012-08-14 19:57:58 +00:00
patrik
17e56e8271 nse_check_globals cleanup 2012-08-14 18:47:46 +00:00
david
0c3e0fcc4d Structured script output.
Scripts may now return a key–value table, or such a table in addition to
a string. The table will be automatically formatted for normal output
and will appear as a hierarchy of elements in XML output.

Some history and discussion of this development can be found at
https://secwiki.org/w/Nmap/Structured_Script_Output.

This is a merge of r29484:29569 from /nmap-exp/david/xml-output.
2012-08-14 16:36:25 +00:00
aca
16aa7a938d Merged jdwp library, scripts and java classes into trunk 2012-08-14 11:31:08 +00:00
dmiller
346a495dd0 Squashed commit of the following:
commit 7c26e4de2ab365a30fe6e91f3a531eb38c8dfdba
Author: Daniel Miller <bonsaiviking@gmail.com>
Date:   Tue Aug 7 16:36:54 2012 -0500

    Fix indentation on netbios.lua (no code change)

commit 47dc3e32e6b47bd80620cfbc54e7590193dd0c1a
Author: Daniel Miller <bonsaiviking@gmail.com>
Date:   Tue Jul 31 16:42:27 2012 -0500

    Make smbauth.lua use host, not nmap, registry

commit 3738f8e6d551a1260463609d8cda86918843a372
Author: Daniel Miller <bonsaiviking@gmail.com>
Date:   Tue Jul 31 16:35:45 2012 -0500

    Make netbios.lua use host registry. Functions now can take host table or IP

commit 031cadb9d407ab7fd43aaddffda1a89c24cbdd45
Author: Daniel Miller <bonsaiviking@gmail.com>
Date:   Tue Jul 31 15:54:12 2012 -0500

    Remove mac-geolocation info from snmp-interfaces

commit 2218dbaf8ffd4a33de2bc028def9be7301dfb3a2
Author: Daniel Miller <bonsaiviking@gmail.com>
Date:   Tue Jul 31 15:52:36 2012 -0500

    Make path-mtu.nse use host, not nmap, registry

commit 5a3d006bdb9cd3e981a8e753c92b5ade5059a29b
Author: Daniel Miller <bonsaiviking@gmail.com>
Date:   Tue Jul 31 15:51:53 2012 -0500

    Make cvs-* scripts use host, not nmap, registry
2012-08-07 21:38:48 +00:00
batrick
cc6d7b67bf Fix r29529. Alias was wrong. 2012-08-07 17:37:10 +00:00
batrick
036d28c898 Remove nmap.sleep as we just want to have stdnse.sleep. 2012-08-07 17:25:49 +00:00
patrik
7e85545ea3 Fixed bug in return values for openssl pcall in libraries mssql and smbauth 2012-08-06 00:18:55 +00:00