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

4399 Commits

Author SHA1 Message Date
david
598d94f6f5 Return false in new_try handlers in proxy.lua, so that socket errors are
reported to the caller like other errors are.
2010-02-27 00:27:49 +00:00
david
ffb34b2259 Make sure port.service exists before passing it to string.match. This
bug was reported by Brandon.
2010-02-27 00:16:29 +00:00
david
c2a4f8b442 Quote string with Lua's %q format in nsedebug.tostr, so you can tell the
difference between nil and "nil".
2010-02-27 00:14:24 +00:00
david
49e36a57f3 Add a function free_services that tells Nmap to reload the nmap-services
file again when it needs it. This is called from nmap_free_mem, because
cp_free (also called by nmap_free_mem) invalidates members of the
services data structures.

In normal use this doesn't matter. It only matters when reinvoking the
engine several times with --interactive.
2010-02-26 22:29:03 +00:00
david
9f55412954 Initialize numhosts_up, numhosts_scanned, and numhosts_scanning in
NmapOps::Initialize.
2010-02-26 21:38:04 +00:00
david
dc45a0b8f8 Reinitialize scriptargs and chosenScripts in NmapOps::Initialize. 2010-02-26 21:34:13 +00:00
david
ba5e337db8 Reset port_list_count in PortList::freePortMap. 2010-02-26 21:25:41 +00:00
david
e32a406032 Fix code style in PortList::freePortMap. 2010-02-26 20:58:54 +00:00
kris
a42ea72a97 Merge through r16884 from /nmap-exp/kris/nse-rawip plus the following changelog
entries:

o [NSE] Raw packet sending at the IP layer is now supported, in addition to
  the Ethernet sending functionality.  Packets to send start with an IPv4
  header and can be sent to arbitrary hosts. [Kris]

o [NSE] Added the ipidseq script to classify a host's IP ID sequence numbers
  in the same way Nmap does.  This can be used to test hosts' suitability for
  Nmap's Idle Scan (-sI), i.e. check if a host is an idle zombie.  This is
  the first script to use the new raw IP sending functionality in NSE. [Kris]

o [NSE] Added the function nmap.is_privileged() to tell a script if, as far
  as Nmap's concerned, it can do privileged operations.  For instance, this
  can be used to see if a script should be able to open a raw socket or
  Ethernet interface. [Kris]

o [NSE] Added the function nmap.get_ports() to allow a script to iterate
  over a host's port tables matching a certain protocol and state. [Kris,
  Patrick]
2010-02-26 20:42:10 +00:00
david
480394756b Call CloseHandle on the hThread member of the PROCESS_INFORMATION structure we
get back from CreateProcess. We were already closing hProc but hThread has to
be closed too to avoid a handle leak. See the code example at
http://msdn.microsoft.com/en-us/library/ms682512(VS.85).aspx.
2010-02-26 01:57:05 +00:00
david
84a388aeb9 Give datafiles.lua the ability to parse nmap-mac-prefixes, and use it in
nbstat.nse to look up the MAC vendor string.
2010-02-26 00:27:30 +00:00
david
1f7e90a0af Add CouchDB and JSON scripts to TODO. They're almost done, I just don't
want to forget about them.
2010-02-26 00:24:24 +00:00
david
2099944ef0 Move entries in libdnet-stripped/NMAP_MODIFICATIONS to reflect recent
upstream merges by Jay Fink.

http://code.google.com/p/libdnet/source/detail?r=654
http://code.google.com/p/libdnet/source/detail?r=655
http://code.google.com/p/libdnet/source/detail?r=656
2010-02-24 01:54:56 +00:00
david
bf612ba7c9 o [NSE] Added the ssl-enum-ciphers script from Mak Kolybabi. This
script lists the ciphers and compressors supported by an SSL/TLS
  server.
2010-02-24 01:33:16 +00:00
fyodor
3358c32fe2 TODO changes from chat w/David 2010-02-23 23:13:21 +00:00
david
77119bb4d8 Use the cached value of recv_fd when removing descriptors from the read
and broadcast lists when a connection is broken, instead of re-reading
the descriptor from the fdinfo struct. The problem was that there were
two calls to rm_fd, and the first one invalidated the data that the
struct pointer pointed to.

For some reason this didn't cause any problems in most situations. Mak
Kolybabi reported that it caused a segfault in
	ncat -l --ssl -k -v 5061 > /dev/null < /dev/zero
With SSL, new connections would try to read memory that was previously
freed, as descriptors were not being removed from the broadcast list as
they were removed from the read list.

You can see the error in these debug logs:

NCAT DEBUG: Closing connection.
NCAT DEBUG: Swapping fd[2] (4) with fd[3] (5)
NCAT DEBUG: Removed fd 4 from list, nfds 3, maxfd 5
NCAT DEBUG: Swapping fd[1] (5) with fd[1] (5)
NCAT DEBUG: Removed fd 5 from list, nfds 1, maxfd 4

The "Remove fd X" should have the same X in both lines.
2010-02-23 20:59:31 +00:00
fyodor
c83f5474b7 minor updates to TODO 2010-02-23 06:35:25 +00:00
david
e603eadd96 Remove TRACE from the http-methods.nse "uninteresting" set on a
recommendation from Daniel Roethlisberger. TRACE is interesting because
it can be used to get cookies or authentication data in a cross-site
scripting attack. See http://www.owasp.org/index.php/Cross_Site_Tracing.
2010-02-22 21:42:47 +00:00
david
a67be3d7d1 Take smtp-open-relay.nse out of {"demo"} and into {"discovery",
"intrusive", "external"} following some improvements by Duarte Silva.
2010-02-22 17:52:13 +00:00
patrik
08063ebd32 Added dependency for ldap-brute to ldap-rootdse.nse 2010-02-21 08:56:10 +00:00
patrik
42da3e0ba0 o [NSE] Added a new library for LDAP and two new scripts:
- ldap-brute uses the unpwdb library to guess credentials for LDAP
  - ldap-rootdse retrieves the LDAP root DSA-specific Entry (DSE)
2010-02-21 08:52:44 +00:00
ron
3a3535e07c Fixed a couple formatting bugs in the smb-* libraries that come up when debugging/verbose is disabled 2010-02-20 15:03:11 +00:00
fyodor
62155f108f latest generated man pages 2010-02-19 06:28:14 +00:00
fyodor
fa4b57661a latest generated man pages 2010-02-19 06:28:02 +00:00
fyodor
a230256d7b latest generated man pages 2010-02-19 06:27:45 +00:00
david
29efe81bf1 Add http-methods.nse to the default category. Make it silent if the only
methods it discovers are in (GET, HEAD, POST, OPTIONS, TRACE). In
verbose mode, or if any other method is discovered, it prints all
methods (and optionally retests them). See
http://seclists.org/nmap-dev/2010/q1/401.
2010-02-19 05:42:36 +00:00
david
3510744a54 Canonicalize the formatting of some functions in http.lua. 2010-02-19 05:13:02 +00:00
david
4178846c05 Honor the options table in http.request (specifically options.timeout).
I think this was supposed to work but it was broken.
2010-02-19 05:06:57 +00:00
david
752fd5331b Use http.generic_request in http-iis-webdav-vuln.nse. 2010-02-19 05:03:00 +00:00
david
650e639f1f Rewrite http-methods.nse to use the http.generic_request function
instead of doing its own socket handling. Also make the output more
concise.
2010-02-19 04:55:38 +00:00
david
bb2e8c439b Factor out common code for HTTP request building. Replace the two-step
buildGet/buildRequest with a one-step build_request. Provide a new
function generic_request that can do a request for any given method
(get, head, and post are now defined in terms of this function).
2010-02-19 04:54:28 +00:00
david
7f892c1563 Don't pass the cookies table as a parameter, but as a member of the
options table, in http functions. It was unreasonable that this
yet-unused feature was given a more prominent place than even the header
and request body, both of which are in the options table.

