Category: GNU/Linux@en

Mini AirSniff: portable access point packet sniffer

Mini AirSniff is a portable traffic analyzer and penetration testing box.

Notice:
I am not responsible for any kind of damage. You choose to follow this guide at your own risk.
This guide is made for educational purposes only.

Mini Airsniff works this way: A PC can connect via wifi to the TL-MR3020 and can surf on internet. By using software like Tcpdump all traffic can be captured.

The distribution used for performing all the operations was Debian Testing.

Hardware required:
Tp-Link TL-MR3020
USB flash drive 4Gb (the Cruzer Fit is recommended for small size)

Repartition the USB flash drive as follows:
Partition 1: Linux Swap Device
Partition 2: ext4

Insert the USB stick into the router

Download the OpenWrt image for the TP-Link MR3020 from
http://downloads.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/

Download the files:
openwrt-ar71xx-generic-tl-mr3020-v1-squashfs-factory.bin
openwrt-ar71xx-generic-tl-mr3020-v1-squashfs-sysupgrade.bin

Download airsniff.tar from this link:
http://www.hangelot.eu/immagini/airsniff.tar

You should already have an OpenWrt installed and an active ssh enabling the system password with command passwd.

connect via SSH to the system
ssh root@192.168.1.1

in OpenWrt terminal go to the tmp directory:
cd /tmp

Open a new terminal and go to the directory from where you downloaded the files

Execute this command:
rcp openwrt-ar71xx-generic-tl-mr3020-v1-squashfs-factory.bin root@192.168.1.1:/tmp/

Now flash the ROM:
mtd -r write /tmp/openwrt-ar71xx-generic-tl-mr3020-v1-squashfs-factory.bin firmware

After restart reconnect to the router using the following command:
telnet 192.168.1.1

enable ssh assigning a new password:
passwd

Now copy sysupgrade into openwrt:
rcp openwrt-ar71xx-generic-tl-mr3020-v1-squashfs-sysupgrade.bin root@192.168.1.1:/tmp/

Execute sysupgrade:
sysupgrade -v /tmp/openwrt-ar71xx-generic-tl-mr3020-v1-squashfs-sysupgrade.bin

Wait until router's reboot and then reconnect via ssh:
ssh root@192.168.1.1

Copy airsniff.tar on /usr/share
From a new terminal go to the computer's directory where the airsniff.tar file is located.
Execute this command:
rcp  airsniff.tar root@192.168.1.1:/usr/share

From OpenWrt terminal type:
cd /usr/share
tar -xf airsniff.tar

Copy the MAC ADDRESS of the wireless card in order to be able to put in the new configuration file In order to do this it is necessary to enable wifi option from the file /etc/config/wireless
vi /etc/config/wireless

 Find this line:
# REMOVE THIS LINE TO ENABLE WIFI
option disabled 1

Insert the # as shown here:
# REMOVE THIS LINE TO ENABLE WIFI
# option disabled 1

Save with :wq! and press enter.
Execute these commands:
wifi
ifconfig wlan0

Copy the mac ADDRESS in a text file.

Execute these commands:
cd /usr/share/airsniff
cp -f /etc/config/dhcp /etc/config/dhcp.orig
cp -f /etc/config/firewall /etc/config/firewall.orig
cp -f /etc/config/fstab /etc/config/fstab.orig
cp -f /etc/config/network /etc/config/network.orig
cp -f /etc/opkg.conf /etc/opkg.conf.orig
cp -f /etc/profile /etc/profile.orig
cp -f /etc/config/wireless /etc/config/wireless.orig
cp -f ./dhcp.0 /etc/config/dhcp
cp -f ./firewall.0 /etc/config/firewall
cp -f ./fstab.0 /etc/config/fstab
cp -f ./network.0 /etc/config/network
cp -f ./opkg.conf.0 /etc/opkg.conf
cp -f ./profile.0 /etc/profile
cp -f ./wireless.0 /etc/config/wireless

Edit the file /etc/config/wireless
vi /etc/config/wireless

Insert the MAC address in the line:
option macaddr 'insert your mac here'

Save with :wq! and press enter.

Check that wlan0 has an assigned IP address executing these commands:
wifi
ifconfig wlan0

Now turnoff the router, connect the ethernet cable into the LAN and turn it on.

The wifi newtork is now 192.168.20.0/24
Connect to the router in wifi mode and connect via SSH:
ssh root@192.168.20.1

