1
0
mirror of https://github.com/nmap/nmap.git synced 2026-01-29 17:49:08 +00:00
Commit Graph

513 Commits

Author SHA1 Message Date
patrik
937b2df7dd changed the extractAttribute function to be case insensitive when retrieving
attributes.
2010-11-04 19:53:01 +00:00
batrick
93528b984c Fixed bad global access. 2010-11-02 23:35:02 +00:00
patrik
5093705244 Added check for already discovered devices in order to avoid duplicates as
reported by David here: http://seclists.org/nmap-dev/2010/q4/257 [Patrik]
2010-11-02 20:46:11 +00:00
patrik
92b6fa9038 o [NSE] Added a new library upnp that provides UPnP support to the scripts
upnp-info and broadcast-upnp-info. The library is largely based on code
  taken from Thomas Buchanan's upnp-info script. [Patrik]
2010-11-02 19:05:19 +00:00
patrik
7b2b7bd227 o [NSE] Added a new library dnssd with supporting functions for DNS Service
Discovery. Moved multicast prerule from dns-service-discovery to a new
  script called broadcast-dns-service-discovery. [Patrik]
2010-11-02 17:22:38 +00:00
ron
2957b4d733 Added http-fingerprint matches for Nessus's HTTP server 2010-11-02 15:42:28 +00:00
ron
61ca42638d Merging changes from http-dns-cleanup branch. A few documentation changes, big improvement to main NSEDoc. 2010-11-02 02:15:39 +00:00
ron
fef25e6a42 Made some big style changes to clean up HTTP library. Primarily focused on improving the interface, NSEDoc, and pipline support 2010-11-02 02:07:01 +00:00
david
d7ab029c76 Fix a documentation typo in rmi.lua. 2010-11-02 01:17:52 +00:00
david
3040659465 Add the rmi.lua library and rmi-dumpregistry.nse script by Martin Holst Swende. 2010-11-01 20:47:48 +00:00
djalal
b18df4d50a Make functions that call Helper.GetProgramInfo() return a string message on errors. 2010-10-31 18:29:15 +00:00
patrik
d0eecf5392 Fixed the following error reported by Ron:
NSE: test threw an error!
[string "local connect, socket_lock = ...;..."]:4: bad argument #2 to 'connect' (string expected, got boolean)
stack traceback:
       [C]: in function 'connect'
       [string "local connect, socket_lock = ...;..."]:4: in function 'connect'
       ./nselib/dns.lua:53: in function 'sendPackets'
       ./nselib/dns.lua:252: in function <./nselib/dns.lua:215>
       (tail call): ?
       (tail call): ?
       (tail call): ?
       (tail call): ?
       ././test.nse:41: in function <././test.nse:15>
       (tail call): ?

[Patrik]
2010-10-29 17:19:06 +00:00
ron
af72edc2a5 Fixed a bug (misspelled variable) in dns.lua 2010-10-29 13:01:37 +00:00
patrik
2c7045aa10 Fixed variable 'host' is not declared in dns.lua, reported by Ron and
introduced by me when adding multicast support. [Patrik]
2010-10-29 05:03:39 +00:00
ron
13bb98b8b8 Bring in changes from my experimental brange, nmap-http 2010-10-27 03:08:08 +00:00
djalal
63f25dcc97 Add more NSEDoc and remove obsolete functions: ToAclMode() replaced by FmodeToOctalString() and ToAclText() replaced by FpermToString(). 2010-10-20 17:33:06 +00:00
djalal
05d8430ecf NSEDoc cleaning and whitespace formatting. 2010-10-20 14:12:11 +00:00
david
877cbab16f o [NSE] Added reporting of the type and bit size of certificate public
keys to ssl-cert.nse. [Matt Selsky]
2010-10-20 05:49:17 +00:00
ron
38ef99bde4 Add back the old fingerprint files. 2010-10-18 21:28:20 +00:00
ron
5460e9c0bf Add back the old fingerprint files. 2010-10-18 21:27:31 +00:00
ron
2608bae6ca Rollback the changes to the HTTP library I accidentally commited in the last revision 2010-10-18 21:23:24 +00:00
ron
b8e712ceeb Added a couple shares to the list of common ones (requested on IRC by kraigus) 2010-10-18 21:16:48 +00:00
david
18157ed081 Merge from /nmap-exp/david/nmap-unconnected. This adds unconnected
socket support to NSE, with updates in scripts and libraries.

