mirror of
https://github.com/nmap/nmap.git
synced 2025-12-06 04:31:29 +00:00
This commit is contained in:
@@ -1778,9 +1778,9 @@ Helper = {
|
|||||||
local item = ( response.result.file ) and response.result.file or response.result.dir
|
local item = ( response.result.file ) and response.result.file or response.result.dir
|
||||||
|
|
||||||
local diff = os.time{year=2000, month=1, day=1, hour=0} - os.time{year=1970, month=1, day=1, hour=0}
|
local diff = os.time{year=2000, month=1, day=1, hour=0} - os.time{year=1970, month=1, day=1, hour=0}
|
||||||
local create = os.date("%Y-%m-%d %H:%M", item.CreationDate + diff)
|
local create = stdnse.format_timestamp(item.CreationDate + diff)
|
||||||
local backup = os.date("%Y-%m-%d %H:%M", item.BackupDate )
|
local backup = stdnse.format_timestamp(item.BackupDate )
|
||||||
local modify = os.date("%Y-%m-%d %H:%M", item.ModificationDate + diff )
|
local modify = stdnse.format_timestamp(item.ModificationDate + diff )
|
||||||
|
|
||||||
return true, { create = create, backup = backup, modify = modify }
|
return true, { create = create, backup = backup, modify = modify }
|
||||||
end,
|
end,
|
||||||
|
|||||||
@@ -523,7 +523,7 @@ OptionToString = {
|
|||||||
if ( HWTYPE_ETHER == opt.hwtype ) then
|
if ( HWTYPE_ETHER == opt.hwtype ) then
|
||||||
local mac = stdnse.tohex(opt.mac):upper()
|
local mac = stdnse.tohex(opt.mac):upper()
|
||||||
mac = mac:gsub("..", "%1:"):sub(1, -2)
|
mac = mac:gsub("..", "%1:"):sub(1, -2)
|
||||||
local tm = os.date("%Y-%m-%d %H:%M:%S", opt.time)
|
local tm = stdnse.format_timestamp(opt.time)
|
||||||
return "Client identifier", ("MAC: %s; Time: %s"):format(mac, tm)
|
return "Client identifier", ("MAC: %s; Time: %s"):format(mac, tm)
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|||||||
@@ -410,7 +410,7 @@ Helper = {
|
|||||||
results[printer] = results[printer] or {}
|
results[printer] = results[printer] or {}
|
||||||
table.insert(results[printer], {
|
table.insert(results[printer], {
|
||||||
id = id,
|
id = id,
|
||||||
time = os.date("%Y-%m-%d %H:%M:%S", tm),
|
time = stdnse.format_timestamp(tm),
|
||||||
state = ( IPP.StateName[tonumber(state)] or "Unknown" ),
|
state = ( IPP.StateName[tonumber(state)] or "Unknown" ),
|
||||||
size = size,
|
size = size,
|
||||||
owner = owner,
|
owner = owner,
|
||||||
|
|||||||
@@ -834,7 +834,7 @@ function convertADTimeStamp(timestamp)
|
|||||||
|
|
||||||
result = ( timestamp // 10000000 ) - 3036
|
result = ( timestamp // 10000000 ) - 3036
|
||||||
result = result + base_time
|
result = result + base_time
|
||||||
result = os.date("%Y/%m/%d %H:%M:%S UTC", result)
|
result = stdnse.format_timestamp(result, 0)
|
||||||
else
|
else
|
||||||
result = 'Never'
|
result = 'Never'
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -2629,7 +2629,7 @@ function winreg_enumkey(smbstate, handle, index, name)
|
|||||||
|
|
||||||
-- [in,out,unique] NTTIME *last_changed_time
|
-- [in,out,unique] NTTIME *last_changed_time
|
||||||
pos, result['changed_time'] = msrpctypes.unmarshall_NTTIME_ptr(arguments, pos)
|
pos, result['changed_time'] = msrpctypes.unmarshall_NTTIME_ptr(arguments, pos)
|
||||||
result['changed_date'] = os.date("%Y-%m-%d %H:%M:%S", result['changed_time'])
|
result['changed_date'] = stdnse.format_timestamp(result['changed_time'])
|
||||||
|
|
||||||
pos, result['return'] = msrpctypes.unmarshall_int32(arguments, pos)
|
pos, result['return'] = msrpctypes.unmarshall_int32(arguments, pos)
|
||||||
if(result['return'] == nil) then
|
if(result['return'] == nil) then
|
||||||
@@ -2771,7 +2771,7 @@ function winreg_queryinfokey(smbstate, handle)
|
|||||||
|
|
||||||
-- [out,ref] NTTIME *last_changed_time
|
-- [out,ref] NTTIME *last_changed_time
|
||||||
pos, result['last_changed_time'] = msrpctypes.unmarshall_NTTIME(arguments, pos)
|
pos, result['last_changed_time'] = msrpctypes.unmarshall_NTTIME(arguments, pos)
|
||||||
result['last_changed_date'] = os.date("%Y-%m-%d %H:%M:%S", result['last_changed_time'])
|
result['last_changed_date'] = stdnse.format_timestamp(result['last_changed_time'])
|
||||||
|
|
||||||
pos, result['return'] = msrpctypes.unmarshall_int32(arguments, pos)
|
pos, result['return'] = msrpctypes.unmarshall_int32(arguments, pos)
|
||||||
if(result['return'] == nil) then
|
if(result['return'] == nil) then
|
||||||
@@ -4421,7 +4421,7 @@ local function get_domain_info(host, domain)
|
|||||||
response['groups'] = groups
|
response['groups'] = groups
|
||||||
response['users'] = names
|
response['users'] = names
|
||||||
if(querydomaininfo2_result_8['info']['domain_create_time'] ~= 0) then
|
if(querydomaininfo2_result_8['info']['domain_create_time'] ~= 0) then
|
||||||
response['created'] = os.date("%Y-%m-%d %H:%M:%S", querydomaininfo2_result_8['info']['domain_create_time'])
|
response['created'] = stdnse.format_timestamp(querydomaininfo2_result_8['info']['domain_create_time'])
|
||||||
else
|
else
|
||||||
response['created'] = "unknown"
|
response['created'] = "unknown"
|
||||||
end
|
end
|
||||||
@@ -4889,7 +4889,7 @@ function get_server_stats(host)
|
|||||||
local stats = netservergetstatistics_result['stat']
|
local stats = netservergetstatistics_result['stat']
|
||||||
|
|
||||||
-- Convert the date to a string
|
-- Convert the date to a string
|
||||||
stats['start_str'] = os.date("%Y-%m-%d %H:%M:%S", stats['start'])
|
stats['start_str'] = stdnse.format_timestamp(stats['start'])
|
||||||
|
|
||||||
-- Get the period and convert it to a proper time offset
|
-- Get the period and convert it to a proper time offset
|
||||||
stats['period'] = os.time() - stats['start']
|
stats['period'] = os.time() - stats['start']
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ action = function(host, port)
|
|||||||
if ( target.ALLOW_NEW_TARGETS ) then
|
if ( target.ALLOW_NEW_TARGETS ) then
|
||||||
target.add(node.address.host)
|
target.add(node.address.host)
|
||||||
end
|
end
|
||||||
tab.addrow(response, ("%s:%d"):format(node.address.host, node.address.port), os.date("%x %X", node.ts))
|
tab.addrow(response, ("%s:%d"):format(node.address.host, node.address.port), stdnse.format_timestamp(node.ts))
|
||||||
end
|
end
|
||||||
|
|
||||||
if ( #response > 1 ) then
|
if ( #response > 1 ) then
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ action = function()
|
|||||||
end
|
end
|
||||||
local ts
|
local ts
|
||||||
if ( info.timestamp and 1000 < info.timestamp ) then
|
if ( info.timestamp and 1000 < info.timestamp ) then
|
||||||
ts = os.date("%x %X", info.timestamp//1000)
|
ts = stdnse.format_timestamp(info.timestamp//1000)
|
||||||
else
|
else
|
||||||
ts = "-"
|
ts = "-"
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -156,7 +156,7 @@ local function get_info_registry(host)
|
|||||||
result['status-currentversion'], result['currentversion'] = reg_get_value(smbstate, openhklm_result['handle'], "Software\\Microsoft\\Windows NT\\CurrentVersion", "CurrentVersion")
|
result['status-currentversion'], result['currentversion'] = reg_get_value(smbstate, openhklm_result['handle'], "Software\\Microsoft\\Windows NT\\CurrentVersion", "CurrentVersion")
|
||||||
result['status-installdate'], result['installdate'] = reg_get_value(smbstate, openhklm_result['handle'], "Software\\Microsoft\\Windows NT\\CurrentVersion", "InstallDate")
|
result['status-installdate'], result['installdate'] = reg_get_value(smbstate, openhklm_result['handle'], "Software\\Microsoft\\Windows NT\\CurrentVersion", "InstallDate")
|
||||||
if(result['status-installdate'] ~= false) then
|
if(result['status-installdate'] ~= false) then
|
||||||
result['installdate'] = os.date("%Y-%m-%d %H:%M:%S", result['installdate'])
|
result['installdate'] = stdnse.format_timestamp(result['installdate'])
|
||||||
end
|
end
|
||||||
|
|
||||||
result['status-productname'], result['productname'] = reg_get_value(smbstate, openhklm_result['handle'], "Software\\Microsoft\\Windows NT\\CurrentVersion", "Productname")
|
result['status-productname'], result['productname'] = reg_get_value(smbstate, openhklm_result['handle'], "Software\\Microsoft\\Windows NT\\CurrentVersion", "Productname")
|
||||||
|
|||||||
Reference in New Issue
Block a user