Fonera 2.0g as a standalone wardriving device

Needed parts:

Hardware setup:

4 batteries will power the Fonera and the others 4 will power USB hub, ie: pendrive and GPS receiver. Both devices should carry a voltage regulator, so as long as your batteries deliver around 5v you’ll be fine. I advise batteries of at least 1600mAh. My setup allows wardriving secessions lasting about 3 hours.

Firmware:

I use OpenWrt 10.03 Backfire on Fonera 2.0g, which requires the atheros build. Plenty of tutorials to flash a Fonera with standard OpenWrt are available. I advise using Gargoyle Router FonFlash tool.

Software packages:

With my Globalsat BU-353 GPS receiver here is the packages i needed to wardrive and troubleshoot:

# opkg install kismet-server gpsd netcat hotplug2 kmod-usb2 kmod-fs-vfat kmod-nls-base kmod-nls-cp437 kmod-usb-serial-pl2303 usbutils coreutils-stty picocom

The issue is to find a gpsd version that works well with your GPS receiver, your version of kismet and your openwrt environment. After trying several combinations which were either not working or proved to be unstable; I came-up with the following working perfectly with openwrt 10.03:

I built a version of the gpsd package including cgps, which standard openwrt make file do not include. I found cgps to be a useful command line client for troubleshooting. To locate issues with gpsd, another useful client might be xgps which as an X11 interface.

Configure and launch:

Here is the kismet.conf I use. It only retrieve public info about the SSIDs (BSSIDs, cypher, channel, etc.) and store them in my usb pendrive. No personal info is stored (No traffic log).

Get inspire by my /etc/init.d script to setup and launch the wardriving session:

#!/bin/sh /etc/rc.common
# Wardriving script

STOP=40

start() {
mount /dev/sda1 /mnt/sda1
gpsd /dev/ttyUSB0 -n -G
/usr/bin/kismet_server &
}

stop() {
killall kismet_server
killall gpsd
sync
umount /mnt/sda1
}

Use collected datas:

I hadn’t the time to setup a neet implementation, but there is endless possibilities when serving collected data via a web server installed on the Fonera. You can even use XSLT to dynamically transform the XML files generated by kismet!

As an example, here is a quick XSLT script I’ve done to put BSSIDs in CSV files:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"   version='1.0'>

  <xsl:output method="text" encoding="utf-8"/>

<!-- Parse "wireless-network" template only if attribute "type" is "infrastructure" -->
  <xsl:template match="wireless-network">
   <xsl:if test="@type='infrastructure'">
   <xsl:apply-templates/>
   </xsl:if>
  </xsl:template>

<!-- Write essid to csv and "cloaked" if "cloacked" attribute is true -->
  <xsl:template match="essid">
    <xsl:if test="@cloaked='true'">
    <xsl:text>cloaked</xsl:text>
   </xsl:if>
    <xsl:value-of select="text()"/>
    <xsl:text>,</xsl:text>
  </xsl:template>

<!-- Write BSSID to csv and create a new line -->
  <xsl:template match="BSSID">
    <xsl:value-of select="text()"/>
    <xsl:text>
</xsl:text>
  </xsl:template>

<!-- Ignore everything else -->
  <xsl:template match="text()">
  </xsl:template>

</xsl:stylesheet>

OpenWrt package (atheros) of MJPG-streamer including web demo

Backfire packaged version of the MJPG-streamer do not include the web demo: https://dev.openwrt.org/ticket/6499
Here is a packaged built for atheros that include the patch submitted to the ticket: http://hk.airpost.net/openwrt/mjpg-streamer_r94-1_6499diff_atheros.ipk

To install it:

cd /tmp
wget http://hk.airpost.net/openwrt/mjpg-streamer_r94-1_6499diff_atheros.ipk opkg update
opkg install mjp-streamer

Opkg will fetch the dependencies from the regular OpenWrt repository. See my previous post to get what is needed to stream with your webcam on OpenWrt.

Webcam streaming with openwrt backfire

Unlike OpenWrt kamikaze 8.09.2, newest release backfire 10.03 needs the following packages to get a UVC webcam to stream on the web:

# opkg install kmod-usb2 kmod-video-uvc kmod-i2c-core kmod-input-core mjpg-streamer

Start the demon with:

# /etc/init.d/mjpg-streamer start

Stream will be available at: http://ipaddress:8080/?action=stream

Note that an hotplug script was created in /etc/hotplug.d/usb and that the mjpg_streamer will start as soon as the webcam is connected.

Config is in: /etc/config/mjpg-streamer

Keep Resolution upon reboot when using NVIDIA binary driver

Recent versions of gnome – at least the one shipped with Ubuntu 9.10 and 10.04 – use resolution settings specific for each user. The resolution is set in /home/username/.config/monitors.xml which is loaded upon login.

The tool provided along with NVIDIA driver changes your resolution in /etc/X11/xorg.conf but not in monitors.xml as gnome’s “Monitors” tool does. As a consequence you need to edit /home/username/.config/monitors.xml manually:

