r6uur6nr6u5ur56 Posted April 9, 2015 Share Posted April 9, 2015 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 ? Quote Link to comment Share on other sites More sharing options...
Sebkinne Posted April 9, 2015 Share Posted April 9, 2015 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 Quote Link to comment Share on other sites More sharing options...
r6uur6nr6u5ur56 Posted April 9, 2015 Author Share Posted April 9, 2015 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 :) Quote Link to comment Share on other sites More sharing options...
Sebkinne Posted April 9, 2015 Share Posted April 9, 2015 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 Quote Link to comment Share on other sites More sharing options...
r6uur6nr6u5ur56 Posted April 9, 2015 Author Share Posted April 9, 2015 (edited) 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 April 9, 2015 by DragonHunter Quote Link to comment Share on other sites More sharing options...
Sebkinne Posted April 9, 2015 Share Posted April 9, 2015 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. Quote Link to comment Share on other sites More sharing options...
chrismyers2000 Posted April 10, 2015 Share Posted April 10, 2015 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 Quote Link to comment Share on other sites More sharing options...
r6uur6nr6u5ur56 Posted April 12, 2015 Author Share Posted April 12, 2015 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 :) Quote Link to comment Share on other sites More sharing options...
chrismyers2000 Posted April 13, 2015 Share Posted April 13, 2015 (edited) 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 April 13, 2015 by chrismyers2000 Quote Link to comment Share on other sites More sharing options...
r6uur6nr6u5ur56 Posted April 13, 2015 Author Share Posted April 13, 2015 (edited) 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 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 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 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 April 13, 2015 by DragonHunter Quote Link to comment Share on other sites More sharing options...
chrismyers2000 Posted April 13, 2015 Share Posted April 13, 2015 (edited) I will probably get a GPS stick eventually, but atm I found a even better solution 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 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 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 April 13, 2015 by chrismyers2000 Quote Link to comment Share on other sites More sharing options...
r6uur6nr6u5ur56 Posted April 13, 2015 Author Share Posted April 13, 2015 (edited) 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 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 Wireshark finds the time weird in the column... lol In the actual packets it's showing the correct time Edited April 13, 2015 by DragonHunter Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.