mirror of
https://github.com/nmap/nmap.git
synced 2025-12-25 00:49:01 +00:00
merge soc07 r4891 - nse improvements
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
require "ipOps"
|
||||
|
||||
id = "RIPE query"
|
||||
description = "Connects to the RIPE database, extracts and prints the role: entry for the IP."
|
||||
author = "Diman Todorov <diman.todorov@gmail.com>"
|
||||
@@ -6,7 +8,7 @@ license = "See nmaps COPYING for licence"
|
||||
categories = {"discovery"}
|
||||
|
||||
hostrule = function(host, port)
|
||||
return true
|
||||
return not ipOps.isPrivate(host.ip)
|
||||
end
|
||||
|
||||
action = function(host, port)
|
||||
|
||||
@@ -11,19 +11,10 @@ license = "See nmaps COPYING for licence"
|
||||
|
||||
categories = {"demo", "safe"}
|
||||
|
||||
require "shortport"
|
||||
|
||||
portrule = function(host, port)
|
||||
if
|
||||
( port.number == 80
|
||||
or port.service == "http")
|
||||
and port.protocol == "tcp"
|
||||
and port.state == "open"
|
||||
-- and host.name ~= nil
|
||||
-- and string.match(host.name, "www.+")
|
||||
then
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
return shortport.port_or_service(port, 80, "http")
|
||||
end
|
||||
|
||||
action = function(host, port)
|
||||
@@ -57,7 +48,7 @@ action = function(host, port)
|
||||
if title ~= nil then
|
||||
result = string.gsub(title , "[\n\r\t]", "")
|
||||
if string.len(title) > 50 then
|
||||
nmap.print_debug_unformatted("showHTMLTitle.nse: title was truncated!");
|
||||
nmap.print_debug_unformatted("showHTMLTitle.nse: Title got truncated!");
|
||||
result = string.sub(result, 1, 62) .. "..."
|
||||
end
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user