Tools to set up a usb sniffer on a beagleboard xM
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
helper-scripts
patches
sdcard
README.md

README.md

bb_usb_sniffer

Tools to set up a usb sniffer on a beagleboard xM.
This is based on the work of Nicolas Boichat.

Sources

http://elinux.org/BeagleBoard/GSoC/2010_Projects/USBSniffer
http://downloads.angstrom-distribution.org/demo/beagleboard/
http://beagleboard.org/linux

Set up the sniffer quickly

cd ~  
wget http://gimx.fr/download/bb_sniffer_small.img.7z  
7zr e bb_sniffer_small.img.7z  
sudo dd if=bb_sniffer_small.img of=/dev/sdX  

(where X is the device letter of the sd card, e.g. /dev/sdc, /dev/sdd...)
Before removing the sd card, make sure to run sync.

Sniff!

Read the instructions at http://elinux.org/BeagleBoard/GSoC/2010_Projects/USBSniffer#Usage_instructions.
Note that you don't need a USB hub for low/full speed devices if you use a beagleboard xM, because there's one on the board.

Set up the sniffer from scratch

  1. Clone this git repo

    cd ~
    git clone git://github.com/matlo/bb_usb_sniffer.git
    
  2. Format the sd card

    cd ~/bb_usb_sniffer/sdcard
    sudo sh mkcard.txt /dev/sdX
    sudo mkdir -p /media/bb/boot /media/bb/Angstrom
    sudo mount /dev/sdX1 /media/bb/boot
    sudo mount /dev/sdX2 /media/bb/Angstrom
    

(where X is the device letter of the sd card e.g. /dev/sdc, /dev/sdd...)
3. Install the bootloader:

```
cd ~/bb_usb_sniffer/sdcard
wget http://downloads.angstrom-distribution.org/demo/beagleboard/MLO
wget http://downloads.angstrom-distribution.org/demo/beagleboard/u-boot.img
wget https://raw.github.com/matlo/bb_usb_sniffer/master/sdcard/uEnv.txt
sudo cp MLO u-boot.img uEnv.txt /media/bb/boot
```
  1. Copy the rootfs:

    cd ~/bb_usb_sniffer
    wget http://downloads.angstrom-distribution.org/demo/beagleboard/Angstrom-Beagleboard-demo-image-glibc-ipk-2011.1-beagleboard.rootfs.tar.bz2
    sudo tar xjvf Angstrom-Beagleboard-demo-image-glibc-ipk-2011.1-beagleboard.rootfs.tar.bz2 -C /media/bb/Angstrom
    
  2. Get a toolchain:

    mkdir ~/bb_usb_sniffer/tools
    cd ~/bb_usb_sniffer/tools
    wget http://www.angstrom-distribution.org/toolchains/angstrom-2011.03-x86_64-linux-armv7a-linux-gnueabi-toolchain.tar.bz2
    sudo tar xjvf angstrom-2011.03-x86_64-linux-armv7a-linux-gnueabi-toolchain.tar.bz2 -C /
    
  3. Compile the kernel:

    cd ~/bb_usb_sniffer
    git clone https://github.com/matlo/beagleboard-usbsniffer-kernel.git
    cd beagleboard-usbsniffer-kernel
    patch -p1 < ../patches/xmc.patch
    sudo apt-get install u-boot-tools
    make ARCH=arm CROSS_COMPILE=/usr/local/angstrom/arm/bin/arm-angstrom-linux-gnueabi- uImage
    sudo cp arch/arm/boot/uImage /media/bb/Angstrom/boot/uImage
    
  4. Compile and install the modules:

    cd ~/bb_usb_sniffer/beagleboard-usbsniffer-kernel
    make ARCH=arm CROSS_COMPILE=/usr/local/angstrom/arm/bin/arm-angstrom-linux-gnueabi- modules
    sudo make ARCH=arm INSTALL_MOD_PATH=/media/bb/Angstrom modules_install
    
  5. Copy libpcap and tcpdump packages:

    cd ~/bb_usb_sniffer
    wget http://feeds.angstrom-distribution.org/feeds/2011.03/ipk/glibc/armv7a/base/tcpdump_4.1.1-r1.5_armv7a.ipk
    wget http://feeds.angstrom-distribution.org/feeds/2011.03/ipk/glibc/armv7a/base/libpcap_1.1.1-r1.6_armv7a.ipk
    sudo cp tcpdump_4.1.1-r1.5_armv7a.ipk libpcap_1.1.1-r1.6_armv7a.ipk /media/bb/Angstrom/home/root
    
  6. Copy the helper-scripts:

    sudo cp ~/bb_usb_sniffer/helper-scripts/* /media/bb/Angstrom/home/root
    
  7. Final steps:

  • Before removing the sdcard, make sure to run sync.

  • Boot angstrom and login as root.

  • Run depmod -a on the beagleboard for the kernel to find the modules.

  • Install libpcap and tcpdump:

    opkg install libpcap_1.1.1-r1.6_armv7a.ipk tcpdump_4.1.1-r1.5_armv7a.ipk
    rm libpcap_1.1.1-r1.6_armv7a.ipk tcpdump_4.1.1-r1.5_armv7a.ipk