1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-24 08:29:04 +00:00
Commit Graph

10291 Commits

Author SHA1 Message Date
david
d5d8cd3033 Add tests for 0-length POSTs.
The non-chunked one fails for me.
FAIL HTTP POST Content-Length: 0
     Read timeout at ./ncat-test.pl line 2087.
2014-03-07 05:54:48 +00:00
dmiller
f4765340a3 Fix local variable shadowing a method. Credit Martin Holst Swende 2014-03-06 23:10:01 +00:00
dmiller
3b3131d635 Add class names to unittest.lua NSEdoc 2014-03-06 23:09:59 +00:00
dmiller
c6d4febb46 Let lltd-discovery use unicode.lua 2014-03-06 20:29:23 +00:00
dmiller
88146749f6 Add unittest.testing() to make test building conditional 2014-03-06 17:15:05 +00:00
dmiller
f8242124b8 Fix NSEdoc formatting in unittest.lua 2014-03-06 17:15:01 +00:00
dmiller
3187efdf81 Add extended-ASCII support to LM hashing
Probably only works for US-English, since it uses Code Page 437. Adding
support for other locales would require detecting or setting the locale
for the remote system, since SMB has no way to negotiate code page. In
other words, Windows systems with different locales will have different
LM hashes for the same password.

Also added some tests. Hashes confirmed by googling for them and finding
the correct plaintext.
2014-03-06 17:14:59 +00:00
dmiller
9697b6673c Add CP437 (native Windows OEM) to unicode.lua 2014-03-06 17:14:57 +00:00
dmiller
153e5f2124 unicode.lua: Add some UTF-8 decoding error checking 2014-03-06 17:14:56 +00:00
dmiller
a962973c06 Fix unicode module declaration (copy-paste error) 2014-03-06 17:14:54 +00:00
dmiller
d39efbb2d8 Fix a DeprecationWarning in zenmap with python -3
DeprecationWarning: reduce() not supported in 3.x; use
functools.reduce()

functools.reduce was added in Python 2.6
2014-03-04 21:15:52 +00:00
dmiller
9aa2d9a130 Clean up xmpp.lua NSEdoc
https://secwiki.org/w/Nmap/Code_Standards#NSEdoc_best-practices
2014-03-04 17:05:04 +00:00
dmiller
4e79e60547 Clean up smbauth.lua NSEdoc
https://secwiki.org/w/Nmap/Code_Standards#NSEdoc_best-practices
2014-03-04 17:05:02 +00:00
dmiller
f5be40278f Update sip.lua NSEdoc
https://secwiki.org/w/Nmap/Code_Standards#NSEdoc_best-practices
2014-03-04 17:05:00 +00:00
dmiller
e296cdea2a Fix some @see NSEdoc
https://secwiki.org/w/Nmap/Code_Standards#NSEdoc_best-practices
2014-03-04 17:04:58 +00:00
dmiller
4cef3889f1 Remove unused and redundant snmp.dec function 2014-03-03 22:34:25 +00:00
dmiller
d50c47d621 Remove duplicate decodeLength function 2014-03-03 22:34:23 +00:00
dmiller
a959de5685 Update asn1.lua NSEdoc
https://secwiki.org/w/Nmap/Code_Standards#NSEdoc_best-practices
2014-03-03 22:34:21 +00:00
dmiller
abb2cab7e4 Fix NSEdoc tag: @class, not @type 2014-03-03 20:12:53 +00:00
dmiller
bdb8f258ef Update ajp.lua NSEdoc
@see NSEdoc elements weren't being rendered properly, so I updated
everything. Guidelines:
https://secwiki.org/w/Nmap/Code_Standards#NSEdoc_best-practices
2014-03-03 20:04:17 +00:00
sophron
a673b79aa6 Added an entry to http-default-accounts-fingerprints that detects F5 BIG-IP router. Patch by nnposter. 2014-03-02 17:46:06 +00:00
sophron
a4a648a56b Added an entry to http-devframework-fingerprints that detects SPIP framework. Patch by Paul AMAR. 2014-03-02 17:38:57 +00:00
d33tah
bf291fdc34 chmod -x some of the files which probably shouldn't be executable. To see what's left there, call "find -executable -type f" - svn propdel 'svn:executable' file will make it non-executable. 2014-03-01 13:46:19 +00:00
henri
f20d84f9c1 Workaround to compile inline functions with MSVC v16 [Patch from Gisle Vanem]. 2014-02-24 13:16:24 +00:00
dmiller
b8b256a92b Necessary dependencies for building Ncat and Nping separately 2014-02-21 23:11:41 +00:00
dmiller
ddcfa8cc90 Spellcheck: common misspellings in the entire source tree 2014-02-21 21:10:51 +00:00
dmiller
3f5e909e8f Spellcheck on docs 2014-02-21 21:10:42 +00:00
dmiller
8e06cf53d4 http-default-accounts should return nil, not false, on failure 2014-02-20 22:10:15 +00:00
dmiller
065aa78596 Fix a crash in http-xssed when scanning an IP addr or range
http-xssed unconditionally used host.targetname, which is only set when
the target is specified as a name, not an IP address or range. Now we
prefer the targetname, but fall back to the reverse-dns name, and
finally to the IP address. Perhaps we should be more strict, if
xssed.com only allows domain names, for instance?
2014-02-20 21:37:05 +00:00
dmiller
c497ef4679 Fix a bug introduced in r32728 in upnp.lua
When payload was changed to a single string instead of a strbuf object,
calls to strbuf.dump() were not removed.
2014-02-20 21:30:05 +00:00
dmiller
a72faf3906 Spellcheck on all Python files 2014-02-20 21:22:30 +00:00
dmiller
1575c63d7d Spellcheck for Ncat, Nping source files 2014-02-20 21:22:22 +00:00
dmiller
3f0d0c16f9 Spellcheck on Nmap, Nsock, Nbase source files 2014-02-20 18:44:12 +00:00
dmiller
b8873f42cd Better error reporting for smb-mbenum
Check for error 71 (0x47), which means the server is simply not a master
or backup browser and will not respond.

