Pi Projects – Flashing Kali Linux

Estimated difficulty: ๐Ÿ’š๐Ÿ’š๐Ÿ’š

Welcome to my first blog post for Securiteenies! We’ve created a difficulty rating based on a 3 heart system. Since the summer holidays have kicked off, we’d like to help you learn some fun skills over your lock-down break.

This post was inspired by a question asking us how to install and troubleshoot Kali Linux on a Raspberry Pi, and since I recently did this myself, I thought it would be great to share the knowledge and help you get started on your cybersecurity journey.

What is a Raspberry Pi?

Contrary to popular belief a Raspberry Pi does not look like the below:

Blueberry Raspberry Lattice Pie Recipe - BettyCrocker.com
Source: bettycrocker.com (Raspberry and blueberry pie)

Instead a Raspberry Pi looks more like this!

A Raspberry Pi is just a mini computer – a bit like your laptop or iPad, but a lot smaller in size. Throughout this post when I refer to a Raspberry Pi, I will be talking about the latest Raspberry Pi 4. There are other Raspberry Pi products with different components and features which are useful for different tasks. The only limits to what you can do are your imagination and the physical components of the Pi!

Base image source: raspberrypi.org

As you might be able to tell from the picture, the Raspberry Pi has some similar features to a laptop – like USB ports, HDMI ports, a power point, and so on – but one main difference is that it has a micro SD (Secure Digital) card slot instead of a hard drive (like a SSD – Solid State Drive). The micro SD card uses flash memory, which can be overwritten electronically with software. Overall, a Raspberry Pi is a smaller version of your computer with a little bit less processing power. The newer versions are improving on that though, and soon you’ll be able to use it as a cheaper version of a desktop or laptop.

Choosing your operating system

In most cases, the Raspberry Pi comes with an micro SD card pre-installed with NOOBS or Raspbian (now called Raspberry Pi OS). Just because the Raspberry Pi comes with this Operating System (OS) installed does not mean you are not able to change it – in fact, most laptops can have their operating systems changed, as long as the new OS is compatible with the hardware. Here is a list of some of the operating systems you can install on a Raspberry Pi:

  • Ubuntu
  • Retro Pi
  • LibreElec
  • Kali Linux
  • And so many more!

Flashing your operating system

Before we get into this section, let’s find out what flashing actually means. You might hear the term “flashing an operating system onto the micro SD card” in this post a lot and this can be confusing! However, this just means that we are re-writing the flash memory of the micro SD card. Flash memory is a type of memory that can be easily re-written electronically. To help you remember, you can think of it as re-writing the memory in a flash, as it doesn’t take long to over-write the original contents of the micro SD card.

Once you have decided which operating system you would like to play around with, you can flash the operating system using the Raspberry Pi Imager, built by the Raspberry Pi Foundation!

Raspberry Pi Imager Software

Some of the operating systems listed in the above section can be found included within the Raspberry Pi Imager software.

Raspberry Pi operating systems included with the Imager.

If the operating system is not included within the software then you should be able to download a custom image (basically a version of an OS). Please note: Before installing any software from the Internet, you must make sure you trust the website you are downloading it from. If you aren’t sure you can trust the website, don’t click the links provided! Sometimes clicking on untrusted links causes unwanted or malicious software to download and be installed on your computer.

Step 1 – Getting what we need

To make this project possible, we will need a few things. These things are:

A Raspberry Pi – mine is the Raspberry Pi 4 with 4GB of RAM.

A 32GB micro SD Card. Pick one that is compatible with your Raspberry Pi.

A micro SD flash memory card reader – I use a T-Flash reader.

A Raspberry Pi power supply.

A keyboard.

A mouse (not the squeaky, pet kind). ๐Ÿ˜

A monitor (or two!)

A HDMI – MicroHDMI cable compatible with the Pi 4.


Step 2 – Download the Kali Linux Image

Once you have collected everything you need, it’s time to download the Kali Linux operating system image that you need.

You can install it by clicking the Kali download link below:

Kali Download

The Kali Linux operating system image is hosted on the Offensive Security website. We want to download the ARM image created for the Raspberry Pi foundation as the Raspberry Pi has an ARM processor. If we were to download an image that was created for an alternative processor such as AMD or Intel, then the software being flashed onto the micro SD Card wouldn’t load properly when starting the Raspberry Pi. We also need to make sure we are downloading the 64bit image rather than the 32bit image to make sure all the software can run properly on it.

