Wednesday, June 28, 2023

How to Install Kali Linux on Raspberry Pi (And Why Do It?)

Can you install Kali Linux on Raspberry Pi and use it for ethical hacking and penetration testing? Kali Linux is a powerful hacking and penetration toolset used by security industry professionals worldwide, and the Raspberry Pi is a low-cost, single-board computer with many uses. Can it be done, and what are the benefits of doing it?

This article will investigate whether Kali Linux can be installed on a Raspberry Pi, what you will need to prepare for installation and use, and why you might want to do it in the first place.

By the conclusion of this article, you will understand the benefits and drawbacks of running Kali Linux on a Raspberry Pi and what can be achieved by doing it.

What Is a Raspberry Pi?

The Raspberry Pi Foundation started by Eben Upton from Cambridge, UK, as a community project in 2012 to produce a $10 single-board computer to enable children to learn to code and be creative with technology. The device was inspired by the single-box 8-bit computers of the 1980’s. It is designed to be easy to use and accessible to all. The standard operating system comes pre-installed with Python, and many projects use this language to great effect.

Raspberry Pi 4 Model B
Raspberry Pi 4 Model B

Since its introduction, a huge community of developers, hobbyists, and educators have produced an impressive array of applications, hardware, and creative uses for the device. These applications include web filtering, light show controllers, and vehicle entertainment systems. Some examples of the amazing things people do with Raspberry Pi are on the All3DP website.

The development of an extensive list of hardware add-ons, such as cameras and LED screens, has placed the Raspberry Pi as the go-to single-board computer for many uses.

There is an interesting TED Talk by Philip Colligan, the Chief Executive of the Raspberry Pi Foundation, explaining how the Raspberry Pi project was started. He talks about how the project was inspired by wanting to give children access to low-cost technology to enhance their learning and creativity. From the evidence in the talk, it has been a huge success. You can watch below.

Several versions of the Raspberry Pi are available, ranging from the microcontroller Pico series for $4, through the Pi Zero, to the personal computer-style Pi 400 based on the Pi 4. The most powerful version is the Pi 4 Model B. The specs vary, but for such a small package, they can pack a punch and offer good performance for the roles they are designed for.

From its inception, the Raspberry Pi has used a version of Debian Linux called Raspbian as its default operating system. The device uses an ARM processor, so the standard x86 builds of Linux will not work. However, several distributions are available that work well, from the basic needs of a general OS to specific applications like Kali Linux, produced by Offsec.

Kali Linux Logo

The operating system is installed onto an SD memory card that can easily be removed and replaced with another. Many Raspberry Pi users have multiple memory cards for different purposes and swap between them when needed. Because the SD card is the main storage, the faster the card, the better the performance.

Why Would You Want to Run Kali Linux on a Raspberry Pi? 

Traditionally Kali would be installed on a laptop and usually as a VM for ease of recovery from crashes, but this has the drawback of needing the laptop to be in place to use the Kali tools. Buying another laptop and dedicating it to Kali Linux is possible, but this will prove costly.

Using a low-cost Raspberry Pi can enable Kali to be used on a dedicated machine, freeing up your laptop. The Raspberry Pi can be left on-site if required for longer-term projects, such as packet capturing, man-in-the-middle attacks, remote-access persistence, and WiFi attacks.

The limitation of using a Raspberry Pi for Kali is the relatively low power of the device. Even though they offer impressive performance for their size, even the highest spec model can’t match a laptop with reasonable specs.

Due to Kali Linux having some stability issues when running some tools, corruption of the operating system can occur. As Kali is running on the bare-metal SD card, such corruption will render it unusable as you can’t roll it back. However, if multiple memory cards are flashed with Kali Linux, the card can be swapped should this occur.

Requirements

There are several hardware devices and tools that are needed to get Kali installed on a Raspberry Pi. It is not difficult, and all of the software is free. The only costs are the hardware, and everything you need is listed below

SD Card Micro SD, at least 16 GB, Class 10 recommended
SD Card Reader A USB adaptor is recommended if your computer does not contain an SD card slot.
Raspberry Pi Model Compatibility Pi 2, 3, 4, and 400 (32-bit)Pi 2 (v1.2), 3, 4, and 400 (64-bit)Pi 1 (Original)Pi Zero WPi Zero 2 W
Power Supply (USB-C or Micro-USB depending on Raspberry Pi model) Varies depending on the Pi model - 12.5W to 15W, 5.1V, 700mA - 3A.
USB Keyboard Any USB keyboard will work.
USB Mouse A standard USB mouse is all that is required.
Computer for Creating Bootable Media Windows, Mac, or Linux with a USB card reader
Software Required for Imaging Bootable USB creator software such as:
Windows: Rufus
Mac: Balena Etcher
Linux: UNetbootin

Your Raspberry Pi

A Raspberry Pi 4 Model B with 2Gb RAM was used for testing the feasibility of using Kali Linux on a Raspberry Pi. Another option that was tested was the Raspberry Pi 400, but the ethernet network card was not detected on the first boot meaning only wireless connectivity was available. One benefit of the Pi 400 is that it does not require an external keyboard as it is a self-contained unit, but it might require more configuration to work reliably.

Raspberry Pi 4 Model B
Raspberry Pi 4 Model B