Also teardown the SMB session as far as it has been established, to be
nice.
2014-02-19 22:35:34 +00:00
dmiller
b3b5f8c377 Fix format-string bug: ./nmap -sC --script-args '%n' -ddd 2014-02-19 22:14:18 +00:00
dmiller
6e3980733e Use unicode library for msrpc/smb 2014-02-19 22:14:16 +00:00
dmiller
1ff0062589 Use unicode library for NTLM in sasl.lua 2014-02-19 22:14:14 +00:00
dmiller
743c90c24a Use nsedebug.tostr in unittest to more clearly show how tests fail. 2014-02-19 18:32:25 +00:00
dmiller
f17cc56bf9 New utility functions for transcoding to and from Windows Unicode
Windows uses UTF-16 little-endian. Since this is a common use case,
utility functions are provided such that this:

    x = unicode.utf16to8(v)

is equivalent to this:

    x = unicode.encode(unicode.decode(v, unicode.utf16_dec),
    unicode.utf8_enc)

but faster (fewer intermediate tables)
2014-02-19 18:32:23 +00:00
dmiller
a76990b9ae Fix off-by-one error in unicode.decode.
Would fail to decode the last character in a string.
2014-02-19 18:32:21 +00:00
dmiller
44a006a7cf Let json.lua use unicode.lua for utf8_enc 2014-02-19 17:08:31 +00:00
dmiller
1273cb4200 New unicode.lua library. Supports utf-8 and UTF-16 2014-02-19 17:08:30 +00:00
dmiller
210d50a1d9 Add table_equal test to unittest.lua
Checks that 2 tables have the same length and list values.
2014-02-19 17:08:27 +00:00
dmiller
1b71f75aad Spelling fixes for Lua files
Mostly in documentation/comments, but a couple code bugs were caught,
including a call to stdnse.pirnt_debug and a mis-declared variable.
2014-02-19 04:15:46 +00:00
dmiller
54fa265f5c Correct Namp -> Nmap throughout. 2014-02-19 04:15:21 +00:00
dmiller
1c0c090ace Refactor some Lua string concatenations.
Using this regular expression, '\(\w*\)\s*=\s*\1\s*\.\.', found and
replaced many string concatenation-reassignments. These can cause
performance issues, since a new string gets allocated for each
reassignment. In many cases, the replacement is simply a single string,
wrapped across lines with the '\z' escape, which consumes a newline and
whitespace following it. In other cases, a table is used to hold the
substrings until the final string is built with a single table.concat
operation (same technique used in stdnse.strbuf).

Also, some string-building loops of this form:

s = ""
for i = 1, 100, 1 do
  s = s .. "\0"
end

were replaced with this much faster and cleaner version:

s = string.rep("\0", 100)
2014-02-18 18:10:23 +00:00
fyodor
74ebf1c892 remove an orphan parameter from fatal() call. Problem noted by Gisle Vanem 2014-02-14 06:17:53 +00:00
dmiller
ad2c9874b3 NSE structured output for ssh-hostkey when checking known_hosts 2014-02-13 20:36:42 +00:00
dmiller
748b2d0df4 Update mysql-info to use mysql.lua
Also added structured output and support for more capabilities.
2014-02-13 18:46:19 +00:00
dmiller
ac5a89a8e1 Remove unused NSE library requires
for lib in nselib/*.lua*; do l=${lib#*/}; l=${l%.lua*}; find . -name \
  \*.lua -o -name \*.nse | xargs grep -l "require .$l\>" | xargs grep \
  -c "\<$l\." | grep ':0$' | awk -F: '{print "'$l'", $1}'; done

Did not remove calls to stdnse.silent_require since these can be used to
abort script execution if OpenSSL is not included, even if the script
does not directly call openssl.* (perhaps it uses comm.tryssl instead,
for instance).

Also did not remove require "strict", since that library is special and
modifies the environment.
2014-02-13 16:39:17 +00:00