Wednesday, 6 November 2013

Raspberry pi war drive

Recently I purchased a raspberry pi to motivate myself and jump into command line and bash scripting. I think the idea of using a raspberry pi alongside a security distribution such as kali interesting. There are no limits to what can be done, especially considering the size of the raspberry for concealment. I've started with a war driving project. Later I'd like to add a web interface and turn on and off features through my phone. Some of the equipment I used for this:
  • Raspberry pi B
  • Edimax wireless usb EW-7811U   
  • Alfa AWUSO36NH wireless usb
  • EasyACC Super 1200mAh portable charger
  • kali raspberry pi image 
  • 16gb sd card 
  • belkin hi-speed usb 2.0 4-port hub
  • GlobalSat BU-353 usb gps
  • Phone running wifi hotspot and ssh 
Equipment Used
Connect to the pi
I have setup my pi to connect to my wifi hotspot on startup. To do this,I edited the file interfaces: /etc/network/interfaces and added the following:
auto wlan0
iface lo inet loopback
auto wlan0
iface wlan0 inet dhcp
wpa-ssid "YourSSIDname"
wpa-psk yourGreatPassword

This works for me and it connects at each startup. Takes about 3 mins to connect. I use an app called juiceSSH to then ssh into my raspberry pi. I've tried a few and this one is really good. I'd recommend installing hackers keyboard as well. It gives you most of the keys you'd have with a regular keyboard and is great when your editing files, i.e using ctrl x etc.

Setting up gps
My gps was relatively straight forward to get working.
Once plugged in, check where the default gpsd is attached /etc/default/gpsd
Mine is on /dev/ttyUSB0
Its important to take note of this so you can get it working with kismet.
Use lsusb to check its showing up as connected.
If you want to check that your gps is working, use the command cgps -s. You should see some info popping up. 
I have a quick script that starts up gps and kismet. Im using pyglow to turn on led lights when its running so I know its working.

Kismet 
Kismet comes preinstalled on kali so you just need to edit the kismet.config file to get it working. /etc/kismet/kismet.conf
Find this section and edit the gpsdevice section to whatever your usb was listed as.
You can also do some other configurations like setting the specific wireless card driver and setting up a path to where you want your output file to be saved to. I have it saved to my Desktop. Also specify which usb your working from. i.e in my case I have the alfa plugged into wlan1.



Create kml file for google maps

The output file from kismet will be a .netxml. In order for it to display on google maps we need a .kml file. We can use giskismet for this and create a database.
To do this have a look at the possible giskismet commands : giskismet --help.
So the command to use is giskismet -x (your .xml file) -o .kmlFileNameYouWant
In my case I used:

Now a database is created with all the info, we can now filter what we want from it:
Looking at the giskismet --help file again, using a -q sql query we can use the command
giskismet -q "select * from wireless where Encryption='WEP'" -o MyWepMap.kml

This should create a MyWepMap.kml
Now upload it to google maps.

Click into my places

Now create with classic maps, and import your .klm file. Below are the filtered wep encryption networks..