I’m back and building Kali 1.1.10 for my raspberry Pi-2 with the kernel from the latest raspbian image at the time of writing, which is 2015-02-16-raspbian-wheezy.img. The video below shows the actual image running, apologies for tint in the video.
The procedure is pretty much the same as per my previous post here, so if you have not read it, please read it first.
The kernel configuration was taken from the above raspbian image and is pastebin’ed here. Simply save it in the kernel configs directory within the kali-arm build system.
Update – 23/02/2015
I would also recommend modify the kernel configuration as per Step 10 here, although I did not do this in my initial build.
Now go ahead and run the rpi.sh script and go get a cup of something as you will have to wait a while..
Now that it is built and you have burned it to your sd card, a word or two about the ‘modules’ problem.
On my Pi-2, the normal raspbian image has the following modules loaded shown below
Now, if you do the same on your kali image, you will find that no modules are loaded. The upshot of this is that when you try to ‘startx’ everything will freeze. The solution to the problem is shown below:-
- mount the raspbian image,
- delete the contents of lib/modules directory on your kali image that is burned to your sd card
- copy the contents of lib/modules from raspbian image to kali image.
Mounting the raspbian is easy and is shown below:-
Now use your favourite graphical file manager to do the rest. The problem is that during the build process, the kernel was patched for wireless injection. Copying the files from the raspbian image breaks this, leaving us with a kernel not patched for injection. In order to resolve this, we patch the running kernel on the Pi-2, recompile and install the kernel.
The procedure for recompiling the kernel goes like this
sudo apt-get install linux-source sudo apt-get install bc gcc gcc-4.6 libc-bin libc-dev-bin libc6 libc6-dev linux-libc-dev make manpages-dev git clone --depth=1 https://github.com/raspberrypi/linux cd linux zcat /proc/config.gz > ~/linux/arch/arm/configs/pi_defconfig mkdir -p ../patches wget https://raw.github.com/offensive-security/kali-arm-build-scripts/master/patches/kali-wifi-injection-3.12.patch -O ../patches/mac80211.patch patch -p1 --no-backup-if-mismatch < ../patches/mac80211.patch make pi_defconfig make modules make modules install sudo cp /boot/kernel.img /boot/kernel-bup.img sudo cp arch/arm/boot/Image /boot/kernel.img
So now, we havewireless injection working.
[Optional] – Raspi-Config Package
In order to add the raspi-config package to overclock etc. Simply watch the video and down load the deb packages and install in the correct order.
From the command line, it goes something like this, but I just downloaded them using my browser on the Pi-2.
dpkg -i triggerhappy_0.3.4-2_armhf.deb
dpkg -i lua5.1_5.1.5-4+deb7u1_armhf.deb
dpkg -i raspi-config_20150131-1_all.deb