mirror of
https://github.com/nmap/nmap.git
synced 2025-12-24 00:19:01 +00:00
Re-indent some scripts. Whitespace-only commit
https://secwiki.org/w/Nmap/Code_Standards
This commit is contained in:
@@ -46,28 +46,28 @@ categories = {"discovery", "safe", "external"}
|
||||
-- @param data string containing the retrieved web page
|
||||
-- @return table containing the resolved host names
|
||||
function parse_robtex_response(data)
|
||||
local data = string.gsub(data,"\r?\n","")
|
||||
local result = {}
|
||||
for href, link in string.gmatch(data,"<li><a href=\"([^\"^']-)\" >([^\"^']-)</a></li>") do
|
||||
table.insert(result, link)
|
||||
end
|
||||
return result
|
||||
local data = string.gsub(data,"\r?\n","")
|
||||
local result = {}
|
||||
for href, link in string.gmatch(data,"<li><a href=\"([^\"^']-)\" >([^\"^']-)</a></li>") do
|
||||
table.insert(result, link)
|
||||
end
|
||||
return result
|
||||
end
|
||||
|
||||
prerule = function() return stdnse.get_script_args("http-robtex-reverse-ip.host") ~= nil end
|
||||
|
||||
action = function(host, port)
|
||||
|
||||
local target = stdnse.get_script_args("http-robtex-reverse-ip.host")
|
||||
local ip = ipOps.ip_to_str(target)
|
||||
if ( not(ip) or #ip ~= 4 ) then
|
||||
return stdnse.format_output(false, "The argument \"http-robtex-reverse-ip.host\" did not contain a valid IPv4 address")
|
||||
end
|
||||
local target = stdnse.get_script_args("http-robtex-reverse-ip.host")
|
||||
local ip = ipOps.ip_to_str(target)
|
||||
if ( not(ip) or #ip ~= 4 ) then
|
||||
return stdnse.format_output(false, "The argument \"http-robtex-reverse-ip.host\" did not contain a valid IPv4 address")
|
||||
end
|
||||
|
||||
local link = "https://www.robtex.com/ip/"..target..".html"
|
||||
local htmldata = http.get_url(link)
|
||||
local domains = parse_robtex_response(htmldata.body)
|
||||
if ( #domains > 0 ) then
|
||||
return stdnse.format_output(true, domains)
|
||||
end
|
||||
local link = "https://www.robtex.com/ip/"..target..".html"
|
||||
local htmldata = http.get_url(link)
|
||||
local domains = parse_robtex_response(htmldata.body)
|
||||
if ( #domains > 0 ) then
|
||||
return stdnse.format_output(true, domains)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user