Improved ntp-info script to handle underscores in returned data. [nnposter]

This commit is contained in:
fyodor 2014-03-27 05:49:14 +00:00
parent 6c2ab1e289
commit 8661c8a519
2 changed files with 4 additions and 1 deletions

View file

@ -1,5 +1,8 @@
# Nmap Changelog ($Id$); -*-text-*-
o [NSE] Improved ntp-info script to handle underscores in returned
data. [nnposter]
o [NSE] Add quake1-info script for retrieving server and player information
from Quake 1 game servers. Reports potential DoS amplification factor.
[Ulrik Haugen]

View file

@ -116,7 +116,7 @@ action = function(host, port)
-- This parsing is not quite right with respect to quoted strings.
-- Backslash escapes should be interpreted inside strings and commas should
-- be allowed inside them.
for k, q, v in string.gmatch(data, "%s*(%w+)=(\"?)([^,\"\r\n]*)%2,?") do
for k, q, v in string.gmatch(data, "%s*([%w_]+)=(\"?)([^,\"\r\n]*)%2,?") do
output[k] = v
end
end