Mailing List Archive

SMB LogonTime Question
Good day,

Please advise on how to convert the value of the KB Item "SMB/LocalUsers/1/Info/LogonTime=0x01-0xc1-0x3b-0xa4-0x4c-0x0d-0x17-0x6a"
to a date and time to be displayed to the user.
The idea is to display last logon times for local users for user maintenance purposes.

Any help would be appreciated.


_______________________________________________
Plugins-writers mailing list
Plugins-writers@list.nessus.org
http://mail.nessus.org/mailman/listinfo/plugins-writers
Re: SMB LogonTime Question [ In reply to ]
On Sep 5, 2008, at 6:27 AM, Herman Young wrote:

> Please advise on how to convert the value of the KB Item "SMB/
> LocalUsers/1/Info/LogonTime=0x01-0xc1-0x3b-0xa4-0x4c-0x0d-0x17-0x6a"
> to a date and time to be displayed to the user.
> The idea is to display last logon times for local users for user
> maintenance purposes.

The value is an NTTIME, a 64-bit time value denoting the number of
seconds since midnight January 1, 1601. So you probably will want to
figure out the number of seconds between that and the Unix epoch (see,
for example, http://www.epochconverter.com/), use that to convert from
an NTTIME to a unix time, pass the result into localtime, and finally
use the time structure localtime() returns to display the times in a
more friendly format.

George
--
theall@tenablesecurity.com



_______________________________________________
Plugins-writers mailing list
Plugins-writers@list.nessus.org
http://mail.nessus.org/mailman/listinfo/plugins-writers