[HowTo] Install Metasploit (and other usefull stuff) under archlinuxarm on your Android device

A thread on XDA-Devs by user flashdrv [1] catched my attention on this topic. I read through the there mentioned blog entry from Lance R. Vick [2] and looked at the stuff on archlinux.org [3]. This was something that I wanted. So let’s start getting it up:

– On your linux workstation (or bootable cd) download the Archlinuxarm disk image for exynos (= my galaxy note 10.1, or for other cpus see here: http://archlinuxarm.org/platforms) here: http://archlinuxarm.org/os/ArchLinuxARM-odroidx-latest.img.gz

– Other platforms might have a TAR file instead of a full disk image. In this case skip a few steps an d head over to lrvick’s guide below.

– install (#sudo apt-get install kpartx) and use kpartx like follows:

#kpartx ArchLinuxARM-odroidx-latest.img
loop0p1 : 0 8191 /dev/loop0 1
loop0p2 : 0 106496 /dev/loop0 8192
loop0p3 : 0 6291456 /dev/loop0 114688

#kpartx -a -v ArchLinuxARM-odroidx-latest.img
add map loop0p1 (253:0): 0 8191 linear /dev/loop0 1
add map loop0p2 (253:1): 0 106496 linear /dev/loop0 8192
add map loop0p3 (253:2): 0 6291456 linear /dev/loop0 114688

#mkdir /mnt/archlinuxarm
#mount /dev/mapper/loop0p3 /mnt/archlinuxarm
#cd /mnt/archlinuxarm
#tar czf archlinux.tgz ./*

– copy and extract the resulting tgz to your device (folder /data/local/arch)

#cd /data/local/arch
#tar xzf archlinux.tgz

– now follow the excellent guide at http://lrvick.net/blog/arch_linux_terminals_in_android/

– after everthing is up and running do the following to get metasploit installed (you have to already be in archlinuxarm chroot)
– pulling the msf svn will take some hours so relax and take a nap or do something else

#pacman -S ruby
#pacman -S zlib
#pacman -S uniconvertor
#pacman -S svn
#cd /opt
#svn co https://www.metasploit.com/svn/framework3/trunk/ msf3
#cd msf3/
#./msfconsole

– you’re done if you can see the msfconsole running
– go and install additional packages like
– nmap (#pacman -S nmap)
– kismet (#pacman -S kismet)
– aircrack-ng (#pacman -S aircrack-ng)
– ettercap (#pacman -S ettercap)
– etc. (you can search for packages here: http://archlinuxarm.org/packages)

– If you get a problem that your user cannot access network stuff see [4]

– If you want DB support in metasploit you can it like follows:
– Install some needed stuff

#pacman -S postgresql
#pacman -S gcc
#pacman -S make
#gem install pg

– This will allow you to set up the db and use it in Metasploit (google for the setup procedure)

References:
[1] http://forum.xda-developers.com/showthread.php?t=2015812
[2] http://lrvick.net/blog/arch_linux_terminals_in_android/
[3] http://archlinuxarm.org/
[4] https://blog.tuinslak.org/socket-permission-denied