PDA

View Full Version : Kali on Raspberry Pi 2



Chipi
2015-02-10, 19:49
Hi, I got the new Raspberry Pi 2 and I'm trying to run Kali but I tried with armel, armhf and Raspberry Pi Image but no one is working.
Anyone achieved to run it? Is needed a new Kali Linux custom image for RPi2?
Thanks.

g0tmi1k
2015-02-12, 09:06
Support will be coming soon.


Edit:
DOWNLOAD
The official pre-build Kali Linux 1.1.0 Raspberry Pi 2 image is out!


You asked, we built. A @Raspberry_Pi 2 Kali Linux image now available for download. https://www.offensive-security.com/kali-linux-vmware-arm-image-download/

Source: https://twitter.com/offsectraining/status/573519489549144064

mame82
2015-02-12, 18:24
https://cyberkryption.wordpress.com/2015/02/09/kali-linux-on-a-raspberry-pi-2/

These instructions worked for me, but I still have problems with freezing startx.

Another fix should be to replace the boot partition content of the kali pi image with the firmware from a working rasping image.

mame82
2015-02-13, 14:24
X Server works, fix:
Solution 1) copy /lib/modules from rasping to kali sd
Solution 2) create a softlink on the kali sd from "/lib/modules/3.18.7-v7" to "/lib/modules/3.18.6-v7+" and reboot to get evdev loaded

Chipi
2015-02-13, 21:28
I achieved it replacing the boot partition, thanks, but I have the same problem than you, after startx it freezes, any idea to solve it?
I tried updating the firmware and Kali but there's no results :S

mame82
2015-02-13, 22:38
Yes, you have to copy the modules of a raspian image to /lib/modules for this kernel version. Thus the evdev module (responsible for loading device drivers for x) could be loaded after a reboot. Check if evdev is loaded with lsmod

Amidamaru
2015-02-14, 07:52
Hi, I got the new Raspberry Pi 2 and I'm trying to run Kali but I tried with armel, armhf and Raspberry Pi Image but no one is working.
Anyone achieved to run it? Is needed a new Kali Linux custom image for RPi2?
Thanks.

+1 regarding this issue too. Got tried today and had the same problem. Waiting for your updates :)...

Ram0n
2015-02-14, 10:13
Working Kali 3.18.7 on RPi2:

Follow instructions on https://cyberkryption.wordpress.com/2015/02/09/kali-linux-on-a-raspberry-pi-2/.

Change line 33 of kernel config found on pastebin before executing rpi.sh from
CONFIG_LOCALVERSION="-v7" to CONFIG_LOCALVERSION="-v7+"

Chipi
2015-02-14, 13:27
Yes, you have to copy the modules of a raspian image to /lib/modules for this kernel version. Thus the evdev module (responsible for loading device drivers for x) could be loaded after a reboot. Check if evdev is loaded with lsmod

Thanks, it works!! ;D

gogzun
2015-02-20, 12:35
Working Kali 3.18.7 on RPi2:

Follow instructions on https://cyberkryption.wordpress.com/2015/02/09/kali-linux-on-a-raspberry-pi-2/.

Change line 33 of kernel config found on pastebin before executing rpi.sh from
CONFIG_LOCALVERSION="-v7" to CONFIG_LOCALVERSION="-v7+"

Hi after trying this instructions, i dd img file to my SD card, and after that I cannot mount this card to modify /lib/modules - uknown partition its not accessible
Any ideas?

crookie
2015-02-20, 13:01
Is there any update on support for the latest Raspberry Pi 2? The current Kali image available for Pi doesn't boot!

itfellover
2015-02-21, 11:29
I managed to get Kali installed and booting on the Pi without X freezing after building from Git. It only took 19 steps! A big thank you to mame82 & Ram0n in this thread who's comments pointed me in the right direction of getting a fully functional Kali build :-)

Step 1:

Create a directory to work out of and navigate into it
472

