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

10291 Commits

Author SHA1 Message Date
dmiller
d641d00031 Simplify format_get_indent since all indents are spaces for a long time now. 2015-03-01 04:18:32 +00:00
dmiller
4d106cbe23 Remove unneeded requires 2015-02-28 12:43:59 +00:00
dmiller
fac667e621 Bugfixes in json.lua
A few bugs crept in during the conversion to LPEG parsing:

1. Unicode parsing of UTF-16 surrogate pairs returned an ending position
that was off by 2, so that the last 2 characters in the escape code were
parsed as literal characters.

2. Arrays and objects were not being tagged as such with make_array and
make_object during parsing.

This commit fixes these bugs, and returns to using unicode.utf8_enc for
UTF-8 encoding instead of a separately-defined function. Also, the tests
at the end (which were helpful in finding both of the bugs above) were
converted to unittest.lua tests.
2015-02-28 12:43:43 +00:00
dmiller
41c4b9fbc8 Fix issues with afp-serverinfo using non-standard format library 2015-02-27 20:00:59 +00:00
dmiller
0e74dd7a35 Replace some string.char and bin.pack calls with literals 2015-02-27 19:42:56 +00:00
dmiller
204d37e4d7 Replace packet.toip* and ip*tobin with ipOps.ip_to_str and str_to_ip 2015-02-27 19:42:46 +00:00
dmiller
4f0518bd93 Replace concat-loop padding with string.rep 2015-02-27 14:55:42 +00:00
dmiller
e275a96c72 Use string.gsub instead of looped concat to modify strings 2015-02-27 14:55:29 +00:00
dmiller
d16772a8a8 Simplify bencode parsing and random string gen in bittorrent.lua 2015-02-27 14:55:26 +00:00
dmiller
9d5c8962dd Fix error message in ipOps.fromdword 2015-02-27 14:55:25 +00:00
dmiller
10dce0382c Clean up string concatenations
Building a string with var = var .. "something" has miserable time
complexities. This commit cleans up a lot of that in scripts, focusing
on packing of data with bin.pack and concatenations within loops.
Additionally, a few instances were replaced with string.rep
2015-02-25 19:58:42 +00:00
dmiller
ddb3905b20 Avoid excessive string concatenations
psl_tree now takes an accumulator argument. It adds lines to the result
table instead of concatenating them together in a string. Then psl_print
concats all the lines together.
2015-02-25 19:58:35 +00:00
dmiller
afd025c191 Lua 5.2 allows null chars in patterns, so this hack is unnecessary 2015-02-25 19:58:33 +00:00
henri
828db443b2 Fixed a TOCTOU race in mmapfile()
Let open() fail in case of a missing file, then use fstat on the
returned file descriptor to get the actual file size.

Reported by Camille Mougey.
2015-02-25 16:36:42 +00:00
dmiller
db717c7543 Standardize random string generation on stdnse.generate_random_string 2015-02-25 05:06:08 +00:00
dmiller
f6733b2d89 Replace msrpc.random_crap with stdnse.generate_random_string 2015-02-25 05:06:05 +00:00
dmiller
8f939279ca Let charset arg to stdnse.generate_random_string be a string
The charset argument was intended to be a table, since Lua doesn't allow
indexing strings with []. Unfortunately, irc-brute and tftp-enum passed
a string instead, which meant that the output was always the empty
string. This change allows both formats, and fixes those scripts.

irc-brute and tftp-enum had been broken since r33632 (no released
version of Nmap)
2015-02-25 05:06:03 +00:00
dmiller
3ee9fee2e2 XML structured output for afp-serverinfo.nse 2015-02-25 03:34:33 +00:00
dmiller
c6b8199c14 Use string.gsub to strip nulls instead of a lua loop. 2015-02-25 03:34:31 +00:00
dmiller
b136a4a80f Replace lua function with equivalent bin.unpack 2015-02-25 03:34:30 +00:00
dmiller
66e235b98e Replace bacnet hex blobs with full dissection 2015-02-24 03:57:32 +00:00
dmiller
6b9796d86a Add Vendor Name to bacnet-info [Stephen Hilt] 2015-02-24 03:57:30 +00:00
dmiller
a5b3aa1314 Remove references to deprecated -P* options in error message
The message stating that an unknown -P* option was used contained
references to old, deprecated forms:

-PT (now -PA)
-PB (now -PE -PA)
-PI (now -PE)