Execute these commands:
cd /usr/share/airsniff
opkg update
opkg install kernel
opkg install kmod-usb-storage
opkg install kmod-fs-ext4
opkg install block-mount
mkdir /mnt/usb
/etc/init.d/fstab enable
/etc/init.d/fstab start
ls /mnt/usb

Check that the USB stick is mounted by "mount" or "df"

Execute these commands:
cd /usr/share/airsniff
ln -s /mnt/usb /opt
ln -s /etc /mnt/usb/etc
opkg update
opkg install netcat
opkg -dest usb install tar
opkg -dest usb install openssh-sftp-client
opkg -dest usb install nmap
opkg -dest usb install tcpdump
opkg -dest usb install aircrack-ng
opkg -dest usb install kismet-client
opkg -dest usb install kismet-server
opkg -dest usb install perl
opkg -dest usb install openvpn
opkg -dest usb install nbtscan
opkg -dest usb install snort
opkg -dest usb install karma
opkg -dest usb install samba36-client
opkg -dest usb install elinks
opkg -dest usb install yafc
ln -s /mnt/usb/usr/share/nmap /usr/share/nmap

Now mini AirSniff is ready for use.

Minipwner Tp-Link TL-MR3020 Guide

This is a revised and simplified version, made by me, of the guide written on minipwner.com. Thanks to minipwner.com for making the file minipwner.tar available.
This guide is written specifically for the router Tp-Link TL-MR3020

Notice:
I am not responsible for any kind of damage. You choose to follow this guide at your own risk.

The distribution used for performing all the operations was Debian 7 Testing. However, it is possible to use any distribution.

Hardware required:
Tp-Link TL-MR3020
USB flash drive 4Gb (the Cruzer Fit is recommended for small size)

Repartition the USB flash drive as follows:
Partition 1: Linux Swap Device
Partition 2: ext4

Insert the USB stick into the router

Download the OpenWrt image for the TP-Link MR3020 from
http://downloads.openwrt.org/snapshots/trunk/ar71xx/

Download the files:
openwrt-ar71xx-generic-tl-mr3020-v1-squashfs-factory.bin
openwrt-ar71xx-generic-tl-mr3020-v1-squashfs-sysupgrade.bin

Download minipwner.tar from this link:
http://www.minipwner.com/images/minipwner.tar

connect the router to a power outlet and connect the Ethernet cable to the PC.

In the browser, type the address 192.168.0.254
Username: admin
Password: admin

Go to the system tools> firmware upgrade and load the firmware:
openwrt-ar71xx-generic-tl-mr3020-v1-squashfs-factory.bin

Click on the button upgrade and the firmware will be loaded. After that the router will reboot.

Disconnect the power source and reconnect it.

The new IP address of the router will be 192.168.1.1 (the web section will no longer work)

connect via telnet to the system
telnet 192.168.1.1

Change the router's password in the OpenWrt terminal
passwd

in OpenWrt terminal go to the tmp directory:
cd /tmp

Open a new terminal and go to the directory from where you downloaded the files

Execute this command:
rcp  openwrt-ar71xx-generic-tl-mr3020-v1-squashfs-sysupgrade.bin root@192.168.1.1:/tmp/

Upgrade from OpenWrt terminal:
sysupgrade -v /tmp/openwrt-ar71xx-generic-tl-mr3020-v1-squashfs-sysupgrade.bin

After that the router will reboot.

Reconnect to the router using the following command:
ssh root@192.168.1.1

When prompted, enter the password.

Copy minipwner.tar to /usr/share.
From a new terminal go to the computer's directory where the minipwner.tar file is located.
Execute this command:
rcp  minipwner.tar root@192.168.1.1:/usr/share

From OpenWrt terminal type:
cd /usr/share
tar -xf minipwner.tar

Copy the MAC ADDRESS of the wireless card in order to be able to put in the new configuration file In order to do this it is necessary to enable wifi option from the file /etc/config/wireless
vi /etc/config/wireless

Find this line:
# REMOVE THIS LINE TO ENABLE WIFI
option disabled 1

Insert the # as shown here:
# REMOVE THIS LINE TO ENABLE WIFI
# option disabled 1

Save with :wq! and press enter.
Execute these commands:
wifi
ifconfig wlan0

Copy the mac ADDRESS in a text file (will be used several times).

