diff --git a/http-favicon-url.nse b/http-favicon-url.nse
index cf56f28..c229e93 100644
--- a/http-favicon-url.nse
+++ b/http-favicon-url.nse
@@ -44,7 +44,6 @@ action = function(host, port)
local answer
local match
local status
- local result
local index, icon
local root = ""
local url
@@ -94,12 +93,12 @@ action = function(host, port)
--- check for 200 response code
if answer and answer.status == 200 then
- result = url
+ return url
else
stdnse.debug1("No favicon found.")
return
end --- status == 200
- return result
+ return
end
local function dirname(path)
diff --git a/http-get.nse b/http-get.nse
index b66a981..b9c75b9 100644
--- a/http-get.nse
+++ b/http-get.nse
@@ -25,7 +25,7 @@ categories = {"discovery", "intrusive"}
author = "Adrien Malingrey"
license = "Same as Nmap--See https://nmap.org/book/man-legal.html"
-portrule = shortport.http
+portrule = shortport.service({"http", "https", "ssl"})
local http = require "http"
@@ -33,10 +33,15 @@ local stdnse = require "stdnse"
action = function(host, port)
local path = ""
+ local scheme = ""
if(stdnse.get_script_args('http-get.path')) then
path = "/" .. stdnse.get_script_args('http-get.path')
end
- return http.get( host, port, "/" .. path )
+ if (port.service == "ssl") then scheme = "https"
+ else scheme = port.service
+ end
+
+ return http.get_url( scheme.."://"..(host.name or host.ip)..":"..port.number.."/"..path, {redirect_ok=true} )
end
diff --git a/results.xsl b/results.xsl
index bc3a683..f098d03 100644
--- a/results.xsl
+++ b/results.xsl
@@ -125,45 +125,38 @@
+
+
+ red
+ yellow
+ primary
+ red
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ui red mini button
- ui primary mini button
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
+
diff --git a/scan_all.php b/scan_all.php
index e09a78c..eca31f7 100644
--- a/scan_all.php
+++ b/scan_all.php
@@ -9,10 +9,10 @@ if (! function_exists('str_ends_with')) {
if (!file_exists("scans")) mkdir("scans");
if (!file_exists("site")) mkdir("site");
-foreach (scandir("./confs/") as $file) {
+foreach (scandir(__DIR__."/confs/") as $file) {
if (str_ends_with($file, ".yaml")) {
$site = str_replace(".yaml", "", $file);
- $yaml = yaml_parse_file("confs/$file");
+ $yaml = yaml_parse_file(__DIR__."/confs/$file");
$targets = [];
$services = [];
@@ -46,9 +46,9 @@ XML
$targets = join(array_keys($targets), " ");
$services = join(array_keys($services), ",");
- exec("nmap -v -Pn -p $services --script smb-enum-shares,./http-get.nse,./http-favicon-url.nse -oX 'scans/$site.xml' $targets\n");
+ exec("nmap -v -Pn -p $services --script smb-enum-shares,./http-get.nse,./http-favicon-url.nse -oX '".__DIR__."/scans/$site.xml' $targets\n");
- $xml->asXML("site/$site.xml");
+ $xml->asXML(__DIR__."/site/$site.xml");
}
}
?>