Jump to content

System and Hardware clock/time


secureonelabs
 Share

Recommended Posts

I may be overlooking something very obvious here. Anyone else having issues "permanently" setting the system or hardware clocks? because ntp only works when there is internet connection, I can't rely on it. I can set the time manually while logged on via serial or ssh, but as soon as the bashbunny is rebooted or recycled, it reverts back to 1969. I'm writing custom scripts and need to set the correct datetime in my log files. 

# This sets the timezone

# dpkg-reconfigure tzdata

 

# This sets the date

# date --set 2017-03-09

 

# This sets the time

# date --set 01:32:00

 

# This is supposed to sync the hardware clock to the system clock, which it does when you run it, but disappears when bashbunny is restarted

# hwclock --systohc

Any help would be greatly appreciated. 

Cheers

Link to comment
Share on other sites

Hi Secureonelabs,

The answer is simply that the system doesn't have a RTC. Even if it did, as the device doesn't have a battery on board, it cannot keep the clock running. I am rolling in a small hack we use on the Pineapple: On system start, take a look at files on the system and set the system's time to the last changed time of these files. While that's not a totally accurate time, it fixes a lot of issues.

If you need accurate log times inside your payloads, you'll need to find a way to relay the correct time back to the Bunny. 

  • Upvote 1
Link to comment
Share on other sites

  • 11 months later...

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.

 Share

  • Recently Browsing   0 members

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