Step 2:

git clone https://github.com/offensive-security/gcc-arm-linux-gnueabihf-4.7 to pull down for the “armhf” image creation
473

Step 3:

Check your working directory with “pwd” and then ls to check the gcc-arm directory is there and use this information to export the path
474

Step 4:

Export the path with /root/Kali-Git being the working directory and gcc-arm-linux-gnueabihf-4.7/bin being the directory and bin directory contained within that you just cloned from git
475

Step 5:

Clone the kali-arm-build-scripts from github
476

itfellover
2015-02-21, 11:33
Step 6:

Now as the Pi has a different architecture you need to modify the rpi.sh script in the cloned repository with the editor of your choice
477

Step 7:

Modifying two separate locations as outlined in the below image
478

Step 8:

I also choose to comment out the last few lines at the end in order to be able to troubleshoot and not compress or build a shasum as you can see below and make sure to save it
479

Step 9:

Copy the following pastebin script from here and create a new file in the kernel directory or alternatively run wget http://pastebin.com/download.php?i=Rv3zpsiv -O rpi-3.1.8.config from the terminal to do this for you and download it straight to the directory ready to edit.
480

Step 10:

Paste the above pastebin content into the new file, save it and then modify the following line so that we can copy the Raspbian boot directory over afterwards as this is also required in order to make things run smoothly and get rid of X freezing. CONFIG_LOCALVERSION=”-v7″ to CONFIG_LOCALVERSION=”-v7+” you only need to add a + to the end.
481

itfellover
2015-02-21, 11:44
Step 11:

Fix any local dependencies you may require by running the following script
482

Output of the above script should finish like the following with no errors
483

Step 12:

Now modify the rpi.sh script for the kernel changes to be picked up and change the kernel number to match the file that you just created
484

Step 13:

The output should initiate as below when the rpi.sh script is run with the version number of your choice and be patient as depending on your internet connection this can take some time to complete
485

When finished it should look something like this
486

itfellover
2015-02-21, 11:49
Step 14:

Check the directory and your image are there
487

Step 15:

Now it is time to burn your image to disc with dd
488

Step 16:

I booted up at this stage and I was getting the freeze that was talked about once Kali is installed.

Step 17:

I then copied the boot loader partition from the Raspbian image over and replaced the files that had been installed on the Kali Pi image just created.

Step 18:

Create a folder in the Kali Pi /lib/ directory on the main partition called modules
489

Step 19: Copy the directory “3.18.5-v7+” from the Raspbian image over to the Kali Pi /lib/modules/ directory.
490

Result: Kali Pi is booting up and X is also working and I have to say it is extremely fast! The first Pi was so slow compared to this and I only ever used it via SSH and used the terminal. I don’t think I can use the old one any longer now after this, I might re-purpose it as something but from now all focus is on the RPi 2! One added piece of information to note is that you need to run "apt-get update && apt-get upgrade" if you want to see all the tools available in the GUI as they do not appear until you do that. Otherwise it is very speedy over SSH if you forward X :-)

cyberkryption
2015-02-21, 13:09
I have just updated my origional tutorial for the 1.1.10 release with startx freeze solved and wireless injection.

https://cyberkryption.wordpress.com/2015/02/21/kali-1-1-10-on-a-raspberry-pi-2/

Cyberkryption

spurrenirre
2015-02-21, 17:06
I couldn't get this working. Does anyone mind sending me their .IMG so I can try it?

spurrenirre
2015-02-22, 16:34
After some research I found user mpeppels at Raspberry Pi forums who shared his .IMG that works but has some errors in it:
http://www.raspberrypi.org/forums/viewtopic.php?f=28&t=99619&p=697518
The IMG is there and you can run it on your raspberry pi 2, the only problem is that the Keyboard and mouse stops working after logging in with "root:toor" (which means that the keyboard works while logging in. The startx command does also work) so if anyone knows a fix for this reply please :)

