Kismet on Raspberry Pi running Raspbian

RaspberryPiOn an Raspberry Pi this process will probably take more then an hour.(Sit back and relax once you typed in make..)
Before installing kismet from source we need some apps from the repository.

sudo apt-get install libncurses5-dev libpcap-dev libpcre3-dev libnl-dev -y

Now we can download and compile the source

tar -zxf kismet-2013-03-R1b.tar.gz
cd kismet-2013-03-R1b
sudo make suidinstall
sudo usermod -a -G kismet pi
sudo reboot

Configuring monitor mode:

sudo iw phy phy0 interface add mon0 type monitor
sudo iw dev wlan0 del
sudo airodump-ng mon0

Open a new windows and configure Kismet:
Edit /usr/local/etc/kismet.conf and add “ncsource=mon0”, “hidedata=true

And starting with:


Mount NFS server and move SWAP to nfs share on the Raspberry Pi

RaspberryPiBefore we can start with this on the Raspberry we need to make sure we have the NFS Server up and running. In my case this is a FreeNas box that has multiple disk running in zfs raid.
After the share is set up on the server (/mnt/pool1/pi) we can switch to the Pi.

First we need to make sure the rpcbind service is running and started on bootup.

sudo update-rc.d rpcbind defaults && sudo service rpcbind start

Now we can test if we can mount our share before we add it to our fstab:

sudo mount YourNfsServerIp://mnt/pool1/pi /mnt

Check with df -h if the share is mounted.(normally when it doesn’t show an error all should be ok.)
My results:

pi@pi ~ $ df -h
Filesystem                  Size  Used Avail Use% Mounted on
rootfs                      7,4G  2,5G  4,7G  35% /
/dev/root                   7,4G  2,5G  4,7G  35% /
devtmpfs                    239M     0  239M   0% /dev
tmpfs                        49M  260K   49M   1% /run
tmpfs                       5,0M     0  5,0M   0% /run/lock
tmpfs                        97M     0   97M   0% /run/shm
/dev/mmcblk0p1               56M  9,6M   47M  18% /boot  113G  7,5G  106G   7% /mnt

Now that all is working we can add a new line to /etc/fstab  (change the ip with your own.) /mnt    nfs    defaults    0    0

Now that NFS is setup correct we can move the swap to a real drive.
Let’s start with cleaning and removing the old on the sd-card.

sudo apt-get remove –purge dphys-swapfile -y
sudo rm /var/swap
sudo rm /etc/init.d/dphys-swapfile
sudo update-rc.d dphys-swapfile remove

Now we can create and mount a new file.(1Gb change the value count=1024 if you need a smaller/larger swap)

sudo dd if=/dev/zero of=/mnt/swap bs=1M count=1024
sudo losetup /dev/loop0 /mnt/swap
sudo mkswap /dev/loop0
sudo swapon /dev/loop0

Check with free -m if you can see the swap file.
Now we can edit our /etc/rc.local and add before exit 0

echo “Setting up loopy/mnt/swap..”
sleep 2
losetup /dev/loop0 /mnt/swap
mkswap /dev/loop0
swapon /dev/loop0

Have fun.

Full disk backup on the Raspberry Pi

RaspberryPiOne of the most important thing on the pi is to have decent backups, since our root is on an untrusted sd-card there will always be the risk of that corrupted filesystem.
Over on I found a script that fits my needs and uses dd to make a copy of the sd-card and stores that on my NFS (FreeNas) Server that runs zfs raid over multiple disk.
Also doing some test how the pi runs if the root is completely on nfs..(more on that later.)

