1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-20 14:39:02 +00:00

Use ISO8601 time for smb-os-discovery

This commit is contained in:
dmiller
2012-08-16 15:46:37 +00:00
parent 74a2168a15
commit 9fbd30f191
2 changed files with 3 additions and 1 deletions

View File

@@ -3266,7 +3266,9 @@ function get_os(host)
response['domain'] = smbstate['domain']
response['server'] = smbstate['server']
response['date'] = smbstate['date']
response['time'] = smbstate['time']
response['timezone_str'] = smbstate['timezone_str']
response['timezone'] = smbstate['timezone']
-- Kill SMB
stop(smbstate)

View File

@@ -124,7 +124,7 @@ action = function(host)
os_string = string.format( "%s (%s)", get_windows_version( result['os'] ), result['lanmanager'] )
end
if (result['date'] and result['timezone_str']) then
time_string = string.format("%s %s", result['date'], result['timezone_str'])
time_string = string.format("%s%+03d%02d", os.date("%Y-%m-%dT%H:%M:%S", result.time), result.timezone, math.abs(math.fmod(result.timezone, 1)) * 60)
end