1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-09 06:01:28 +00:00
Commit Graph

1993 Commits

Author SHA1 Message Date
dmiller
413bbf6e96 Revert r32789 in favor of lib-level fixes
nmap.new_try() shouldn't be used in libraries. It results in Lua errors
being thrown that the script can't recover from without resorting to
pcall(). It has been replaced in proxy.lua with proper error handling
which did not require any changes to the scripts (http-open-proxy and
socks-open-proxy) that used it.
2014-04-07 18:10:10 +00:00
dmiller
1332949c3d Fix bug in socks-open-proxy, TIMEOUT or EOF when SOCKS5 not supported 2014-04-04 21:46:21 +00:00
dmiller
64ef503f5b Remove debug leftover from ssl-enum-ciphers 2014-03-31 14:35:50 +00:00
fyodor
8661c8a519 Improved ntp-info script to handle underscores in returned data. [nnposter] 2014-03-27 05:49:14 +00:00
dmiller
2d06ecf73c Fix NSEdoc generation problem
@field tag names in NSEdoc must be valid identifiers, so they cannot
contain "-". As a general rule, anything that needs to be quoted like
this: mytable["field-name"] is invalid. In this case, the ajp library
had a field called "status-line", which caused NSEdoc generation to fail
when it was finally documented. This change renames it to "status_line",
which should fix the issue.
2014-03-07 23:14:55 +00:00
dmiller
fa391e1b02 New quake1-info script from Ulrik Haugen
Also added a version probe and match line.
http://seclists.org/nmap-dev/2014/q1/210
2014-03-07 17:28:40 +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
ddcfa8cc90 Spellcheck: common misspellings in the entire source tree 2014-02-21 21:10:51 +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
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
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
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
dmiller
4c3b6cb32f Make http-slowloris use the Nmap user agent
This can now be changed with --script-args http.useragent=X
2014-02-13 16:39:11 +00:00
dmiller
a084340b6d Remove useless calls to string.format
stdnse.print_debug accepts a format string and arguments, making
string.format redundant in calls of this form:

stdnse.print_debug(1, string.format("%s: error", SCRIPT_NAME))
stdnse.print_debug(("length %d"):format(#tab))

These can be rewritten as:

stdnse.print_debug(1, "%s: error", SCRIPT_NAME)
stdnse.print_debug("length %d", #tab)
2014-02-13 15:47:41 +00:00
dmiller
b73c3aa60f Wrap long lines in NSE (>200 columns)
Mostly in documentation (the description field, for instance), but also
some long literal strings. Lua 5.2 introduces a string escape, "\z",
which escapes any amount of subsequent whitespace, including newlines.
This can be used to wrap string literals without upsetting indentation.
http://www.lua.org/manual/5.2/manual.html#3.1
2014-02-13 15:47:35 +00:00
dmiller
2896c21989 Convert some file encodings from ISO-8859-2 to UTF-8
https://secwiki.org/w/Nmap/Code_Standards
2014-02-12 19:49:43 +00:00
dmiller
6a98f70197 More DNS TCP support from John Bond
http://seclists.org/nmap-dev/2014/q1/154
2014-02-12 17:08:40 +00:00
dmiller
a95788c783 [NSE] New script http-ntlm-info from Justin Cacak
http://seclists.org/nmap-dev/2014/q1/129
2014-02-07 18:24:17 +00:00
dmiller
bf26986685 Patch from Paul AMAR to fix http-vuln-zimbra-lfi
http://seclists.org/nmap-dev/2014/q1/130
2014-02-07 15:54:12 +00:00
dmiller
fb67a6717e Re-indent some libs and scripts, change 4 to 2-space indent
Mostly found with:

    for i in nselib/*.lua scripts/*.nse; do
      echo $(perl -lne 'BEGIN{$a=$p=0}next unless $_;/^(\s*)/;' \
        -e '$l=length$1;next if$l==$p;$a+=(abs($l-$p)-$a)/$.;' \
        -e '$p=$l;END{print$a}' $i) $i
    done | sort -nr

And indented with: https://gist.github.com/bonsaiviking/8845871

whois-ip.nse was particularly mangled (probably my fault due to using
vim's built-in indentation script, but it could be structured better)
2014-02-06 23:25:28 +00:00
dmiller
63db1bfd12 Replace inline tabs with spaces.
Left some in the @output section, since libraries are apparently
emitting tab-separated tables (mysql or mssql)

https://secwiki.org/w/Nmap/Code_Standards
2014-02-03 16:49:26 +00:00
dmiller
31a2c432e1 Final re-indent for scripts. 2014-02-02 15:33:39 +00:00
dmiller
d309fecd12 Re-indent some more scripts. Whitespace-only commit
https://secwiki.org/w/Nmap/Code_Standards
2014-02-02 15:33:29 +00:00
dmiller
c7d4f2ec96 Re-indent some scripts. Whitespace-only commit
https://secwiki.org/w/Nmap/Code_Standards
2014-01-31 21:01:26 +00:00
dmiller
298be5bfaa Re-indent some scripts. Whitespace-only commit
https://secwiki.org/w/Nmap/Code_Standards
2014-01-31 17:36:09 +00:00
dmiller
bcf991c128 Add missing require in redis-info 2014-01-31 17:36:02 +00:00
dmiller
078aa688c9 Reindent some scripts. Whitespace only.
https://secwiki.org/w/Nmap/Code_Standards
2014-01-31 16:37:27 +00:00
dmiller
32936167c2 Fix dns-fuzz portrule (was defaulting to tcp) 2014-01-31 15:32:23 +00:00
dmiller
b4994505c3 Add TCP support to dns-fuzz. Also suggest -sU in usage 2014-01-31 15:28:54 +00:00
dmiller
972d799143 Add TCP support to dns.lua
Slightly modified from patch from John Bond:
http://seclists.org/nmap-dev/2014/q1/118
2014-01-31 15:14:31 +00:00
dmiller
d36c08dcf5 Re-indent some scripts. Whitespace-only commit
https://secwiki.org/w/Nmap/Code_Standards
2014-01-31 13:02:29 +00:00
henri
bf872bf113 Extract and publish more information about redis.
* Get OS
  * Get redis version (and set it to port.version)
  * Get architecture (and set it to port.extraversion)
  * Make and set an application CPE
2014-01-30 18:35:25 +00:00
henri
1cb2aba30f Updated the redis scripts portrules. 2014-01-30 18:35:21 +00:00
dmiller
4eaa21e7cb Integrate David's ssl-enum-ciphers improvements
From this thread: http://seclists.org/nmap-dev/2014/q1/105

* Extensions now better supported in tls.lua
* ssl-enum-ciphers sends all EC options to ensure servers reply with
  supported EC suites
* tls.lua supports multiple messages of a single type within 1 record
* tls.record_buffer will read an entire TLS record into a buffer
* ssl-date and tls-nextprotoneg updated to use tls.record_buffer
2014-01-30 18:12:14 +00:00
dmiller
1d9fa6bea2 Fix some bugs in sstp-discover reported on IRC 2014-01-27 19:13:22 +00:00
dmiller
620f9fdb34 Remove trailing whitespace in lua files
Whitespace is not significant, so this should not be a problem.
https://secwiki.org/w/Nmap/Code_Standards
2014-01-23 21:51:58 +00:00
dmiller
db1d82ad1f Fixed global assignments with nse_check_globals
All fixes made by hand. A couple real bugs/errors fixed, due to
copy-paste of code from other scripts without changing variable names.
2014-01-22 17:45:00 +00:00
dmiller
2ea4934bbf Add unittest.nse to 'safe' category 2014-01-21 22:17:13 +00:00
sophron
7b43ab1ff6 [NSE] Symbol '%' missing in the urls. 2014-01-20 14:44:45 +00:00
dmiller
726b259b20 Consolidate "contains" functions into stdnse.contains
These implementations were all functionally identical. The replacement
has an extra feature of returning the index where the value was found,
currently unused.
2014-01-16 22:57:33 +00:00
dmiller
197f28265f New function stdnse.format_mac
This function will format a MAC address as colon-separated hex bytes.
It's really very simple: stdnse.tohex(mac, {separator=":"})

This commit updates all the instances I could find of the varying
convoluted attempts at performing this conversion.
2014-01-16 21:50:30 +00:00
dmiller
b61d378d3a Update script.db 2014-01-16 19:09:13 +00:00
dmiller
a998d97216 Add sstp-discover NSE script from Niklaus Schiess 2014-01-16 19:07:43 +00:00
dmiller
645ef2a0bd Update ssl-date to use tls lib 2014-01-16 18:10:04 +00:00
dmiller
760da1788f Let tls-nextprotoneg use tls.lua library
Required fixes to tls lib's extensions (did not previously support
extension data)
2014-01-16 18:10:02 +00:00