Skip to content
This repository has been archived by the owner on Aug 7, 2020. It is now read-only.

Update http-screenshot.nse #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion NSE/http-screenshot.nse
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -48,7 +53,8 @@ action = function(host, port)
end

-- Execute the shell command wkhtmltoimage-i386 <url> <filename>
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)

Expand Down