Re: New C functions for Nessus 2.2?

Thomas Reinke <[email protected]> Thu, 16 Sep 2004 17:05:23 -0400
Newsgroups gmane.comp.security.nessus.devel
Message-ID <[email protected]>
Michel Arboi wrote:
> On Thu Sep 16 2004 at 20:26, Thomas Reinke wrote:
> 
> 
>>Short of re-inventing the wheel, how else would you convert
>>a readable date into a julian timestamp?
> 
> 
> mktime does not parse a readable date: it converts a struct tm into a time_t
> 

Ok...let's reset here.

You have a readable date which you know to be of a
particular format, e.g. consider the date returned
by Apache in all headers: "Thu, 16 Sep 2004 21:00:36 GMT".
You want to convert this to a julian time.  The only
way I know of doing this reliably is to parse the field,
convert strings such as "Sep" to the appropriate integer
value, and then call mktime with the appropriately
populated time structure.

Is there another, reliable, secure way of doing the above
that I'm not aware of?

As I repeated earlier, if you can then do this, one can
do things such as compare this against the local system
time, which if you know is accurate, will tell you
whether or not the remote system is time synced.  If you
then compare against returned results from icmp timestamp
messages, you can compare the accuracy of the remote
clock.  If the accuracies vary, you know you are talking
to two different devices.

Not to mention simply the fact that good sysadmins should
keep their clocks synced to make it easier to troubleshoot
problems across a network.

Thomas




_______________________________________________
Nessus-devel mailing list
[email protected]
http://mail.nessus.org/mailman/listinfo/nessus-devel