<monitors version="1">
 <configuration>
 <clone>no</clone>
 <output name="default">
 <vendor>???</vendor>
 <product>0x0000</product>
 <serial>0x00000000</serial>
 <width>1920</width>
 <height>1080</height>
 <rate>0</rate>
 <x>0</x>
 <y>0</y>
 <rotation>normal</rotation>
 <reflect_x>no</reflect_x>
 <reflect_y>no</reflect_y>
 <primary>no</primary>
 </output>
 </configuration>
</monitors>

Mediawiki: Only registered users with email confirmed can edit

This use case implies that visitors can only see content of the wiki. Registered users, with confirmed email address, can create content. A moderator group with extended rights is created. The moderator group is called ninja; you can easly tweak its rights.

Based on mediawiki 1.15.1 default $wgGroupPermissions array. You need to add the following to your LocalSettings.php:

// Get user in emailconfirmed group when loading email confirmation link
$wgAutopromote = array(
‘emailconfirmed’ => APCOND_EMAILCONFIRMED,
);

$wgGroupPermissions = array();

// Group for all visitors
$wgGroupPermissions['*']['createaccount'] = true;
$wgGroupPermissions['*']['read'] = true;
$wgGroupPermissions['*']['edit'] = false;
$wgGroupPermissions['*']['createpage'] = false;
$wgGroupPermissions['*']['createtalk'] = false;
$wgGroupPermissions['*']['writeapi'] = false;

// Group for all logged-in accounts
$wgGroupPermissions['user']['move'] = false;
$wgGroupPermissions['user']['move-subpages'] = false;
$wgGroupPermissions['user']['move-rootuserpages'] = false; // can move root userpages
$wgGroupPermissions['user']['movefile'] = false; // Disabled for now due to possible bugs and security concerns
$wgGroupPermissions['user']['read'] = true;
$wgGroupPermissions['user']['edit'] = false;
$wgGroupPermissions['user']['createpage'] = false;
$wgGroupPermissions['user']['createtalk'] = false;
$wgGroupPermissions['user']['writeapi'] = false;
$wgGroupPermissions['user']['upload'] = false;
$wgGroupPermissions['user']['reupload'] = false;
$wgGroupPermissions['user']['reupload-shared'] = false;
$wgGroupPermissions['user']['minoredit'] = false;
$wgGroupPermissions['user']['purge'] = true; // can use ?action=purge without clicking “ok”

// Implicit group for accounts that pass $wgAutoConfirmAge
$wgGroupPermissions['autoconfirmed']['autoconfirmed'] = true;

// Group for accounts with confirmed email addresses
// Users have to register and confirm email to edit
$wgGroupPermissions['emailconfirmed']['move'] = true;
$wgGroupPermissions['emailconfirmed']['move-subpages'] = true;
$wgGroupPermissions['emailconfirmed']['move-rootuserpages'] = true; // can move root emailconfirmedpages
$wgGroupPermissions['emailconfirmed']['movefile'] = false; // Disabled for now due to possible bugs and security concerns
$wgGroupPermissions['emailconfirmed']['read'] = true;
$wgGroupPermissions['emailconfirmed']['edit'] = true;
$wgGroupPermissions['emailconfirmed']['createpage'] = true;
$wgGroupPermissions['emailconfirmed']['createtalk'] = true;
$wgGroupPermissions['emailconfirmed']['writeapi'] = false;
$wgGroupPermissions['emailconfirmed']['upload'] = true;
$wgGroupPermissions['emailconfirmed']['reupload'] = true;
$wgGroupPermissions['emailconfirmed']['reupload-shared'] = true;
$wgGroupPermissions['emailconfirmed']['minoredit'] = true;
$wgGroupPermissions['emailconfirmed']['purge'] = true; // can use ?action=purge without clicking “ok”

// Group for moderator accounts
$wgGroupPermissions['ninja']['ninja'] = true;
$wgGroupPermissions['ninja']['block'] = true;
$wgGroupPermissions['ninja']['delete'] = true;
$wgGroupPermissions['ninja']['editprotected'] = true; // can edit all protected pages without cascade protection enabled

// Users with bot privilege can have their edits hidden
// from various log pages by default
$wgGroupPermissions['bot']['bot'] = true;
$wgGroupPermissions['bot']['autoconfirmed'] = true;
$wgGroupPermissions['bot']['nominornewtalk'] = true;
$wgGroupPermissions['bot']['autopatrol'] = true;
$wgGroupPermissions['bot']['suppressredirect'] = true;
$wgGroupPermissions['bot']['apihighlimits'] = true;
$wgGroupPermissions['bot']['writeapi'] = true;
$wgGroupPermissions['bot']['editprotected'] = true; // can edit all protected pages without cascade protection enabled

