Jump to content

Time Problem - Time jumps back to 2013


Recommended Posts

Yoo, I'm having a bit of a problem here...


Once there is no internet connection, turned off for ~6 hours orso... the pineapple does not remember the time

Once it will do the boot script for capturing packets at wlan1, it will show in the pcap file it happend in "Dec 31, 2013 23:00:00"


Anywway to fix this sorta thing ?

Link to comment
Share on other sites

Hi DragonHunter,

Unfortunately, the WiFi Pineapple MKV does not have a real-time clock. This means it cannot remember the current time.

The only way to fix this, is to use NTP / set the current time manually.

So that some network communications don't totally break, we set the default date to be 2014-01-01 00:00:00 (depending on timezone, it'll jump back to 2013).

For the next firmware, we will be using the date the firmware was compiled on instead of 2014.

Best Regards,

Sebkinne

Link to comment
Share on other sites

Hi DragonHunter,

Unfortunately, the WiFi Pineapple MKV does not have a real-time clock. This means it cannot remember the current time.

The only way to fix this, is to use NTP / set the current time manually.

So that some network communications don't totally break, we set the default date to be 2014-01-01 00:00:00 (depending on timezone, it'll jump back to 2013).

For the next firmware, we will be using the date the firmware was compiled on instead of 2014.

Best Regards,

Sebkinne

Woow it doesn't have a realtime clock ? my colleagues are into engineering and the cost for those chips are just a few euro's if you buy them in for a 1000 at once

Is there a easy way for changing the NTP server to a different ip address, I can run a NTP server on my phone no problem.

Is there btw also a way to forget networks you connected to earlier with client mode ?

thanks for the help so far :)

Link to comment
Share on other sites

DragonHunter,

Is there a easy way for changing the NTP server to a different ip address, I can run a NTP server on my phone no problem.

Absolutely. While you cannot edit the timeservers over the webinterface, you simply have to edit the /etc/config/system file over SSH.

Is there btw also a way to forget networks you connected to earlier with client mode ?

Simply disconnecting via the client mode interface will forget it.

Best Regards,
Sebkinne

Link to comment
Share on other sites

DragonHunter,

Absolutely. While you cannot edit the timeservers over the webinterface, you simply have to edit the /etc/config/system file over SSH.

Simply disconnecting via the client mode interface will forget it.

Best Regards,

Sebkinne

I tried setting the IP Address in /etc/config/system like u said, doesn't seem to get the time automatically (when no internet), setted phone to static ip

Also tried ntpclient but that throws "Connection refused" instantly

Edited by DragonHunter
Link to comment
Share on other sites

I tried setting the IP Address in /etc/config/system like u said, doesn't seem to get the time automatically (when no internet), setted phone to static ip

Also tried ntpclient but that throws "Connection refused" instantly

Sounds like an issue with the phone.

Link to comment
Share on other sites

You could also plug in a USB GPS dongle and grab the date/time data using GPSD.

This is my borrowed/modified script I use at startup.

# START GPSD
/usr/sbin/gpsd -n -b /dev/ttyUSB0
pineapple led blue on
echo "Starting GPSD"

# WAIT UNTIL IT'S READY TO ACCEPT CLIENT CONNECTIONS
sleep 1

# MONITOR GPS STATUS AND WAIT FOR SAT LOCK
echo "Waiting for GPS lock"
/usr/bin/gpspipe -l -w -n 10 | grep -qm 1 '"mode":3'

# PARSE THE CURRENT UTC TIME FROM THE GPSD OUTPUT
UTCDATE=`/usr/bin/gpspipe -w -n 10 | grep -m 1 "TPV" | sed -r 's/.*"time":"([^"]*)".*/\1/' | sed -e 's/^\(.\{10\}\)T\(.\{8\}\).*/\1 \2/'`

# SET THE PINEAPPLE'S CLOCK
/bin/date -u -s "$UTCDATE"
echo "Time Set"
pineapple led blue off
Link to comment
Share on other sites

You could also plug in a USB GPS dongle and grab the date/time data using GPSD.

This is my borrowed/modified script I use at startup.

# START GPSD
/usr/sbin/gpsd -n -b /dev/ttyUSB0
pineapple led blue on
echo "Starting GPSD"

# WAIT UNTIL IT'S READY TO ACCEPT CLIENT CONNECTIONS
sleep 1

# MONITOR GPS STATUS AND WAIT FOR SAT LOCK
echo "Waiting for GPS lock"
/usr/bin/gpspipe -l -w -n 10 | grep -qm 1 '"mode":3'

# PARSE THE CURRENT UTC TIME FROM THE GPSD OUTPUT
UTCDATE=`/usr/bin/gpspipe -w -n 10 | grep -m 1 "TPV" | sed -r 's/.*"time":"([^"]*)".*/\1/' | sed -e 's/^\(.\{10\}\)T\(.\{8\}\).*/\1 \2/'`

# SET THE PINEAPPLE'S CLOCK
/bin/date -u -s "$UTCDATE"
echo "Time Set"
pineapple led blue off

Which GPS dongle do you prefer ? or does it not matter which 1 to use ?

It would be nice to have a lower powered dongle which will still do the job :)

Link to comment
Share on other sites

Which GPS dongle do you prefer ? or does it not matter which 1 to use ?