This change doesn't affect any other scripts or libraries because none
of them use cookies. In the cases, like http.get, where cookies was an
optional final parameter, I just removed it. Where it was not the final
parameter, as in http.post and http.pGet, I left the parameter in place
but documented that it is ignored for backwards compatibility.
2010-02-19 03:25:57 +00:00
david
ffd7a6dba5 Do some cleanup and shortening of http-methods.nse. 2010-02-19 02:34:45 +00:00
david
9632670762 o The -v and -d options are now handled in the same way. The three
forms are equivalent:
    -v -v -v    -vvv    -v3
    -d -d -d    -ddd    -d3
  Formerly, the -ddd and -v3 forms didn't work. Mak Kolybabi submitted
  a patch.
2010-02-17 19:12:15 +00:00
david
d14f12d2f1 Add more pending NSE review to TODO. 2010-02-17 17:56:57 +00:00
david
6a2598772a Add to CHANGELOG:
o Nping, the packet generation program by Luis MartinGarcia, is now
  included in the Nmap distribution.
2010-02-17 01:59:05 +00:00
david
a669c3a39f Merge r16779:16804 from /nmap-exp/david/nmap-nping. This adds Nping
into the standard distribution.
2010-02-17 01:46:34 +00:00
david
fca2f90143 Add a couple more pending script reviews to TODO. 2010-02-17 00:49:47 +00:00
fyodor
e7c3022fea updates to TODO 2010-02-16 23:06:07 +00:00
ron
811ebc1e44 Updated script.db with http-vmware-path-vuln.nse 2010-02-16 18:25:30 +00:00
patrik
2ed728a6f1 Corrected incorrect match line for SqueezeCenter CLI and added song count 2010-02-16 16:09:54 +00:00
ron
1421838d94 Added http-vmware-path-vuln.nse, a script that checks for a path-traversal vulnerability in VMWare (CVE-2009-3733) 2010-02-16 14:42:10 +00:00
patrik
feb6a47767 Updated the script.db to include recently added scripts. 2010-02-16 10:00:32 +00:00
patrik
d2e54f0bf2 o [NSE] Added a new library for ASN.1 parsing and adapted the SNMP library to
make use of it. Added 5 scripts that use the new libraries:
  - snmp-netstat shows listening and connected sockets
  - snmp-processes shows process information including name, pid, path and 
    parameters
  - snmp-win32-services shows the names of running Windows services
  - snmp-win32-shares shows the names and path of Windows shares
  - snmp-win32-software shows a list of installed Windows software
  - snmp-win32-users shows a list of local Windows users
2010-02-16 09:15:38 +00:00
david
3f36981440 Qualify an assertion to allow zero-byte writes in Nsock. The assertion
checked that the internal buffer was not empty before a send; I changed
it to have an effect only when at least one byte has been written
already.

Formerly, zero-byte sends such as socket:send("") in NSE would crash
Nmap, for both UDP and TCP. I tested this change on Linux, and for UDP
it sends a zero-byte datagram, and for TCP it sends nothing at all.
2010-02-15 20:21:29 +00:00
patrik
cd0e6496c6 Added a service probe for Logitech SqueezeCenter command line interface 2010-02-15 18:59:29 +00:00
patrik
fe8074c836 Improved PostgreSQL match lines by matching the line of the error to a specific version. 2010-02-13 08:15:58 +00:00
david
3a11dafeaa o Added a mac_addr_next_hop member to the host tables used in NSE.
[Michael Pattrick, kx].
2010-02-13 01:48:59 +00:00
kris
003cc98eab nmap.luadoc typos 2010-02-12 23:41:56 +00:00
david
69235612bd Add to CHANGELOG:
o Removed the nmap_service.exe helper program for smb-psexec, as it
  was still being flagged by malware detection even after the
  bit-flipping in the next release. You can now download it from
  http://nmap.org/psexec/nmap_service.exe. (The script will remind you
  if it's not installed.)
2010-02-12 23:19:26 +00:00