Hdeo1235
2015-02-22, 23:22
Is there any video for this? I'm getting abit confused

velix
2015-02-23, 11:33
I followed step by step all the istructions posted by itfellover and kali just boot fine.
The only problem is that kali only sees 118Mb of ram and can't use all the 1Gb.
Is there any suggestion for solving the problem?

itfellover
2015-02-23, 23:35
Hey all I have just updated the previous screenshots and added some additional steps for clarity hopefully, you can have a look here (https://itfellover.com/1-kali-from-git-clone-and-booting-in-19-steps/)

@ velix I am not sure what the problem is there unfortunately, I will check tomorrow.

Cyberkryption seems to have things working fully though, I have to look into recompiling the kernel after work tomorrow.

tazdevil
2015-02-24, 21:43
does it matter if this is done in a VM or on another linux box? or does it have be completed on a pi 2 running Raspbian?

kernel compiling is something new for me... itching to get this started...

cyrus104
2015-02-24, 21:44
cyberkryption, thanks for the update. Super easy to follow along and do. Hopefully a new kali config comes out but until then yours is working great.

itfellover
2015-02-24, 23:39
I needed to run "apt-get update --fix-missing" on the failed install last night when running through Cyberkryptions process for compiling the kernel during the initial apt-get portion of the install. The steps on his blog are working but will take some time to compile, so patience is key here. I have updated the steps on my blog post also to show the steps involved and where it currently is sitting for me at the make modules step.

Nearly there though only the following to go!

make modules install
sudo cp /boot/kernel.img /boot/kernel-bup.img
sudo cp arch/arm/boot/Image /boot/kernel.img

@velix your issue may be due to the image on your SD card not using the full amount of space available, you can start gparted in kali in the terminal by typing "gparted &" without the quotes and following the steps in the guide here (http://elinux.org/RPi_Resize_Flash_Partitions) just google "raspbian resize partition" for more info. I have yet to make my own partition bigger.

If you run vmstat -s -S M | egrep 'mem|swap' what output are you seeing for your memory?

TehJibba
2015-02-25, 05:24
So after several diff guides ive compiled several versions and so far no go. So i wanted to try cyberkryption's way, the only thing im confused about is the kernel recompile. what dir am i doing this inside of? Am i recomiling the kernel inside the /lib/modules folder on the sd card?

itfellover
2015-02-25, 10:35
@TehJibba, check out Step 20 revisited here (https://itfellover.com/category/kali-raspberry-pi-2/) and see if it makes sense.

1) SSH into your Pi with ssh root@kali_pi_ipaddress

Then manually go through the following as you may have an error along the way:

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 (Go do something else while this is working away as it takes a long time)
make modules install
sudo cp /boot/kernel.img /boot/kernel-bup.img
sudo cp arch/arm/boot/Image /boot/kernel.img

@tazdevil, I carried out my work in a VirtualBox VM, the only bit I had to do externally was when using dd as this was causing issues so YMMV here too. I just ran dd on a physical linux box.

As for the Kernel compile this is done on the Raspberry Pi itself.

spurrenirre
2015-02-25, 16:27
I can't connect to the internet with my Alfa network card, everything just starts to freeze I can't move anything when I'm obtaining the IP adress. Does anyone know why this happens? The Kali runs really good and everything works except the wireless connection.

chaoticflanagan
2015-02-25, 23:45
@TehJibba, check out Step 20 revisited here (https://itfellover.com/category/kali-raspberry-pi-2/) and see if it makes sense.

1) SSH into your Pi with ssh root@kali_pi_ipaddress

Then manually go through the following as you may have an error along the way:

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 (Go do something else while this is working away as it takes a long time)
make modules install
sudo cp /boot/kernel.img /boot/kernel-bup.img
sudo cp arch/arm/boot/Image /boot/kernel.img

@tazdevil, I carried out my work in a VirtualBox VM, the only bit I had to do externally was when using dd as this was causing issues so YMMV here too. I just ran dd on a physical linux box.

As for the Kernel compile this is done on the Raspberry Pi itself.

Thanks for the steps. As i'm going through it, I run into issues with "make pi_defconfig". I receive a "*** can't find default configuration "arch/arm/configs/pi_deconfigs"!" Any thoughts? (faily new to linux, so i'm not really sure what i'm looking at)

yzf
2015-02-26, 07:31
Thank you for the Great Tutorial, my problem, i can't get it work cause of "pixz"-archive

My Problem, i get error's when i execute the ./build-deps.sh
I get the Fault that i don't have "pixz" installed, and i can't install it.

It's just an archiver/compressor (https://github.com/vasi/pixz)

I got BackTrack 5.1 running on my Computer, and need just a solution to get the "pixz" archive installed.


and to my second Error...
When i execute the ./rpi.sh , it tells me that the kali-armhf directory isn't found (i change it like in the tutorial from armel to armhf...)


Does anybody know a solution for me...
(sorry for my english... ;) )



(btw.. with which Distro you did it... ???)


EDIT: Update...
i don't need the pixz-archiver, in the rpi.sh it tells me:


242 # If you're building an image for yourself, comment all of this out, as you
243 # don't need the sha1sum or to compress the image, since you will be testing it
244 # soon.
245 echo "Generating sha1sum for kali-$1-rpi.img"
246 sha1sum kali-$1-rpi.img > ${basedir}/kali-$1-rpi.img.sha1sum
247 # Don't pixz on 32bit, there isn't enough memory to compress the images.
248 MACHINE_TYPE=`uname -m`
249 if [ ${MACHINE_TYPE} == 'x86_64' ]; then
250 echo "Compressing kali-$1-rpi.img"
251 pixz ${basedir}/kali-$1-rpi.img ${basedir}/kali-$1-rpi.img.xz
252 rm ${basedir}/kali-$1-rpi.img
253 echo "Generating sha1sum for kali-$1-rpi.img.xz"
254 sha1sum kali-$1-rpi.img.xz > ${basedir}/kali-$1-rpi.img.xz.sha1sum


So i won't need pixz..

i hope it will work this evening.

gogzun
2015-02-26, 15:20
Have someone tried to run this process on Kali VM?

cyrus104
2015-02-27, 16:19
Cyberkryption, while I was trying to get a custom program compiled I was getting compile crashes. I noticed that when I ran the free command it showed no swap file. After running the commands below and rebooting I now have no problem with compiling.

sudo nano /etc/dphys-swapfile
sudo dphys-swapfile setup
sudo dphys-swapfile swapon

ArchieT
2015-02-28, 12:55
Yes, but how do i do that? How, or with what kind of program can i get access to the .img file of raspbian? And where do i have to copy the files after doing that?

Myagy
2015-03-05, 16:39
Any ETA on the official Kali image for Raspberry Pi 2?

g0tmi1k
2015-03-05, 17:47
The official pre-build Kali Linux 1.1.0 Raspberry Pi 2 image is out!


You asked, we built. A @Raspberry_Pi 2 Kali Linux image now available for download. https://www.offensive-security.com/kali-linux-vmware-arm-image-download/

Source: https://twitter.com/offsectraining/status/573519489549144064

Myagy
2015-03-05, 20:44
I just downloaded the official image for rpi2, "burned" it using Win32DiskImager, but it doesn't seem to boot. Noobs is working, so the rpi2 seems to be OK (hardware wise).

Anyone else had this problem?
Any hints to make it boot?

yhfudev
2015-03-05, 23:56
for those who are struggling the froze X window, I have a working kali image that solve the problem without coping the old debian kernel modules.
I didn't test further because of time issue. I build yesterday and if you want build you own, you may want to take a look at https://github.com/yhfudev/arch-kali-rpi2.git

Nephilim
2015-03-06, 15:26
Hi everybody,

I'm still quite new to all the ARM devices, so please bear with me if my question seems to be stupid. I've got several Raspberry Pis, with version 2 being my latest device. I didn't want to play around and patch files and copy files from the Debian release to the Pi Image, etc. So I waited for an official Pi2 Image. I was very happy when I found it yesterday and installed it instantly. Then I noticed that only very few tools were installed. I think it was the TOP 10 Release. I'm trying to get a Kali on my Pi that's as complete as possible, so I took a look at the Meta Packages and used something like "apt-get update && apt-get install kali-linux-all". It seemd to work and took quite a while to download, configure and install. When I tried Metasploit afterwards, I received an error message that rake 10.4.2 or something like that was missing, and metasploit terminated. I tried to upgrade rake and ruby, but already had the newest versions. So I did another "apt-get install metasploit", and after that Metasploit worked without any problems. However, other tools like Burp Suite don't seem to work. When I start it, it takes a while with nothing happening. Then I get informed that Burp Suite opened a proxy port, and I can access a Burp Suite Free Edition Web Page with iceweasel and configure this proxy. However, there's no splash screen, and no burp suite opening. In the web browser however, I can take a look at the URL history, but that's all. Other tools won't open at all, like Maltego. In another thread I read that not all the tools were ported to ARM. Can this be the reason that several tools don't work ? Btw: The Meta Package Kali-Linux-All states to be 15 GB in size, while my root partition only was around 9 GB after executing the apt-get command. This would fit to the Kali-Full Metapackage, but I know I didn't use this one.

What can I do to get a kali linux on my Pi2 that is as complete as possible and working on its architecture ? I don't want to miss out on tools that would work like a charm, just because the original image only supports the Top 10. On the other hand I don't want to check manually which tools are working or not and install each of them manually with an apt-get-install.

Something like a maximized Image with all the tools working on the Pi's architecture would be a great thing. But maybe some of you pros out there have a suggestion how to achieve this with little effort.

Thanks a lot already and best regards,

Nephilim

itfellover
2015-03-07, 12:46
I see we have a working image available now for download which is great!

For anyone wishing to still compile your own version take a look here (https://itfellover.com/kali-linux-1-1-0-git-install-kernel-cross-compilation-with-wireless-injection-working-v2/) on my blog as I have now managed to get everything cross compiled for speed and simplicity with the rpi.sh script and wireless injection working. No more copying boot loaders etc from raspbian.

g0tmi1k
2015-03-08, 10:22
Hi everybody,
...
What can I do to get a kali linux on my Pi2 that is as complete as possible and working on its architecture ? I don't want to miss out on tools that would work like a charm, just because the original image only supports the Top 10. On the other hand I don't want to check manually which tools are working or not and install each of them manually with an apt-get-install.

...
Nephilim

Please search before posting: https://forums.kali.org/showthread.php?24663-No-tools-for-the-Raspberry-pi-armel-image

Nephilim
2015-03-08, 12:45
Uhmmm... Thanks for the reply, g0tmi1k...

Of course I had already searched everytwhere and also read the thread you mentioned. That's why I wrote "In another thread I read that not all the tools were ported to ARM."

However, I don't feel that my question was answered there. So I decided to ask in this thread. My goal is to have a Kali Linux that is as complete as possible, and of course only has working tools installed. Is there any feasible way to achieve this? Or is the current state that I can only pick a meta-package and try each tool manually and remove the ones that won't work? Or is there a list with working and not working tools? Should I rather use the kali-linux-full metapackage?

It would be great if only working tools could be installed and updated on an architecture via apt-get.

Sorry if my questions sound stupid. However, in no other thread or blog or googled page have I found an answer to these questions. If I overlooked anything, I'd be greatful for a link. Many thanks for trying to help!

scribel
2015-03-29, 12:09
Nephilim, try this:

wget http://archive.raspberrypi.org/debian/pool/main/r/raspi-config/raspi-config_20121028_all.deb
wget http://http.us.debian.org/debian/pool/main/l/lua5.1/lua5.1_5.1.5-4_armel.deb
wget http://http.us.debian.org/debian/pool/main/t/triggerhappy/triggerhappy_0.3.4-2_armel.deb
dpkg -i triggerhappy_0.3.4-2_armel.deb
dpkg -i lua5.1_5.1.5-4_armel.deb
dpkg -i raspi-config_20121028_all.deb

raspi-config

sudo apt-get update
sudo apt-get upgrade

apt-get -f install

apt-get install kali-linux-full

apt-get install gnome

apt-get remove metasploit-framework

apt-get install metasploit

sms2000
2015-06-03, 04:38
Hi
I have a few questions about running Kali on RPI2.

1. I connected the Kali to 1080p HDMI display but it uses only 1600x900 resolution. I cannot change it.
2. Also RPI2 is overclocked to 900MHz, and I need to run it stock.

Seems to me the /boot/config.txt is just ignored. How should I control Kali/RPI2 resolution, memory split and clock?

Thanks

Compguymn
2015-08-08, 11:35
Hey pi guy,
I got a pii 2 and I follow the steps for. Updating and upgrading, then.install raspi-config(raspi-config 20150131) expanee the pi and attempted to do
apt-get install kali-linux-full
It goes several hundred packagea but not all the tools install, i get only 7 tools for kali installed. Something not correct, any thoughts

michael_joe
2015-08-13, 08:48
U need to down the correct image,here is the download link:http://images.kali.org/kali-2.0-rpi2.img.xz
maybe it can help u.

frafri
2015-08-18, 18:42
Is there a guide available that I can use to properly install this tool on my Raspberry Pi 2.?

steev
2015-08-18, 19:42
U need to down the correct image,here is the download link:http://images.kali.org/kali-2.0-rpi2.img.xz
maybe it can help u.
That is the 2.0 image, the 2.0.1 image should be used now.

That said, we do not install the full suite of tools on the rpi builds because people are expected to install only what they want/need on them.

Mehran
2015-08-19, 11:38
After you install Kali on Raspberry Pi 2 , What is best way to connect it remotely ? ssh is good but i want see full Kali Desktop . what solution you offer ?

fruchttiger00x0
2015-08-20, 04:44
vncserver for example
https://forums.kali.org/showthread.php?25472-Top-Configuration-Changes-after-installing-Kali-Linux-on-Raspberry-Pi-2

gitruih
2015-08-23, 20:10
Hi all. Didn't wanted to make a new tread so I thought I could ask here. I just installed kali 2 onto my rpi 2 and as soon as I start using it it freezes and I have to reboot it manually. Any idea what's happening? I have connected only self powered usb hub (from pihut) and to it I connected my wireless keyboard/mouse also alfa awus036nha wifi adapter.

fruchttiger00x0
2015-08-24, 14:36
maybe start with checking /var/log/syslog where (at least) raspbian dumps all sys messages. then plug off some attached devices, or try other. did you just "dd" the basic image to sd card or maybe used a squashfs with berryboot?

frafri
2015-08-24, 15:27
Mine was giving me an mmc error . Could that be power supply related ? I unplugged all USB devices and it booted.
Then I proceeded to plug keyboard , alfa card, and mouse. Its working normal. BUt if I boot the Raspberry pi with all of these plugged in
it will not boot

2016-02-07, 11:28
I decided to ask in this thread (http://www.transportesdemoto.com/transportes-de-motos-a-catalu%C3%B1a.html) and the only bit I had to do externally was when using dd as this was causing issues and I tried updating the firmware too but nothing to do

steev
2016-02-08, 00:53
Entirely possible that it's power related. If the USB devices are pulling too much power at bootup it could cause it to fail.

carshiv
2016-02-08, 08:59
Wireless adapter was the reason for my situation .