Exercise 3, Chapter 4 - Kali Linux standard ARM Install
- If you have a Raspberry Pi or similar device, grab a copy of the appropriate ARM image from here. Burn it to an SD card and try it out.
There's a chicken-and-egg problem here. To keep things standardized, we would rather have you perform all of these steps in Kali. That way, you have all the tools you need, and we can walk you through it without explaining the process on multiple OS's (Windows, OS X and Linux). But in order to do this from Kali, we need to get the image over to Kali and the most reliable and straightforward way to do this is with scp which relies on the ssh service. But we don't touch on SSH until the next chapter.
So although it's not ideal, we'll shoehorn in the SSH procedure here so we can move along and we will discuss the details more in the next chapter. From your Kali installation:
Edit the /etc/ssh/sshd_config file. Find the line PermitRootLogin without-password and change it to Set PermitrootLogin yes.
Start sshd:
1 |
root@kali:~# systemctl start ssh |
Enable sshd at boot:
1 |
root@kali:~# systemctl enable ssh |
Now, you should be able to ssh into your machine as root/toor:
1 2 3 4 5 6 7 8 9 10 11 |
Host Machine:~ j$ ssh root@192.168.1.12 root@192.168.1.12's password: The programs included with the Kali GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Kali GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. Last login: Wed Mar 1 21:43:37 2017 from 192.168.1.71 root@kali:~# |
Now we can move the xz file into our Kali VM. Try to avoid VM drag-and-drop. It can be problematic:
1 |
scp kali-2017.01-rpi2.img.xz root@192.168.60.185:/root |
Next, insert your (minimum 8GB) SD card and find the proper disk ID:
1 2 3 4 5 6 7 8 |
root@kali:~# dmesg [194628.402969] sd 3:0:0:0: Attached scsi generic sg2 type 0 [194628.410035] sd 3:0:0:0: [sdb] 15564800 512-byte logical blocks: (7.97 GB/7.42 GiB) [194628.410821] sd 3:0:0:0: [sdb] Write Protect is off [194628.410823] sd 3:0:0:0: [sdb] Mode Sense: 03 00 00 00 [194628.411936] sd 3:0:0:0: [sdb] No Caching mode page found [194628.411940] sd 3:0:0:0: [sdb] Assuming drive cache: write through [194628.420751] sdb: sdb1 |
Uncompress the xz file:
1 2 |
root@kali:~# cd /root root@kali:~# unxz kali-2017.01-rpi2.img.xz |
(Alternatively, check out xzcat).
Run the dd with the correct disk identifier (/dev/sdb in our case). Warning! Get this right! Do not simply copy these values, change them to the correct drive path corresponding to your SD card.
1 2 3 4 |
root@kali:~# dd if=/root/kali-2017.01-rpi2.img of=/dev/sdb bs=1M 7000+0 records in 7000+0 records out 7340032000 bytes (7.3 GB, 6.8 GiB) copied, 1356.87 s, 5.4 MB/s |
Slap in your SD and boot up your new Kali Pi. You'll ned to hook up HDMI to see what's going on, and a USB keyboard and mouse to type and click. Any you'll have to plug in an Ethernet cable to get network (it's DHCP). Oh, and there's no SSH listening by default. And if you do manage to get in, you're pretty much at bare metal. ifconfig doesn't even work! Yes, this is a little lame. Don't you wish you had more control over things? Read on.