From c174f8dd975352daf77aac1e088a12ff5f6b3ecc Mon Sep 17 00:00:00 2001 From: dmiller Date: Thu, 8 Oct 2020 23:09:22 +0000 Subject: [PATCH] Adjust base time by local offset for Windows --- nselib/ldap.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/nselib/ldap.lua b/nselib/ldap.lua index 34eb67da9..8ba39c18b 100644 --- a/nselib/ldap.lua +++ b/nselib/ldap.lua @@ -22,7 +22,6 @@ local asn1 = require "asn1" local datetime = require "datetime" local io = require "io" local nmap = require "nmap" -local os = require "os" local stdnse = require "stdnse" local string = require "string" local stringaux = require "stringaux" @@ -825,8 +824,8 @@ function convertADTimeStamp(timestamp) local result = 0 -- Windows cannot represent this time, so we pre-calculated it: - -- os.time({year=1601, month=1, day=1, hour=0, minute=0, sec =0}) - local base_time = -11644473600 + -- seconds since 1601/1/1 adjusted for local offset + local base_time = -11644473600 + datetime.system_time_at_epoch timestamp = tonumber(timestamp)