I stored the backup script on my nfs share that is mounted to /mnt
Backups are stored in /mnt/Pi-backups
Script and logs are in /mnt/scripts
Backup script runs twice a day and the backups for the last 7 days are stored.
Here’s the script.(/mnt/scripts/


# Setting up backup directories

# Setting up echo fonts
NC=’\e[0m’ #No Color
bold=`tput bold`
normal=`tput sgr0`

#Screen clear

echo -e “${green}${bold}Starting RaspberryPI backup process!${NC}${normal}”
echo “”
# First check if pv package is installed, if not, install it first
PACKAGESTATUS=`dpkg -s pv | grep Status`;

if [[ $PACKAGESTATUS == S* ]]
echo -e “${cyan}${bold}Package ‘pv’ is installed${NC}${normal}”
echo “”
echo -e “${yellow}${bold}Package ‘pv’ is NOT installed${NC}${normal}”
echo -e “${yellow}${bold}Installing package ‘pv’ + ‘pv dialog’. Please wait…${NC}${normal}”
echo “”
sudo apt-get -y install pv && sudo apt-get -y install pv dialog

# Check if backup directory exists
if [ ! -d “$DIR” ];
echo -e “${yellow}${bold}Backup directory $DIR doesn’t exist, creating it now!${NC}${normal}”
sudo mkdir $DIR


# Create a filename with datestamp for our current backup (without .img suffix)
OFILE=”$DIR/backup_$(date +%Y%m%d_%H%M%S)”

# Create final filename, with suffix

# First sync disks
sync; sync

# Shut down some services before starting backup process
echo “”
echo -e “${purple}${bold}Stopping services before backup${NC}${normal}”
sudo pkill deluged
sudo pkill deluge-web
sudo service deluge-daemon stop
sudo service noip stop
sudo service cron stop
sudo service proftpd stop
sudo service webmin stop
sudo service xrdp stop

# Begin the backup process, should take about 45 minutes hour from 8Gb SD card to NFS
echo “”
echo -e “${green}${bold}Backing up SD card to img file on NFS${NC}${normal}”
SDSIZE=`sudo blockdev –getsize64 /dev/mmcblk0`;
sudo pv -tpreb /dev/mmcblk0 -s $SDSIZE | dd of=$OFILE bs=1M conv=sync,noerror iflag=fullblock

# Wait for DD to finish and catch result

# Start services again that where shutdown before backup process
echo “”
echo -e “${purple}${bold}Starting the stopped services${NC}${normal}”
sudo service deluge-daemon start
sudo deluged
sudo deluge-web
sudo service noip start
sudo service cron start
sudo service proftpd start
sudo service webmin start
sudo service xrdp start

# If command has completed successfully, if not, delete created files
if [ $RESULT = 0 ];
echo “”
echo -e “${green}${bold}RaspberryPI backup process completed! FILE: $OFILEFINAL${NC}${normal}”
echo -e “${yellow}Removing backups older than 7 days${NC}”
sudo find $DIR -maxdepth 1 -name “*.img” -mtime +7 -exec rm {} \;
echo -e “${cyan}If any backups older than 7 days were found, they were deleted${NC}”
exit 0
# Else remove attempted backup file
echo “”
echo -e “${red}${bold}Backup failed!${NC}${normal}”
sudo rm -f $OFILE
echo “”
echo -e “${purple}Last backups on NFS:${NC}”
sudo find $DIR -maxdepth 1 -name “*.img” -exec ls {} \;
echo “”
echo -e “${red}${bold}RaspberryPI backup process failed!${NC}${normal}”
exit 1

Make the script executable:

chmod +x /mnt/scripts/

Add it to your crontab so it runs twice a day:

crontab -e

And add the following line:

0 4/16 * * * /mnt/scripts/ > /mnt/scripts/cron.log 2>&1

That’s all for today, Let’s make a test backup by running:



Install and Test Aircrack on Raspberry Pi running Raspbian

RaspberryPiAfter running kali for a couple hours I had some issues with my Alfa’s and decided to switch to Raspbian and build up my image from there.
We need to see what’s around us so let’s install aircrack and do some ‘monitoring’.
Start with a updated system:

sudo apt-get update && sudo apt-get dist-upgrade -y

Next some requisition:

sudo  apt-get install libnl-dev libssl-dev iw -y

Now grab yourself a beer and the latest sources from the aircack-ng site:


Time to compile it:(and drink that beer.)

tar -zxf aircrack-ng-1.2-beta3.tar.gz
cd aircrack-ng-1.2-beta3
sudo make install

Last step before we can test is to install Airodump-ng OUI file:

sudo airodump-ng-oui-update

Now put your wifi in monitor mode and check if you can read packages:

sudo airmon-ng start wlan0
sudo airodump-ng mon0


cd ..
rm -rf aircrack-ng*

Have Fun 😉

Remote control your Raspberry Pi running Kali using VNC server

RaspberryPiI like low-power devices that you can leave somewhere for some interesting research.
Therefore I need remote access to it and turnout it was an easy task on the Raspberry Pi.
Lets first do a general update/upgrade to make sure the pi is on the latest software..

apt-get update
apt-get dist-upgrade -y

Now lets install the VNC server.

apt-get install x11vnc -y

Before we can start the VNC server we first need to make sure our x11 server is just running fine (if you don’t start it first VNC will throw you an error.)

startx &

(Note: If it is the first time you start your X11 environment you probably want the pi connected to an external output (hdmi) to see if the initial configuration went well on it. after that it can be disconencted from the video source and remoted into.)

Now that we have our X11 server running fine we can start our VNC server to remote into you x11 enviroment:

x11vnc &

I would recommend to tunnel your traffic over a ssh tunnel if your Pi is on a remote location.
(Note: When you disconnect from the VNC server the server will shut down. So if you wanne connect again you need to run x11vnc & again …)

Have fun..:)

Vertical Auto Bed Level Probe for PRUSA i3 RepRap Printer

After building my first 3D printer I was looking for an autobed-level mount for the z-axis.

I found a lot of bed-level mounts on thingiverse but couldn’t find a nice on for Thingv1my PRUSA i3.All the things I found had all a motion rotating forwards/ backwards, but i had an issue with these because they where all touching the bed when calibrating.

To avoid hitting the bed when leveling I think the probe needs to move up/down.

So Let’s make a Thing 🙂

After hobbying around for a couple hours and thinking about the design I made some sketches in my mind and was transfering them to a 3D design.

So here is v1 of my First Thing…(Will be shared on Thingiverse after I complete printing and testing for it…)



Make a rotor that attaches to the probe.(to move it up and down)
Sharing .STL Files 🙂



Check out thingiverse for more updates

Turn your TP-Link TL-WR1043ND Router into a Pineapple

TL-WR1043NDA few weeks ago I came along this page and was wondering if it was possible to port this also to my router (used as switch) the TP-Link TL-WR1043ND.
A couple things still needs to be done (placing the WLAN in a seperate VLAN and some other small tweaks I”ll be working on the couple of weeks ;)) but the karma script is working and accepting clients 😉

