Setting Up Kali Linux on Raspberry Pi: A Comprehensive Guide
May 28, 2024

Kali Linux Raspberry Pi is an ideal combination for cybersecurity professionals seeking a portable, low-cost, and powerful solution. Kali Linux is a Debian-based Linux distribution designed for digital forensics and penetration testing.Developed by Offensive Security, Kali Linux is widely used by security professionals and ethical hackers for various security tasks.
With its rich toolset and portability, Kali Linux on Raspberry Pi has become a popular choice for beginners and professionals in the cybersecurity field. Kali Linux on Raspberry Pi is a powerful combination for those interested in cybersecurity, offering a portable and cost-effective platform for penetration testing and security research.
Key Features of Kali Linux on Raspberry Pi
Portable Penetration Testing Platform
The Raspberry Pi is small, lightweight, and easy to carry, making it an excellent portable device for on-the-go security assessments. Combined with Kali Linux, it becomes a powerful portable hacking device suitable for fieldwork and real-time testing
Comprehensive Security Toolset
Kali Linux on Rasperry Pi comes pre-installed with hundreds of penetration testing and security tools, including Nmap, Metasploit, Wireshark, Aircrack-ng, Burp Suite, and many more.
Customizability and Flexibility
Users can install additional tools and customize their Kali Linux on Raspberry Pi setup according to their specific needs and preferences.
Cost-Effective Solution
Running Kali Linux on Raspberry Pi is significantly cheaper than using a full-sized laptop or desktop, making it accessible to a wider audience.
Community and Documentation
Kali Linux has a strong community and extensive documentation, providing support and resources for both beginners and experienced users.
Support for Various Raspberry Pi Models
Kali Linux supports multiple models of the Raspberry Pi, including the Raspberry Pi 2, 3, 4, 5, and Zero W, although the performance will vary depending on the model used.
Optimized Performance
The Kali Linux ARM images are optimized for performance on the Raspberry Pi, ensuring smooth operation of the security tools. This setup is especially well-suited for Raspberry Pi penetration testing, providing a portable and efficient environment for real-world scenarios.
Uses Cases with Kali Linux on Raspberry Pi
- Network Scanning and Security Auditing: Tools like Nmap and Wireshark can be used to scan and analyze networks for vulnerabilities. A Network scanning Raspberry Pi setup allows users to perform effective audits with a compact and cost-efficient device.
- Wireless Network Testing: Tools such as the Aircrack-ng suite allow you to test the security of Wi-Fi networks. This makes Wireless testing Raspberry Pi setups a practical option for auditing wireless environments in the field.
- Password Cracking: Tools like John the Ripper and Hashcat can be used for password recovery and cracking.
- Vulnerability Exploitation: The Metasploit Framework allows users to exploit known vulnerabilities in systems and applications.
- Digital Forensics: Kali Linux includes tools for forensic analysis of digital devices and data recovery.
- Learning and Education: Ideal for students and professionals to learn about cybersecurity and practice their skills in a controlled environment.
Requeriments
- Raspberry Pi: Raspberry Pi 5 for better performance.
- Power Supply: A reliable power source for the Raspberry Pi.
- Network Connectivity: Ethernet and Wi-Fi USB second adapter por Wireless Scanning.
- MicroSD Card: Preferably a high-speed card (32GB or more).
Installation Kali Linux on Raspberry Pi
Step-by-step
- Download and install Raspberry Pi Imager from the Raspberry Pi official website to a computer with an SD card reader..Put the SD card that you will use with your Raspberry Pi into the reader and launch Raspberry Pi Imager. For detailed setup instructions, refer to our Get started with Raspberry Pi guide.
- Select the Raspberry Pi Device.

3.Select the Operation System. We can found Kali Linux for Raspberry Pi in Choose the OS: Other general-purpose


4.Power Up the Raspberry Pi. Turn on the Raspberry Pi. It will boot directly into the Kali Linux OS
Login with default username is kali and the password is kali. IMPORTANT: Change this password. Open terminal an run:
passwd
Open terminal an run:(If you’re new to the command line, check out how to use the terminal on Raspberry Pi.)