o [NSE] Added the ability to send and receive on unconnected sockets.
  This can be used, for example, to receive UDP broadcasts without
  using pcap. A number of scripts have been changed so that they can
  work as prerule scripts to discover services by UDP broadcasting,
  optionally add the discovered targets to the scanning queue:
    - ms-sql-info
    - upnp-info
    - dns-service-discovery
  The nmap.new_socket function can now optionally take a default
  protocol and address family, which will be used if the socket is not
  connected. There is a new nmap.sendto function to be used with
  unconnected UDP sockets. [David, Patrik]
2010-10-16 00:48:44 +00:00
patrik
1aed246b69 fixed bug in authentication encryption function as reported by Sergey
http://seclists.org/nmap-dev/2010/q4/83

changed the way the library reports "Must change password at next logon"
fixed bug in ms-sql-hasdbaccess that would occur if no rows were returned
[Patrik]
2010-10-15 19:47:54 +00:00
kris
40a4644055 o [NSE] Improved ssh2's kex_init() parameters: all of the algorithm
and language lists can be set using new keys in the "options" table
  argument. These all default to the same value used before. Also, the
  required "cookie" argument is now replaced by an optional "cookie"
  key in the "options" table, defaulting to random bytes as the RFC
  says the value should be. [Kris]

Only ssh2's fetch_host_key() uses this function, but I'm working on
a script and noticed the design flaw regarding the cookie arg (scripts
shouldn't be required to always pass this when it's specified that its
value should be random).  The rest was added because the default is
just a subset of algorithms offered across implementations.
2010-10-13 03:34:00 +00:00
ron
727661921a Implemented some changes (mostly in error handling) to let smb scripts run in parallel with each other against a single host. Previously, I had used a mutex to prevent that from happening. The changes are summarized in the following post: http://seclists.org/nmap-dev/2010/q3/819, but it comes down to three things:
1) Set the 'vc' ('virtual circuit') id to a non-zero value (if it's 0, the smb server will disconnect all hosts who are already connected)
2) Handle the authentication error NT_STATUS_REQUEST_NOT_ACCEPTED, which indicates that there are too many connected hosts (11 is the default on most versions of Windows, or 10 for the anonymous account). If we see the error, we wait and try again. 
3) Handle the file creation error, NT_STATUS_PIPE_NOT_AVAILABLE, which appears to be caused by a race condition of some sort. It happens when a large number of connections are attempted simultaneously, and is fixed by a short backoff (50ms worked fine, but I'm using 100ms)
The end result is a significant speedup in our SMB checks without losing data.
2010-10-03 22:40:41 +00:00
david
e7fc9c4c5f Change " \n" to just "\n" where appropriate in NSE. Leading newlines are
no longer removed from script output.
2010-09-30 05:03:39 +00:00
david
3927d53e00 Simplify get_script_args and remove the deprecation warning. 2010-09-29 19:29:09 +00:00
david
53bd35c9cd Increase the debug level required to print out the http.lua cache size. 2010-09-27 18:51:04 +00:00
djalal
4baeee0dfc Whitespace formatting and some code cleaning. 2010-09-27 13:19:25 +00:00
david
92362b2d24 Move special request body handling out of http.post and into http.generic_request. 2010-09-27 01:21:45 +00:00
david
9f79aad78f Pass the driver_options whenever constructing a driver in brute.lua. This could
be required, for example, when running the check method.
2010-09-27 01:20:52 +00:00
djalal
769db9823a o Added the debug level to some print_debug() functions that were missing this argument.
o Create the mutex in the RpcInfo() function before the connect call, to prevent some rare race conditions that can cause one of the running rpc and nfs scripts to fail. This mutex is used to cache the portmapper program list in the registry, to reduce the number of connections and RPC DUMP procedure calls.
o whitespace formatting.
2010-09-26 12:55:05 +00:00
ron
9ae7fb6a5d Added the REQUEST_TARGET flag to the extended authentication packet. I have no clue what that flag does, and I can't find any documentation, but Nmap completely fails against Windows 7 unless it's set. 2010-09-24 03:42:38 +00:00
ron
f71008bcd3 Fixed a spelling mistake in a variable name in msrpc.lua 2010-09-24 03:38:11 +00:00
ron
a477d142f1 Updated stdnse.get_script_args() function to take arrays in addition to strings. If an array is passed, currently, the first name is considered 'valid' and the others are considered 'deprecated'. This behaviour is still under discussion. 2010-09-24 02:52:00 +00:00
ron
11ad4fafd5 Fixed a nil-pointer exception caused by certain printers and OS X machines. An array in the result was set to nil instead of 0-length, which was unexpected. 2010-09-24 01:22:36 +00:00
ron
2035b82dfd Fixed a really tricky bug that I spent all evening chasing. Normally, during login, every account in the list (by default, guest and anonymous) are attempted. Unless something fails badly, anonymous will work. Unfortunately, if something DOES fail badly, after the first script runs this list is empty. That means if something bad is happening, and two or more scripts are running, every script after the first will have an empty list of accounts to use, and it would fail mysteriously. This patch checks the return value from the get_next_account() function properly to see if we've run out of accounts and report that to the user rather than an ugly stacktrace. 2010-09-24 00:47:43 +00:00
ron
3bc39efc4b Lots of little bugfixes throughout several smb scripts, mostly related to bad use of global variables 2010-09-24 00:31:12 +00:00
batrick
de4ba536de Merge from /nmap-exp/patrick/nse-nsock-maintenance.
This is a maintenance fix for the NSE Nsock library binding. The patch focuses
on code correctness and simplicity. The patch also brings some initial updates
with an eye towards the upcoming Lua 5.2 release. See [1] for a post concerning
this branch.

[1] http://seclists.org/nmap-dev/2010/q3/710
2010-09-18 20:35:09 +00:00
patrik
e3781bb25d Changed the code to be more iterator oriented. Scripts can now add their own
iterators. Mutliple iterators may be added and the library provides a number
of common ones. [Patrik]
2010-09-14 19:43:53 +00:00
david
600848c268 Fix NSEDoc (@param not @arg). 2010-09-14 02:02:50 +00:00
david
4a6389af44 Fix NSEDoc typo. 2010-09-13 17:51:34 +00:00
batrick
ed3ac6bc0e accidental global fixes 2010-09-13 06:09:42 +00:00
djalal
c9a756bc12 Clean debug messages and make debug level 3 the default debug level for the 'adding new targets' code. 2010-09-03 17:53:34 +00:00
djalal
c7c502b227 Merge r19520:r20039 from nmap-exp/djalal/nmap-add-targets. This will let NSE scripts to add new discovered targets to future Nmap scans. 2010-09-01 01:50:34 +00:00
ron
89888ef6b3 Added DHCP library and re-wrote dhcp-discover.nse to use the new library. 2010-08-28 17:18:40 +00:00
kris
8729f667fe Some new NSE functions:
o [NSE] Added the nmap.resolve() function which takes a host name and
  optionally an address family (such as "inet") and returns a table
  containing all of its matching addresses.  If no address family is
  specified, then all of the addresses are returned for the name. [Kris]

o [NSE] Added the nmap.address_family() function which returns the address
  family Nmap is using as a string (e.g., "inet6" is returned if Nmap is
  called with the -6 option). [Kris]
2010-08-27 04:17:51 +00:00
patrik
d4e0b179c1 Fixed a number of incorrect receives and replaced them with receive_bytes.
Added some logic to make sure all data is read off the socket.
2010-08-24 20:25:46 +00:00
patrik
8cd97c4103 added additional documentation regarding the Error object 2010-08-20 17:58:13 +00:00