To make sure you are downloading the right file, there is a SHA256Sum or checksum of the file.

This is a string of letters and numbers that uniquely identify the file, kind of like a fingerprint. When you download it, the SHA256Sum of the file should match the one listed on the website. It’s important that they match – if this checksum is different then the file has changed in some way and this could mean that the file hasn’t downloaded properly or that it’s been edited. To check the SHA256Sum of the Kali Linux operating system, you can download the file and then use PowerShell commands to see the checksum. Bash commands can also be used if you are using a Linux operating system or alternative command line such as using the “sha256sum” tool.

File Checksum on Windows

As you might be able to see in the picture, my download checksum matches the one of the file listed on the website. If this wasn’t a match then I would know the file had been modified in some way and could be corrupt.

Step 3 – Download the Raspberry Pi Imager Software

Next up we want to install the Raspberry Pi imager software. You can download this software from the Imager Download link below:

Imager Download

You can choose the right Imager software for your computer.

For example, my laptop is a Windows laptop, so I would download the Raspberry Pi Imager for Windows.

Open the downloaded file to begin the install.

If you are using Windows, a pop up will show up asking if you want the software to make changes to your hard drive. You will want to click “Yes” so the installation can start.

Click install to begin.

To complete the installation, make sure the tick box has been checked and then press finish.


Step 4 – Flash the micro SD Card

To flash the micro SD card, you will want to insert the micro SD card into the micro SD flash memory card reader and plug the reader into your laptop.

Plug the reader into your laptop or computer and open up the Raspberry Pi Imager software. From here you should be able to choose your micro SD card.

Next, you will need to choose the Operating System (OS).

Select “Use custom” and choose the image you downloaded earlier. Mine is “kali-linux-2020.2b-rpi3-nexmon.img.xz” – this was the original name of the file from the download.

When you are happy with everything then you can go ahead and click “WRITE“! This will over write anything on the micro SD card so please make sure you back anything up before you do this!

Once you have kicked off the “WRITE” process this will take quite a while to flash. For me, it takes just over 40 minutes. This all depends on the hardware you are using or software you are flashing. Once it prompts you as complete, you will be able to remove the micro SD flash memory card reader and put the micro SD card into the Raspberry Pi.

Step 5 – Test

Since you have a Raspberry Pi with a ready to go micro SD card inserted into it, you will need to make sure everything else is plugged in.

You will need to plug in the mouse and keyboard to the USB 2.0 ports.

Connect the HDMI cable to the Raspberry Pi and the larger end of the cable should be plugged into the back of your monitor.

Plug the power supply into the Raspberry Pi. Once you are happy everything is plugged in, turn it on!

With everything on you should be able to watch the Raspberry Pi boot up and then you should be prompted with a login page. The login details are:

Username – kali
Password – kali

Once you have entered the credentials you are in! You can connect the Raspberry Pi to the internet via Wi-Fi, or you can connect it with an Ethernet cable. Most of all, you can now enjoy playing around with the tools built into the Kali Linux operating system.

Tick List

In case you don’t want to read the step-by-step guide and would like to figure it out for yourself, I have created an easy to follow, tick list to help you flash Kali Linux onto your own Pi! It just summarises each step listed in the blog post.

StepsTick Box
Gather what you need. This will include your Raspberry Pi and any other hardware components.
Download the Kali Linux operating system for your Raspberry Pi version.
Download the Raspberry Pi Imager software, so you can flash the Kali Linux operating system image onto the micro SD Card for your Raspberry Pi.
Flash the operating system onto your Raspberry Pi.
Plug all the hardware components into your Raspberry Pi.
Turn on your Raspberry Pi and monitor and watch the operating system boot up!
Login to the Kali Linux operating system with:
Username – kali
Password – kali
These credentials are for the latest version of the Kali Linux operating system.
Have fun!

Once you have completed each item on the list you should have a ready to go Raspberry Pi with Kali Linux installed! Kali Linux is a penetration testing operating system that comes installed with a whole bunch of penetration testing tools. Some posts already talk about how to use some of these tools, so make sure to check them out here:

Remember these tutorials linked above are more complex and come with more risk when using them. Ask a responsible adult or fellow techie the best legal way to use these tools.

If you get stuck at any point, don’t hesitate to comment on this post asking any questions.

Sarah <3

2 Comments

  1. Great post! I love the little GIFs, a lot of work must have gone into making them! Keep up the great work ๐Ÿ™‚

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.