From 2979b992c2e9b0dfe43d3ac91a2249f191b3cce3 Mon Sep 17 00:00:00 2001 From: d7x <36901198+d-7-x@users.noreply.github.com> Date: Sun, 17 Mar 2019 18:21:23 +0200 Subject: [PATCH] Update http-screenshot.nse Wait for the scan to complete and put a screenshot in /tmp/ using gnome-screenshot, use 64-bit wkhtmltoimage. --- NSE/http-screenshot.nse | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/NSE/http-screenshot.nse b/NSE/http-screenshot.nse index f4d465f..acf3e23 100644 --- a/NSE/http-screenshot.nse +++ b/NSE/http-screenshot.nse @@ -32,6 +32,11 @@ local stdnse = require "stdnse" portrule = shortport.http +postrule = function(host) + local cmd = "gnome-screenshot -w -f /tmp/screenshot-nmap-scan-`date +%Y-%m-%d-%H:%M:%S`.png" + os.execute(cmd) +end + action = function(host, port) -- Check to see if ssl is enabled, if it is, this will be set to "ssl" local ssl = port.version.service_tunnel @@ -48,7 +53,8 @@ action = function(host, port) end -- Execute the shell command wkhtmltoimage-i386 - local cmd = "wkhtmltoimage-i386 -n " .. prefix .. "://" .. host.ip .. ":" .. port.number .. " " .. filename .. " 2> /dev/null >/dev/null" + -- deprecated local cmd = "wkhtmltoimage-i386 -n " .. prefix .. "://" .. host.ip .. ":" .. port.number .. " " .. filename .. " 2> /dev/null >/dev/null" + local cmd = "wkhtmltoimage -n " .. prefix .. "://" .. host.ip .. ":" .. port.number .. " " .. filename .. " 2> /dev/null >/dev/null" local ret = os.execute(cmd)