Jump to content

chrismyers2000

Active Members
  • Posts

    9
  • Joined

  • Last visited

Posts posted by chrismyers2000

  1. 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

  2. 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.

  3. 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
    
  4. Well I figured it out. I stumbled across a post by dvarapala about warwalking and he posted his script which happens to do the exact thing that I want :)

    https://forums.hak5.org/index.php?/topic/33855-warwalking-redux-and-a-question/

    #!/bin/bash
    
    # START CLEAN
    pkill hostapd
    pkill gpsd
    pkill kismet
    /sbin/ifconfig wlan0 down
    /sbin/ifconfig wlan1 down
    
    # START GPSD
    /usr/sbin/gpsd -n /dev/ttyUSB0
    
    # WAIT UNTIL IT'S READY TO ACCEPT CLIENT CONNECTIONS
    sleep 1
    
    # MONITOR GPS STATUS AND WAIT FOR SAT LOCK
    gpspipe -w | grep -qm 1 '"mode":3'
    
    # PARSE THE CURRENT UTC TIME FROM THE GPSD OUTPUT
    UTCDATE=`gpspipe -w | grep -m 1 "TPV" | sed -r 's/.*"time":"([^"]*)".*/\1/' | sed -e 's/^\(.\{10\}\)T\(.\{8\}\).*/\1 \2/'`
    
    # SET THE PINEAPPLE'S CLOCK
    date -u -s "$UTCDATE"
    
    # LAUNCH KISMET DAEMON
    /usr/sbin/iwconfig wlan0 mode Monitor
    /usr/sbin/iwconfig wlan1 mode Monitor
    /usr/bin/kismet_server --daemonize
    

    I was having problems with gpspipe, it just would not work. I used opkg to uninstall and reinstall, but it still would not work. I ended up reflashing the firmware and starting fresh. It works like a charm now :)

  5. Anyone know of a fancy set of commands that would allow me to set the system time based on the incoming GPS data while running kismet_server?

    I have it set up to run using the DIP switches but the system time is always 01/01/2014 00:00. I'd like for the file names to be correctly labeled and also have correct time info for when AP's are seen. I'm also going for portability so I'd really like to not have to SSH in and enter it in manually every time I plug it in.

    This is my current boot config:

    ifconfig wlan1 down; iwconfig wlan1 mode monitor; ifconfig wlan1 up; sleep 5; kismet_server

    Any ideas?

  6. I have two GPS dongles that I currently use, the first is an old Pharos iGPS-500. The second is a Globalsat BU-353

    http://www.amazon.com/GlobalSat-BU-353-USB-GPS-Receiver/dp/B000PKX2KA/ref=sr_1_2?ie=UTF8&qid=1427335339&sr=8-2&keywords=globalsat+bu-353+usb+gps

    The globalsat is much quicker at getting a 3D fix and it comes with a magnet mount built in as well as adhesive.

    Both use Prolific pl2303 usb to serial drivers that are already installed on the pineapple. If its not installed on yours, run the command "opkg install kmod-usb-serial-pl2303"

    you will need to edit the /etc/kismet/kismet.conf file to allow kismet to listen to your GPS.

    Add or edit the lines:

    gps=true

    gpstype=serial

    gpsdevice=/dev/ttyUSB0

    Unless you have other USB devices hooked up, it should always be ttyUSB0.

    I also suggest changing the writeinterval=XX to something shorter than 300. If you're like me and use a battery, when the battery dies, you'll potentially loose your last 300 seconds of captures. I have mine set to 20 seconds and it seems to work fine.

    Hope this helps :)

  7. You can easily make your own map like that using kismet to capture and use giskismet to convert the .netkml file to a .kml file which you can open up in google earth. I set one of my dipswitch boot modes to automatically record AP names and GPS data using kismet_server. This is my current setup:

    "ifconfig wlan1 down; iwconfig wlan1 mode monitor; ifconfig wlan1 up; sleep 5; kismet_server"

    Here's a good tutorial on how to get kismet installed and set up on your wifi pineapple. I suggest changing the writeinverval= variable in the kismet.conf file to sometime shorter than 300 (default) because once you unplug it, you loose all the data that it captured since the last save.

    http://www.hackedexistence.com/project/wifi-pineapple/wardriving-with-wifi-pineapple-kismet.html

×
×
  • Create New...