Additionally, -PR was missing.
2015-02-22 21:51:00 +00:00
henri
d7a3d43eb6 Reduce CPU consumption with nsock engine poll
Entering nsock_loop() with the poll engine activated and no registered FD
(timers only, for instance) should not directly return, but sleep until next
timeout.
2015-02-21 21:15:21 +00:00
henri
7b02dea019 Remove dead code: einfo->evlen cannot be zero. 2015-02-21 21:15:15 +00:00
dmiller
febc009a13 Fix -PE for IPv6 2015-02-20 18:56:39 +00:00
dmiller
6ba9936d24 NSE support for Adobe LiveCycle
http-fingerprints and default account additions by rvrsh3ll.
Closes #61
2015-02-20 15:54:13 +00:00
dmiller
ca3d838b1b Fix some globals in nselib/data/http-*.lua 2015-02-20 15:54:12 +00:00
jah
ff8c8484b0 Revert revision 34034 from nmap/nse_main.lua:
Fix the creation of the thread.info property.
2015-02-20 04:27:28 +00:00
jah
836c6e25bc Remove target IP address from debug messages in whois-ip.nse
stdnse.debug writes the IP to messages so scripts don't have to.
A couple of functions no longer needed the target IP passed to them: their
signature and nsedoc were updated accordingly, along with any calls to them.
Also fix some white space.
2015-02-20 03:34:57 +00:00
jah
6146593e11 Fix the creation of the thread.info property.
Update the patterns used to extract hex chars from the string representation of a coroutine.  It seems the string has changed in Lua 5.3 from "0xAB..." to "thread: AB..."; this was before:-

NSE: Starting http-feed M:nil against ...
NSE: http-feed M:nil spawning new thread (thread: 02C63A78).
NSE: Finished http-feed W:nil against ...

this is now:-

NSE: Starting http-feed M:02D6EAF0 against ...
NSE: http-feed M:02D6EAF0 spawning new thread (thread: 02D6E640).
NSE: Finished http-feed W:02D6E640 against ...
2015-02-20 03:07:04 +00:00
dmiller
6199449632 Increase packet tracing for Connect scan
Now connections are traced after completing, in addition to when they
are first attempted.
2015-02-19 16:59:01 +00:00
dmiller
1b97aae733 Add https-alt to shortport.http (Fixes #56) 2015-02-18 19:54:05 +00:00
dmiller
6139ed22e7 Replace host.ip, port.number with host, port
In most cases (e.g. any of the nmap.socket operations), functions can
take full host and port tables instead of just host.ip and port.number.
This makes for cleaner-looking code and easier extensibility if we
decide to check for a protocol on both TCP and UDP, for instance.
2015-02-18 14:38:42 +00:00
dmiller
cc351c6f27 Treat 8443 as a likely-SSL port for version detection 2015-02-18 04:37:10 +00:00
dmiller
838aa953ff Process some service fingerprint corrections 2015-02-18 04:31:49 +00:00
dmiller
9db8dfda1d Be more strict about NetBus protocol. Fixes false positives
Had a report via service fingerprint correction of netbus-version
reporting an unrelated service as NetBuster. This would happen for any
service on port 12345 that responds with a banner containing less than 2
carriage returns, or which closes the connection after the first NetBus
protocol message. Now, all netbus-* scripts require the banner to begin
with "NetBus" before they will continue.
2015-02-18 02:57:29 +00:00
dmiller
a4dc1b8ff6 Update zenmap copyright date 2015-02-18 02:57:27 +00:00
paulino
588d744bd6 Adds Zebra printer fingerprints to http-default-accounts 2015-02-17 23:38:40 +00:00
dmiller
4a6dc88a3c Include hicolor theme when building Zenmap on Windows. http://seclists.org/nmap-dev/2015/q1/118 2015-02-17 17:52:39 +00:00
dmiller
4f5b2480c2 Service CPEs through the end of the file 2015-02-16 22:33:44 +00:00
dmiller
74c307cf2d Service CPEs and AFP cleanup 2015-02-15 04:12:02 +00:00
dmiller
cc76025836 Service CPEs through TCP DNSVersionBindReq 2015-02-14 21:49:49 +00:00
dmiller
091696c717 Update config.guess and config.sub from the latest source 2015-02-14 20:19:59 +00:00
dmiller
d826971495 Add some rules to update config.guess and config.sub from the latest 2015-02-14 20:19:57 +00:00
dmiller
2c8b68d46f More service CPEs 2015-02-13 21:31:25 +00:00
dmiller
7a32fcb9f5 Properly quote arguments to su-to-zenmap.sh
Found with http://www.shellcheck.net/

Error was: https://github.com/koalaman/shellcheck/wiki/SC2124
2015-02-13 16:31:12 +00:00
dmiller
2380ccac5e Service CPEs - http services 2015-02-13 14:22:41 +00:00
dmiller
430f8a1f13 Save a request when running banner against unknown services 2015-02-12 20:04:28 +00:00
dmiller
b26bf922bd Fix boolean logic in comm.get_banner 2015-02-12 20:04:27 +00:00