Execute these commands:
cd /usr/share/minipwner
cp -f /etc/config/network /etc/config/network.orig
cp -f /etc/config/wireless /etc/config/wireless.orig
cp -f /etc/config/firewall /etc/config/firewall.orig
cp -f /etc/profile /etc/profile.orig
cp -f /etc/opkg.conf /etc/opkg.conf.orig
cp -f /etc/config/system /etc/config/system.orig
cp -f /etc/config/dhcp /etc/config/dhcp.orig
cp -f ./network.1 /etc/config/network
cp -f ./wireless.1 /etc/config/wireless
cp -f firewall.1 /etc/config/firewall


Edit the file /etc/config/wireless
vi /etc/config/wireless

Delete the old MAC ADDRESS and insert the previously copied one.

At this point it is necessary to configure the Wifi.
If your router has Open Wifi the only thing you need to do is to set the SSID of your router.
The default SSID is TOKI (Change TOKI with your SSID).

If you have a wireless network encryption (for example, WPA2 PSK), set up in this way:
Option encryption psk2+tkip
option key your_key

More info on OpenWrt Wiki

Save with :wq! and press enter.

Now restart the newtork:
/etc/init.d/network restart

Check that wlan0 has an assigned IP address.
ifconfig wlan0

If there are problems please troubleshoot.

Execute these commands:
cd /usr/share/minipwner
opkg update
opkg install kernel
opkg install kmod-usb-storage
opkg install kmod-fs-ext4
opkg install block-mount
cp -f profile.1 /etc/profile
cp -f fstab.1 /etc/config/fstab
cp -f opkg.conf.1 /etc/opkg.conf
cp -f system.1 /etc/config/system
mkdir /mnt/usb
/etc/init.d/fstab enable
/etc/init.d/fstab start
ls /mnt/usb

Check that the USB stick is mounted by "mount" or "df"

Execute these commands:
cd /usr/share/minipwner
ln -s /mnt/usb /opt
ln -s /etc /mnt/usb/etc
opkg update
opkg install netcat
opkg -dest usb install tar
opkg -dest usb install openssh-sftp-client
opkg -dest usb install nmap
opkg -dest usb install tcpdump
opkg -dest usb install aircrack-ng
opkg -dest usb install kismet-client
opkg -dest usb install kismet-server
opkg -dest usb install perl
opkg -dest usb install openvpn
opkg -dest usb install nbtscan
opkg -dest usb install snort
opkg -dest usb install karma
opkg -dest usb install samba36-client
opkg -dest usb install elinks
opkg -dest usb install yafc
cp -f /etc/config/wireless /etc/config/wireless.old
cp -f /etc/config/network /etc/config/network.old
cp -f /etc/config/dhcp /etc/config/dhcp.old
cp -f ./network.2 /etc/config/network
cp -f ./wireless.2 /etc/config/wireless
cp -f ./dhcp.2 /etc/config/dhcp
ln -s /mnt/usb/usr/share/nmap /usr/share/nmap

Edit /etc/config/wireless
vi /etc/config/wireless

Delete the old MAC address and paste the previously copied one.
Save and exit.
:wq!

Restart the router:
reboot

Minipwner is ready: Wireless access is open with SSID TOKI.
The new router IP is now 192.168.50.1

If you want to install additional packages in the USB, type:
opkg -dest usb install (packagename)
example:
opkg -dest usb install elinks

If there are problems in the libraries, in most cases they can be resolved with a symlink like this:
ln -s /mnt/usb/usr/share/nmap /usr/share/nmap

minipwner.com forum is very useful for resolving any kinds of problems.

How to install teamviewer on Debian 7 testing Amd64 (wheezy)

To install Teamviewer on Debian 7 Testing md64 it is necessary to activate the multiarch.

To activate the Multiarch, the following command must be executed:
# dpkg --add-architecture i386

and then execute this command:
# apt-get update

Then proceed to Teamviewer installation:
# dpkg -i teamviewer_linux_x64.deb

In case “dpkg” complains about missing dependencies, complete the installation by executing following command:
# apt-get -f install

Info on multiarch support can be found here:

http://www.debian.org/News/2011/20110726b.en.html

Solved bb ascii art demo aalib no sound

To run BB with sound it is necessary to install this package:

# apt-get install alsa-oss

and then run the program with this command:

$ aoss bb