1.Install Additional Tools: Kali Linux comes pre-installed with many security tools, but you can install more as needed. These Kali Linux tools can be tailored to suit various cybersecurity tasks, from password cracking to wireless analysis.
sudo apt install <tool-name>
example: sudo apt install -y kali-tools-passwords
Start using the included tools such as Nmap, Metasploit, Wireshark, etc.

Kali Linux on Raspberry Pi comes pre-installed with hundreds of penetration testing and security tools, which pair well with SunFounder Raspberry Pi kits for hands-on cybersecurity learning,and functionalities, tailored to different use cases. When deploying Kali Linux on Raspberry Pi, we can leverage these metapackages to customize your setup according to your specific needs.
kali-linux-default: It covers a wide range of penetration testing tools, including information gathering, vulnerability analysis, and exploitation tools.
kali-linux-top10: Top 10 tools recommended with essential tools.
kali-linux-all: All suite of tools
kali-linux-wireless: specifically used for wireless network analysis and penetration testing
kali-linux-forensic: Designed for digital forensics and incident response, including tools for data recovery, analysis, and forensics. For example, you can explore digital forensics with Raspberry Pi using tools like Foremost for file recovery tasks.
kali-linux-web: Tools commonly used for web application security testing
kali-linux-sdr: For tasks such as signal analysis and capturing radio frequencies
kali-tools-information-gathering: Focused on tools used for information gathering, useful for initial stages of penetration testing and reconnaissance
kali-tools-passwords: Tools for password attacks, including brute-force attacks and password recovery
Example Packet Analayzer MQTT protocol
To set up a packet analyzer for the MQTT protocol on Kali Linux on Raspberry Pi,you can use tools like Wireshark on Raspberry Pi or tcpdump.
1. Install Wireshark
sudo apt install -y wireshark
First, make sure the system is up to date and install Wireshark:
During the installation, we might be prompted to allow non-superusers to capture packets. Choose 'Yes' to enable this.

1.Start Capturing Packets
To capture packets with Wireshark, we’ll need to have network traffic passing through your network interface. If you’re capturing traffic from a specific MQTT broker or device, ensure they are communicating over the network. You can follow this Wireshark packet capture setup guide for step-by-step instructions..
wireshark &
Start Wireshark from the terminal or by finding it in the application menu:

2.Select the Network Interface
Choose the appropriate network interface from the list (e.g., `eth0` for wired Ethernet, `wlan0` for Wi-Fi).

3.Apply a Capture Filter (optional)
You can use capture filters to limit the data captured. For MQTT traffic, which typically uses TCP port 1883, you can use the following filter:
tcp port 1883

4.Analyze MQTT Packets
Once you start capturing, you’ll see a stream of packets. To analyze MQTT packets

5.Apply a Display Filter:
Use Wireshark’s display filter to focus on MQTT traffic:
mqtt
This filter will display only MQTT protocol packets.
6.Inspect Packets:

Click on individual packets to inspect their details. You can see the MQTT packet structure, including the fixed header, variable header, and payload.
Connect Packet: Sent by a client to establish a connection to an MQTT broker.
Publish Packet: Contains the actual message content sent from a client to the broker.
Subscribe Packet: Used by clients to subscribe to topics.
Unsubscribe Packet: Used by clients to unsubscribe from topics.
Ping Request/Response: Keeps the connection alive.
Disconnect Packet: Sent by a client to disconnect gracefully from the broker.
Conclusion
Kali Linux Raspberry Pi, this combination is suitable for network scanning, wireless testing, password cracking, vulnerability exploitation, digital forensics, and cybersecurity education. By setting up Kali Linux on a Raspberry Pi, users gain a versatile and powerful tool for both professional security tasks and educational purposes. This makes it an excellent choice when using a Raspberry Pi for ethical hacking, combining accessibility with advanced capabilities.
Kali Linux has a strong community and extensive documentation, providing support and resources for both beginners and experienced users.