Using Chef to Automate the Installation of Kismet

I can admit it; I’m a very dorky guy.  One of my hobbies is war driving.  I map day to day, and upload my results to social Wifi mapping site Wigle.net.  I usually stick to “wiglewifi” on a spare Android phone, but I prefer Kismet running on Linux for more accurate results.  Wiglewifi works great when you’re crusing around town, but your average cell phone lacks the wifi sensitivity to really shine.  With Kismet you can use a powerful external wireless adapter and run multiple adapters to listen on more than one channel at a time.

My setup consists of an Ubuntu 12.04 VM running under VirtualBox on my Mac.  I use a small waterproof magnetic GPS by USGLOBALSAT and two Alfa AWUS036H 1000mW USB wireless adapters.

I manually setup the Linux VM with Kismet and GPSd, but I figured it would be fun to automate the process using Opscode’s Chef.  Why not?  I wrote a chef recipe for kismet / gpsd available at https://github.com/tas50/chef_kismet.git

Chef is traditionally used in a client / server setup, but Chef also includes a standalone mode called Chef Solo.  The instructions below will allow you to setup a kismet system using Chef Solo

Step 1: Install Chef
apt-get install build-essential ruby rubygems ruby-dev
gem install chef ohai

Step 2: Configure Chef Solo
Edit /etc/chef/solo.rb and add the following values:
file_cache_path “/tmp/chef-solo”
cookbook_path “/root/cookbooks”

Step 3: Clone the necessary cookbooks
mkdir /root/cookbooks
cd /root/cookbooks
clone https://github.com/tas50/chef_kismet.git kismet
clone https://github.com/opscode-cookbooks/apt.git

Step 4: Create a JSON configuration file for the Installation
This configuration file will determine how gpsd and kismet are installed on your system.  The Readme for the Chef cookbook contains detailed information on each Chef attribute used to control the installation.  The below sample is what I use to sniff on wlan0 and log just nettxt file to the /root directory of my system.

Create kismet.json containing:
{
“kismet”: {
“servername”: “mobile_kismet”,
“logprefix”: “/root”,
“ncsource”: “wlan0”,
“logtypes”: “nettxt”
},
“run_list”: [“recipe[kismet::default]”]
}

Step 5: Run Chef Solo
chef-solo -c /etc/chef/solo.rb -j /root/kismet.json

You now have a kismet system

This whole process might seem a bit overly complicated for a kismet install, but why wardrive in the first place.  It’s all just fun stuff to keep you occupied.

Leave a Reply

Your email address will not be published. Required fields are marked *