Jump to content

Funny stuff Coding, (mine setting sys time to 1601)


overwraith

Recommended Posts

So recently I was attempting to make a metadata removal tool for file types, I was removing data in this case from pdf files. There are some funny occurrences just wait for a brief explanation. I figured out how to remove most of the internal metadata from a pdf using itextsharp (C# version of itext), but then I wanted to do more. I wanted to remove the creation date, and modified dates, set them to something which would nullify using them. The only way I figured out how to do this was to set the computer's system time to the first of January 1601, which is the minimum time that the windows operating system supports. I figured may as well set the date to the minimum value. I found the code online to do so, calling "kernel32.dll", and couldn't figure out for a while how to get the code to run with the proper time altering process flag, but alas run as administrator solves everything. So the code runs, sets the time to Januay 1, 1601, and spectacular errors ensue. The itext sharp library is apparently signed with a specific date, and when you set the date before it was signed a cryptography error or something occurrs, so you can't even access the file to tweak the metadata (I can fix this by setting the date to be something perhaps a random low number of months ago instead of 1601). Next I notice that my Antivirus software didn't like the system change, so you set the date to some date in the past, and for some reason it wants to update. Next I try to browse the internet, and the web browser doesn't like the signing on https:\\www.google.com. I can puzzle this one out, if the times are wrong then of course a cryptographic algorithm isn't going to like the dates being tweaked, timestamps are important for determining if the traffic is being transmitted in a timely manner, therefore is not crackable. But still, it was fun seeing everything break. I even got some windows prompts on the issue, I don't remember exactly what they said.

Edited by overwraith
Link to comment
Share on other sites

Go to an HTTPS website and have a look at the cert for that site. You'll notice that the cert is valid from DATE to DATE. When your current date lies before the start date of a cert, that cert isn't valid according to your machine.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...