mirror of
https://github.com/nmap/nmap.git
synced 2026-01-31 10:39:02 +00:00
Keep delta readable in Normal output
per http://seclists.org/nmap-dev/2012/q3/756
This commit is contained in:
@@ -157,6 +157,7 @@ action = function(host, port)
|
||||
|
||||
-- Send crafted client hello
|
||||
status, response = client_hello(host, port)
|
||||
local now = os.time()
|
||||
if status and response then
|
||||
-- extract time from response
|
||||
local result
|
||||
@@ -164,9 +165,10 @@ action = function(host, port)
|
||||
if status then
|
||||
local output = {
|
||||
date = os.date("!%Y-%m-%dT%H:%M:%SZ",result),
|
||||
delta = os.difftime(result, os.time()),
|
||||
delta = os.difftime(result, now),
|
||||
}
|
||||
return output, string.format("%s; %s from local time.", output.date, output.delta)
|
||||
return output, string.format("%s; %s from local time.", output.date,
|
||||
stdnse.format_difftime(os.date("!*t",result),os.date("!*t", now)))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user