// Most extra permission abilities go to this group
$wgGroupPermissions['sysop']['block'] = true;
$wgGroupPermissions['sysop']['createaccount'] = true;
$wgGroupPermissions['sysop']['delete'] = true;
$wgGroupPermissions['sysop']['bigdelete'] = true; // can be separately configured for pages with > $wgDeleteRevisionsLimit revs
$wgGroupPermissions['sysop']['deletedhistory'] = true; // can view deleted history entries, but not see or restore the text
$wgGroupPermissions['sysop']['undelete'] = true;
$wgGroupPermissions['sysop']['editinterface'] = true;
$wgGroupPermissions['sysop']['editusercssjs'] = true;
$wgGroupPermissions['sysop']['import'] = true;
$wgGroupPermissions['sysop']['importupload'] = true;
$wgGroupPermissions['sysop']['move'] = true;
$wgGroupPermissions['sysop']['move-subpages'] = true;
$wgGroupPermissions['sysop']['move-rootuserpages'] = true;
$wgGroupPermissions['sysop']['patrol'] = true;
$wgGroupPermissions['sysop']['autopatrol'] = true;
$wgGroupPermissions['sysop']['protect'] = true;
$wgGroupPermissions['sysop']['proxyunbannable'] = true;
$wgGroupPermissions['sysop']['rollback'] = true;
$wgGroupPermissions['sysop']['trackback'] = true;
$wgGroupPermissions['sysop']['upload'] = true;
$wgGroupPermissions['sysop']['reupload'] = true;
$wgGroupPermissions['sysop']['reupload-shared'] = true;
$wgGroupPermissions['sysop']['unwatchedpages'] = true;
$wgGroupPermissions['sysop']['autoconfirmed'] = true;
$wgGroupPermissions['sysop']['upload_by_url'] = true;
$wgGroupPermissions['sysop']['ipblock-exempt'] = true;
$wgGroupPermissions['sysop']['blockemail'] = true;
$wgGroupPermissions['sysop']['markbotedits'] = true;
$wgGroupPermissions['sysop']['apihighlimits'] = true;
$wgGroupPermissions['sysop']['browsearchive'] = true;
$wgGroupPermissions['sysop']['noratelimit'] = true;
$wgGroupPermissions['sysop']['movefile'] = true;
#$wgGroupPermissions['sysop']['mergehistory']     = true;

// Permission to change users’ group assignments
$wgGroupPermissions['bureaucrat']['userrights'] = true;
$wgGroupPermissions['bureaucrat']['noratelimit'] = true;

debif v01: debian for the bifferboard

Here is debif v01 a debian lenny rootfs and a kernel image compiled for the bifferboard. It is an early stage beta, please report problems and suggestions to bifferboard’s mailing list.

Instructions:

  1. Find kernel binary in /boot of the rootfs or in  kenel package and upload it to the bifferboard.
  2. Format a USB drive in ext3 and untar the rootfs to the drive.
  3. Boot the bifferboard conected to your home network. It will get DHCP lease from your router.
  4. ssh root@ipofthebifferboard (password is ‘password’)

Then you have fully functional debian box. Included additional packages are mainly ntpdate and ssh (server and client), but you can install what ever you need from debian repositories using apt-get!

Get NowPlaying Screelets to work with Rhythmbox

The version of NowPlaying in the package of Screenlets from Ubuntu jaunty 9.04: 0.1.2-ubuntu2 doesn’t work with Rhythmbox.

Julien Lavergne provided a fix which isn’t yet available in the Ubuntu main repository but you can download a fixed version of the package from his PPA: 0.1.2-6~ppa6. Checkout this doc from launchpad to add a PPA and its key to your Ubuntu repositories.

BTW: NowPlayingScreenlet theme pack ships some really nice skins – Vinyl especially – to be untar in: /usr/share/screenlets/NowPlaying/themes

Get your Screenlets to display on all desktops

In Ubuntu jaunty 9.04 that’s not the default behaviour. So install all the wanted widgets then right click on them and in Window select the following:

Sticky
Widget
Keep below

If as soon as you select the Widget settings the widget disappear it means that the Widget layer plugin is activated in your compiz fusion options. Inactivate this option in CompizConfig Settings Manager.
 
The goal of the widget layer is to have the widgets displayed on top of all your windows when pressing a special key – F9 is the default key.

Get sound playing and recording to work in Skype

I installed Skype in Ubuntu jaunty 9.04 from medibuntu repository, which have a packaged version available. With default settings no sound could be played nor recorded.

Work around:

in skype’s options -> Sound Devices set the following:

Sound In: hw0
Sound out: pulse
Ringing: pulse

Correct $HOME/.dmrc permissions

Something modified the permissions of my $HOME/.dmrc file. Consequently an annoying error shows up at login:

User’s $HOME/.dmrc file is being ignored. This prevents the default language and session from being saved. File should be owned by user and have 644 permissions. User $HOME directory must be owned by user and not writeable by other users.

to fix the permissions:

$ sudo chown -R $USERNAME: $HOME
$ chmod 755 $HOME
$ chmod 644 $HOME/.dmrc

Follow

Get every new post delivered to your Inbox.