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

439 Commits

Author SHA1 Message Date
ron
9365ad46e9 Added a README explaining the purpose of the encoded binary. 2010-01-25 21:22:22 +00:00
kris
d1e4ae6dc7 Set header variables like ip_ttl when calling ip_set_ttl() rather than just
setting the packet data.  This was confusing watching packets go correctly
over the wire but having incorrect variables.
2010-01-24 20:16:40 +00:00
ron
ba9532c2d4 Changed an error message throughout smb.lua that I never really liked. 2010-01-23 17:25:30 +00:00
ron
b00f6234d5 Fixed some bugs found by Brandon Enright in smb.lua. They were all caused by servers returning less bytes than they're supposed to. This revision basically makes the broken-server detection more robust. 2010-01-23 17:23:57 +00:00
ron
13f8f95a5f nmap_service.exe is now encoded locally by xor'ing each byte by 0xFF. It is decoded in line before it is uploaded. This is to prevent antivirus false positives from picking it up. 2010-01-23 16:56:49 +00:00
david
12ccaa7786 Remove a speck of uncertainty from favicon-db. 2010-01-23 01:54:32 +00:00
david
e942244ba2 Add a patch to dns.lua from Patrik Karlsson to cope with some mDNS
implementations.
2010-01-22 23:44:51 +00:00
david
86c3be8180 Remove local declarations from the usage example in unpwdb.lua on a
suggestion from Patrick Donnelly. The for loops already localize their
variables.
2010-01-22 21:54:52 +00:00
david
5d7f91a6b2 Add a @usage section to unpwdb.lua showing how to use the iterators. 2010-01-22 21:10:55 +00:00
ron
354eaca0ff Re-wrote smb-enum-domains.nse to be more generic and rely on library functions. Ultimately, I want to use these same functions in smb-brute to trim out impossible passwords and figure out account lockout policies before the bruteforce starts. It'll make smb-brute a little cleaner after the changes. 2010-01-22 04:43:51 +00:00
david
349f0edad0 Let http.next_response receive a body in response to a HEAD request, if
there is one. Even though section 4.4 of RFC 2616 says that sending a
body in response to a HEAD request is a MUST NOT, pyllyukko sent me a
sample from a server that does--"LuCI - Lua Configuration Interface".
2010-01-21 19:42:52 +00:00
david
929042a690 Fix the first round of HTTP pipeline requests. The pipeline makes an
initial request to get a value stored in the Keep-Alive header, which is
the size of the pipeline. It then iterates, doignt hat many requests at
once until the list of requests is exhausted. The prbolem was that in
the first round, it didn't count its initial Keep-Alive probe. So if the
server said it was good for 40 requests, we would send 41 before closing
the connection. Even worse was when the initial probe returned a
"Connection: close"; the pipeline would try another request before
closing the connection for the first time.
2010-01-21 17:43:23 +00:00
david
c7b4af21db o [NSE] Fixed a bug in http.lua that could lead to an assertion
failure. It happened when there was an error getting the a response
  at the beginning of a batch in http.pipeline. The symptoms of the
  bug were:
    NSE: Received only 0 of 1 expected reponses.
    Decreasing max pipelined requests to 0.
    NSOCK (0.1870s) Write request for 0 bytes...
    nmap: nsock_core.c:516: handle_write_result: Assertion `bytesleft > 0' failed.
  The error was reported by Brandon Enright and pyllyukko.
2010-01-21 16:28:39 +00:00
david
d390452e36 Fix a string format error in the HTTP dechunking code. 2010-01-21 00:35:12 +00:00
david
8a895ff0d9 Fix an error with http.request: If there was a parsing error or a
network error, it was returning nil instead of a table as documented.
2010-01-21 00:23:56 +00:00
david
a105f13975 afp script updates from Patrik Karlsson. 2010-01-20 23:47:04 +00:00
david
ceaf1a9b16 Additions to dns.lua from Patrik Karlsson. Adds an answer fetcher for
TXT and SRV records, and a function get answers from the additional
section.
2010-01-20 22:54:20 +00:00
david
69000c63f0 Add afp.lua and afp-showmount.nse from Patrik Karlsson. See
http://seclists.org/nmap-dev/2010/q1/97.
2010-01-20 21:49:30 +00:00
david
ac2cbcc97f Fix the decoding of OID component values greater than 127 in snmp.lua.
This is analogous to r16265, which did the same thing for encoding.
2010-01-19 23:45:58 +00:00
batrick
da041cb0b3 Get rid of <em>/<strong> tags because there is no uniform
way to use them across DocBook and HTML.
2010-01-16 01:59:12 +00:00
batrick
d1a4984d8d Fixed a typo. 2010-01-16 01:38:38 +00:00
ron
958ba69422 fixed another bug in format_output(), thanks to Patrik. 2010-01-13 21:18:36 +00:00
ron
e47175b4b8 Fixed broken indentation for single-element subgroups in stdnse.format_output(). 2010-01-13 21:03:20 +00:00
david
19c2d93903 Merge from /nmap-exp/david/nselib-http. This is an overhaul of HTTP
parsing mostly. Response parsing is centralized, and fewer operations
are done on raw HTTP data.

The biggest user-visible change is that http.request goes back to
returning a parsed result table, not raw HTTP data. I believe this is
how the function worked in the past; it's what the NSEDoc for the
function says. The only thing that used http.request was citrixxml.lua,
and this commit alters it to match the new expectations.

The other change is that the http.pipeline function no longer accepts
the "raw" option. The only script that used that was sql-injection.nse,
and this commit modifies that script as well.
2010-01-13 02:53:13 +00:00
david
f5cae99a2a Check that nmap.registry.args exists before trying to access
nmap.registry.args["http.useragent"]. The args table doesn't exist
during --script-updatedb. The bug was found by Tom Sellers and fixed by
Jah.
2010-01-12 17:53:01 +00:00
david
2475306122 Update the favicon database from the latest dmoz scan. Add about 40 new
icons. Put the list in order. Correct some old entries.
2010-01-11 07:21:08 +00:00
david
12203a8ae1 Don't allow a cached response from a GET request to be returned for a
HEAD request. This makes it look like the response to the HEAD request
has a body. As a result, http-enum can wrongly surmise that HEAD
requests don't work when it hits a cache entry while testing HEAD.

# nmap --script=http-date,http-enum -PN -p 80 -d2
NSE: NSE Script Threads (2) running:
NSE: Final http cache size (373 bytes) of max size of 1000000
NSE: HTTP: Host returns proper 404 result.
NSE: Final http cache size (1905 bytes) of max size of 1000000
NSE: Finished 'http-date' (thread: 0x8535a40).
NSE: HTTP: Warning: Host returned data when performing HEAD.
NSE: Checking if a GET request is going to work out

After this change:

NSE: NSE Script Threads (2) running:
NSE: Final http cache size (373 bytes) of max size of 1000000
NSE: HTTP: Host returns proper 404 result.
NSE: Final http cache size (1905 bytes) of max size of 1000000
NSE: Finished 'http-date' (thread: 0x8e75b00).
NSE: Final http cache size (1905 bytes) of max size of 1000000
NSE: HTTP: Host supports HEAD.
2010-01-10 19:47:33 +00:00
batrick
62ed5336b4 Fixed typo in documentation that screwed up nsedoc. 2010-01-10 04:45:08 +00:00
batrick
e94da5d874 Use em/strong tags instead of <b>. 2010-01-10 03:18:05 +00:00
david
d38ef0da41 Change the header name from "Cookies" to "Cookie" in http.lua. "Cookies"
is incorrect; see RFC 2109 section 4.3.4.
2010-01-09 22:54:37 +00:00
david
d6f8e9edda Merge r16415:16416 from /nmap-exp/david/nselib-http. I meant to do those
commits here in the first place.
2010-01-08 01:13:24 +00:00
david
1b6c69387a Move the format_difftime function out of http-date.nse and into
stdnse.lua. It can be useful in other scripts.
2010-01-06 20:43:24 +00:00
ron
c4237f60b0 Updated smb-psexec to finally work on Windows XP, after countless months of it eating away at me. The issue turned out to be an innocuous field in the SMB header, 'process id', which is generally used for connection multiplexing. Apparently, not setting it causes a bug in Windows to surface (I assume it's a bug, anyways) that returns a weird failure code. I found this thanks to Kristof Boeynaems doing some research for me, and then me trying random things to make my packets look more like metasploit's. 2010-01-06 03:10:27 +00:00
david
671167227f Add the oracle-sid-brute script from Patrik Karlsson. 2009-12-28 17:35:46 +00:00
david
f2ae05968b Add the scripts
citrix-brute-xml
  citrix-enum-apps
  citrix-enum-apps-xml
  citrix-enum-servers
  citrix-enum-servers-xml
and the citrixxml modules, all by Patrik Karlsson.
2009-12-14 07:30:38 +00:00
david
304762b07d Remove a function I accidentally duplicated in snmp.lua (encodeLength).
Reverse some byte strings after constructing them instead of building
the arrays from the front.
2009-12-14 01:03:53 +00:00
david
3f7be738ad Allow encoding OID component greater than 127 in snmp.lua. Previously
the code just took each value mod 256 and stored it as a single byte.
The OID 1.3.1000.5 would encode as follows

tag len 1.3 1000%256  5
 06  03  2b       e8 05

What you're supposed to do is break each value into 7-bit chunks, and
set the high bit in every octet but the last. Now it is correctly
encoded as

tag len 1.3 1000  5
 06  04  2b 8768 05

The length also would not have been correct for lengths over 127, and
that is fixed also.
2009-12-14 00:55:05 +00:00
david
ee0fee26c0 Skip over a single 100 Continue response, if present, before parsing the
real response in http.lua. This patch is by Patrik Karlsson.
2009-12-13 22:52:08 +00:00
david
315e6ef9b0 Remove a debugging statement from http.lua. 2009-12-13 01:51:05 +00:00
david
5eca175a11 Don't encode a POST body and set the content-type
application/x-www-form-urlencoded if the body is a string. Only do it
when the body is a table, meaning we want to do a form submission.
2009-12-13 01:50:26 +00:00
fyodor
cccc1d5831 Adjust the example output for new format_output format 2009-11-22 08:34:15 +00:00
fyodor
48b37ff7d2 Change script output indenting from one space to two 2009-11-22 08:22:54 +00:00
ron
efcb11b1b0 Reduced the number of connections/traffic used by smb-enum-shares.nse by half. I was checking a random share to see if the right error is returned for every share, when it only actually had to be done once. 2009-11-20 17:00:55 +00:00
ron
422b5855e5 Update the output formatting to the style that Fyodor requested. Haven't updated the @output sections yet, just in case we decide to change this again. 2009-11-20 16:12:41 +00:00
ron
08da8db7f0 Importing changes from my branch. There are two major updates:
1) I wrote a function that formats output from scripts in a consistent way. Although we haven't really come to a concensus on how it should look yet, it's easy to change when we do. 
2) New script: smb-enum-groups.nse. Enumerate the local groups on a system and their membership.
2009-11-20 16:05:06 +00:00
batrick
2b3df5882f [NSE] Patch to add worker threads to NSE for scripts to use. Right
now a script is limited in parallelism to working on one socket at any
time. A script can now create a worker thread that will be capable of
doing work on sockets in parallel with the parent script. See [1] for
more information.

This patch also comes with condition variables that are similar to
POSIX condition variables. They are used in the same fashion as
NSE's mutexes (nmap.mutex).

[1] http://seclists.org/nmap-dev/2009/q4/294
2009-11-12 01:33:52 +00:00
batrick
8f3ecdbb8b Cleaned up documentation for mutexes. Also added note that NSE
only maintains a weak reference in the background.
2009-11-12 01:20:19 +00:00
david
5cc9d5249a In http.lua, add the port number to the value of the Host header field
when the number is not 80. See RFC 2616, section 14.23. This was
suggested by Tom Sellers.
2009-11-09 20:26:55 +00:00
ron
7d67b08e66 Merged in my changes from nmap-smb. The primary changes are:
* Updated the way authentication works on smb -- it's significantly cleaner now
* smb-enum-shares.nse gives significantly better output now (it checks if shares are writable)
* Added a script that checks if smbv2 is enabled on a server
* Added smb-psexec, a script for executing commands on a remote Windows server. I also included some default scripts, a compiled .exe to run everything, and a ton of documentation (in the form of NSEDoc)
* Added 'override' parameters to some of the functions in smb.lua, which lets the programmer override any field in an outgoing SMB packet without modifying smb.lua. 
* Lots of random code cleanups in the smb-* scripts/libraries
2009-11-08 21:31:06 +00:00
david
bef983abdd Make packet.in_cksum more efficient by not making lots of substring
copies.
2009-10-29 00:28:29 +00:00