mirror of
https://github.com/nmap/nmap.git
synced 2026-05-13 16:57:06 +00:00
style changes
This commit is contained in:
parent
6fdca6e01f
commit
e791c0e4ab
1 changed files with 6 additions and 8 deletions
|
|
@ -44,18 +44,16 @@ local AFFILIATE_PATTERNS = {
|
|||
portrule = shortport.http
|
||||
|
||||
action = function(host, port)
|
||||
local url_path, body, result
|
||||
result = {}
|
||||
url_path = stdnse.get_script_args("http-affiliate-id.url-path") or "/"
|
||||
body = http.get(host, port, url_path).body
|
||||
local result = {}
|
||||
local url_path = stdnse.get_script_args("http-affiliate-id.url-path") or "/"
|
||||
local body = http.get(host, port, url_path).body
|
||||
|
||||
-- Here goes affiliate matching
|
||||
for name, re in pairs(AFFILIATE_PATTERNS) do
|
||||
local regex, limit, limit2, matches, affiliateid
|
||||
regex = pcre.new(re, 0, "C")
|
||||
limit, limit2, matches = regex:match(body)
|
||||
local regex = pcre.new(re, 0, "C")
|
||||
local limit, limit2, matches = regex:match(body)
|
||||
if limit ~= nil then
|
||||
affiliateid = matches["id"]
|
||||
local affiliateid = matches["id"]
|
||||
result[#result + 1] = name .. ": " .. affiliateid
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue