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

Remove unnecessary string.format calls.

This commit is contained in:
batrick
2015-01-31 05:35:26 +00:00
parent 3200f16753
commit e3b3deb7c8
2 changed files with 4 additions and 4 deletions

View File

@@ -62,7 +62,7 @@ action = function(host, port)
local _, _, name = string.find(user_block, '<name>(.-)</name>') local _, _, name = string.find(user_block, '<name>(.-)</name>')
local _,_, fName = string.find(user_block, '<fname>(.-)</fname>') local _,_, fName = string.find(user_block, '<fname>(.-)</fname>')
local _,_, ext = string.find(user_block, '<extn>(.-)</extn>') local _,_, ext = string.find(user_block, '<extn>(.-)</extn>')
stdnse.debug(1, string.format("User found!\nName: %s\nFull name: %s\nExt:%s", name, fName, ext)) stdnse.debug1("User found!\nName: %s\nFull name: %s\nExt:%s", name, fName, ext)
if name ~= nil or fName ~= nil or ext ~= nil then if name ~= nil or fName ~= nil or ext ~= nil then
local user = {} local user = {}
user.name = name user.name = name

View File

@@ -90,13 +90,13 @@ function generate_http_req(host, port, uri, custom_header, cmd)
local options = {header={}} local options = {header={}}
options["no_cache"] = true options["no_cache"] = true
if custom_header == nil then if custom_header == nil then
stdnse.debug(1, string.format("Sending '%s' in HTTP headers:User-Agent,Cookie and Referer", cmd)) stdnse.debug1("Sending '%s' in HTTP headers:User-Agent,Cookie and Referer", cmd)
options["header"]["User-Agent"] = cmd options["header"]["User-Agent"] = cmd
options["header"]["Referer"] = cmd options["header"]["Referer"] = cmd
options["header"]["Cookie"] = cmd options["header"]["Cookie"] = cmd
options["header"][cmd] = cmd options["header"][cmd] = cmd
else else
stdnse.debug(1, string.format("Sending '%s' in HTTP header '%s'", cmd, custom_header)) stdnse.debug1("Sending '%s' in HTTP header '%s'", cmd, custom_header)
options["header"][custom_header] = cmd options["header"][custom_header] = cmd
end end
local req = http.get(host, port, uri, options) local req = http.get(host, port, uri, options)
@@ -133,7 +133,7 @@ is executing commands injected via malicious HTTP headers.
disclosure = {year = '2014', month = '09', day = '24'}, disclosure = {year = '2014', month = '09', day = '24'},
}, },
} }
stdnse.debug(1, string.format("Random pattern '%s' was found in page. Host seems vulnerable.", rnd)) stdnse.debug1("Random pattern '%s' was found in page. Host seems vulnerable.", rnd)
vuln.state = vulns.STATE.EXPLOIT vuln.state = vulns.STATE.EXPLOIT
if cmd ~= nil then if cmd ~= nil then
req = generate_http_req(host, port, uri, http_header, cmd) req = generate_http_req(host, port, uri, http_header, cmd)