It would be nice to have a lower powered dongle which will still do the job :)

I use a Globalsat BU-353. It only draws about 60mA @9v (measured from the pineapple power supply) but is only needed while the script is running. I simply unplug it afterwards unless i'm using it for other things like Kismet. I also have an older Pharos iGPS-500 that does the job but is much slower and clunkier. I prefer the Globalsat.

Edited by chrismyers2000
Link to comment
Share on other sites

I use a Globalsat BU-353. It only draws about 60mA @9v (measured from the pineapple power supply) but is only needed while the script is running. I simply unplug it afterwards unless i'm using it for other things like Kismet. I also have an older Pharos iGPS-500 that does the job but is much slower and clunkier. I prefer the Globalsat.

I will probably get a GPS stick eventually, but atm I found a even better solution :lol::lol:

So, here is my solution, we let the pineapple SSH into a android device, grab the phone's time and voila pineapple is having the time without internet :grin:

Stuff I did to get it all working:

1. SSH into the pineapple

2. Go into /root/.ssh

3. ssh-keygen -t dsa (do not fillin a password)

3. cat id_dsa.pub >> ~/.ssh/authorized_keys

4. now copy that id_dsa.pub from your pineapple to the Phone (or laptop whatever) I simply used FileZilla

5. Copy that id_dsa.pub to /<YourHomeFolder>/.ssh

6. cat id_dsa.pub >> ~/.ssh/authorized_keys

7. Create a set_date.sh on your Pineapple in /root/set_date.sh

#!/bin/sh
date `ssh USER@HOST date "+%y%m%d%H%M.%S"`
8. chmod +x set_date.sh
Set the Cron job on your pineapple, I setted mine to 5 minutes, could even do 1 minute tbh
*/05 * * * * /root/set_date.sh
This should do the job :tongue:
This method might even be quicker then using a GPS stick since you'd probably have to wait for a lock or something
Don't forget to use a static ip at your own device (not the pineapple) incase ip changes and script no longer works...
Edited by DragonHunter
Link to comment
Share on other sites

I will probably get a GPS stick eventually, but atm I found a even better solution :lol::lol:

So, here is my solution, we let the pineapple SSH into a android device, grab the phone's time and voila pineapple is having the time without internet :grin:

Stuff I did to get it all working:

1. SSH into the pineapple

2. Go into /root/.ssh

3. ssh-keygen -t dsa (do not fillin a password)

3. cat id_dsa.pub >> ~/.ssh/authorized_keys

4. now copy that id_dsa.pub from your pineapple to the Phone (or laptop whatever) I simply used FileZilla

5. Copy that id_dsa.pub to /<YourHomeFolder>/.ssh

6. cat id_dsa.pub >> ~/.ssh/authorized_keys

7. Create a set_date.sh on your Pineapple in /root/set_date.sh

#!/bin/sh
date `ssh USER@HOST date "+%y%m%d%H%M.%S"`
8. chmod +x set_date.sh
Set the Cron job on your pineapple, I setted mine to 5 minutes, could even do 1 minute tbh
*/05 * * * * /root/set_date.sh
This should do the job :tongue:
This method might even be quicker then using a GPS stick since you'd probably have to wait for a lock or something
Don't forget to use a static ip at your own device (not the pineapple) incase ip changes and script no longer works...

Very cool idea. Hey whatever works the best for your situation :)

The nice thing about the GPS however is that the simple act of powering it up automatically starts the receiver and looks for sats. So during the 45 seconds or so of the pineapple booting up it usually already has a lock by the time the script starts. The scripts usually takes about 5-20 seconds depending on cold start vs hot start. The Globalsat has a built in supercapacitor that helps keep a lock even after you power it off. This function of course only lasts maybe an hour before it becomes "cold".

Also, no SSH required, which is how I use my pineapple in the feild usually. I like it to be preconfigured and able to deploy autonomously. But like I said, whatever works best for your situation.

One of these days I'd like to experiment with adding a Real Time Clock like this one to the Pineapple.

http://www.ebay.com/itm/like/181630087399?lpid=82&chn=ps

Edited by chrismyers2000
Link to comment
Share on other sites

Very cool idea. Hey whatever works the best for your situation :)

The nice thing about the GPS however is that the simple act of powering it up automatically starts the receiver and looks for sats. So during the 45 seconds or so of the pineapple booting up it usually already has a lock by the time the script starts. The scripts usually takes about 5-20 seconds depending on cold start vs hot start. The Globalsat has a built in supercapacitor that helps keep a lock even after you power it off. This function of course only lasts maybe an hour before it becomes "cold".

Also, no SSH required, which is how I use my pineapple in the feild usually. I like it to be preconfigured and able to deploy autonomously. But like I said, whatever works best for your situation.

One of these days I'd like to experiment with adding a Real Time Clock like this one to the Pineapple.

http://www.ebay.com/itm/like/181630087399?lpid=82&chn=ps

Thanks :tongue:

GPS could be fun for kismet etc, which I don't use currently will maybe in the future

A real time clock would be the best fix there is :happy:

Wireshark finds the time weird in the column... lol

In the actual packets it's showing the correct time

YgtKPWM.png

Edited by DragonHunter
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.

 Share

  • Recently Browsing   0 members

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