Check out the progres: Here

OpenWrt 10.03.1 USB Image released for ASUS WL700gE

It’s been a while since I released my last OpenWrt image…

After some time I finally got some time to pick up the development for the ASUS WL700gE router/nas.

The development for the USB Basic image is completed and uploaded to the site.

More info on

In the next weeks I’m gonne create a image to boot from the internat HDD (image is almost completed just needs to be tested properly..)
Also in the planning is a image that includes al the basic OpenWrt goodies plus some extras added like bittorrent, nzb donloading, media server, and so on.

I’m also trying to create a image that is based purely on security. all sorts of sniffing goodies will be in there 🙂

Have fun with the new image.

Upgrade From BackTrack 5 R2 to BackTrack 5 R3

bt5r2-blog-1Recently, we released the long-awaited BackTrack 5 R3 but for those of you who don’t want to start fresh with a new installation, have no fear because you can easily upgrade your existing installation of R2 to R3.

Our primary focus with this release was on the implementation of various bug fixes, numerous tools upgrades and well over 60 new additions to the BackTrack suite. Because of this, the upgrade path to BackTrack 5 R3 is relatively quick and painless.

First, you will want to make sure that your existing system is fully updated:

Continue reading “Upgrade From BackTrack 5 R2 to BackTrack 5 R3”

Building your own storage server with freenas

My goal was to create an affordable storage server that has a capacity around 10 TB, to store my favorite collections on it and make some backups from various system.
And most important … It doesn’t use a lot of juice….

I was also looking at some QNAP’s and SYNOLOGY’s NAS drives but they are all pretty expensieve  especialy the ones that could house 8 drives or more.

I used the following components to build/house my storage server. (note that most of these part where laying aroung in my house.)
Continue reading “Building your own storage server with freenas”