The Raspberry Pi 400 and Pi 4 Model B have good connectivity as standard. Both come with two HDMI connectors, an ethernet port, and an SD card slot for the operating system media. Whereas the Pi 400 has 3 USB ports, two USB 3, and one USB 2, The Pi 4 model B has one extra USB 2 port. The Model B also has a headphone socket for external audio.

The Pi 4 Model B has a choice of RAM from 1Gb to 8Gb, whereas the Pi 400 has 4Gb of RAM that is not upgradeable. Wireless connectivity is built into both models, making connectivity possible without a wired network. A wired connection is recommended for use with Kali Linux due to its stability and speed.

Both models also come with a 40 PN GPIO header for attaching external peripherals, but the details are irrelevant to this article.

There are other models of Raspberry Pi available, from the tiny, IOT-like micro-controller Raspberry Pi Pico (not compatible with Kali Linux), through the Raspberry Pi Zero, to the Raspbery Pi 400 mentioned above.

The less powerful devices may have performance issues when running Kali Linux although they can be used for very specific applications, such as covert hacking tools, where power is not a priority. Details of the full range are available on the Raspberry Pi website, where specs can be compared.

Downloading Kali

The Kali Linux download page has options for various platforms. It is important to download the ARM image from the Kali website as it has been created to work with ARM processors and will work on the Raspberry Pi. Clicking on this will give you several options relating to the different Raspberry Pi models.

Kali Download ARM

There are 32-bit and 64-bit options that are functionally identical, but be sure to use a 64-bit image if you have a Raspberry Pi with more than 4Gb RAM as the 32-bit operating system will not be able to use memory above 4Gb.

Kali ARM Options

The ARM versions of Kali are identical to the standard version with the same toolset. However, there have been reports of certain tools experiencing problems and reliability issues when running Kali Linux on a Raspberry Pi, but these are rare.

Installing Kali Linux on a Raspberry Pi is straightforward as long as you have the right components.

First, download the Kali ARM image from the Kali Website onto your computer to create the bootable media. The image is around 2.3 GB, which will easily fit onto the recommended 16 GB SD card.

The micro-SD card will need to be mounted onto this computer, and an adapter will most likely be needed to allow the small card to be compatible with the standard SD card slot.

Raspberry Pi Hardware Flash SD
SD Card Reader and Adaptor

The operating system you are using will dictate the bootable media creator you will use. They all work in a similar way where you choose the image to create the bootable media, which will be the one you just downloaded from the Kali website, and point it at the SD card mounted on your computer.

Balena Etcher Flash

This process can take around 15 minutes, and once it is complete, eject the device safely and slot the micro-sd card into the Raspberry Pi’s sd card slot.

Flash SD Kali Raspberry Pi

You will also need to attach a keyboard and a mouse at his point. Connect the power to the Raspberry Pi, and it should automatically turn on and go through the boot process.

Kali on Raspberry Pi

Once Kali is booted, using the operating system is exactly the same as on any other device, so you should feel at home instantly.

Last Steps

If a wireless connection is required, then it is a simple process. Click on the network icon in the top right of the screen, select available networks, and type in the password when prompted for the network you want to connect to.

Kali Wireless Connection

Once a network connection is established, the best practice is to update Kali to ensure the latest patches and versions of the apps are installed. This is a simple process of typing in two commands:

sudo apt update && sudo apt upgrade -y

Running the upgrade can take quite a long time as there are hundreds of packages to install on the Kali build. It is important to perform these steps as vulnerabilities and stability issues are regularly patched. Regularly updating and upgrading your Kali Linux installation is also good practice to ensure compatibility and bug fixes are applied.

Conclusion

Kali Linux works well on Raspberry Pi hardware and is a very useful tool. There are, however, some caveats.

Some compatibility issues have been discovered with Raspberry Pi hardware, and it has been reported that some applications don’t work properly out of the box. These issues will be solvable with a bit of work, but one of the benefits of Kali Linux is that it should work without any configuration as soon as the boot media or VM is prepared.

Although performance is acceptable for running standard penetration testing and ethical hacking tasks, applications that require intensive processor use and lots of memory might run slower. For example, brute-force password cracking can take a long time, even on hardware with good specifications, so activities like this might not be the best use of a Raspberry Pi.

We advise experimenting with Kali Linux on a Raspberry Pi and finding a use that compliments the way you work. Get creative and see what uses you can find for this adaptable device.

The Raspberry Pi could be perfect for some specific uses. This might be enabling you to free up your laptop and leave the device attached to a network for a long time, use the device for long-term monitoring and analysis, or do quick jobs where using a high-powered machine is overkill.

As with the creative ways that enthusiasts have used the Raspberry Pi for various projects, there are many ways it can adapt to penetration testing and ethical hacking with Kali Linux.

Frequently Asked Questions

Can Raspberry Pi Zero run Kali Linux?

It is possible to run Kali Linux on a Raspberry Pi Zero, although it is not recommended for general penetration testing use due to the low power of the device. Instead, they can be used as targeted wireless hacking devices with the advantages of being low-cost and easy to conceal due to their size.

Can Raspberry Pi run full Kali Linux?

The Kali Linux images available for the Raspberry Pi are the full version of the operating system.

Is Kali Linux on Raspberry Pi 32 or 64-bit?

32-bit and 64-bit images for the Raspberry Pi of Kali Linux are available. Be sure to use a 64-bit image if your Raspberry Pi has more than 4Gb RAM.



from StationX https://bit.ly/3CQjtvX
via IFTTT

No comments:

Post a Comment