How to Build a Hacking Station with Raspberry Pi and Kali Linux

Build Hacking Station With Raspberry Pi Kali Linux

In this article we’ll be using Raspberry Pi and Kali Linux to build a powerful, portable hacking station that you can use to simulate cyberattacks against your smart devices. 

By approaching your smart home exactly like a hacker would, you can identify security vulnerabilities and exploits that they might use to gain access to your system – and then close these loopholes before anyone has a chance to exploit them. 

Use your powers responsibly 

By the end of this tutorial, you’ll have created a network testing machine that you can potentially use to hack into any smart device or network. However, you should only use your Raspberry Pi hacking station to access networks that you own or at the very least have permission to access – for example, if a friend or colleague asks you to security test their network.

Trying to gain unauthorized access to a protected network or smart device is always morally questionable and is often illegal. 

What you’ll need

To complete this tutorial, you’ll need:

  • A Raspberry Pi
  • An SD card that’s compatible with your model of Raspberry Pi – for example, a Micro SD card
  • A keyboard and a way to attach this keyboard to your Raspberry Pi
  • A monitor and a way to attach this monitor to your Raspberry Pi
  • An HDMI cable
  • Access to a laptop or Desktop computer that you’ll use to download Kali Linux

Once you have these tools, you’re ready to build your hacking station.

Install Kali Linux on Raspberry Pi

Kali Linux is a distribution of Linux that’s specifically designed for penetration testing, which is where you evaluate the security of a network, device or system by simulating a cyberattack. 

To start, we need to flash a Kali Linux system image to our Raspberry Pi. On your laptop or computer, download the following software.

1. Head over to the Offensive Security website and download the correct Kali Linux image for your model of Raspberry Pi. You’ll need a way to write Kali Linux to your SD card. I’m using the latest version of Etcher, as it’s free, open source and cross-platform.

2. Insert the SD card into your laptop or computer. 

3. Launch the Etcher application. 

4. In Etcher, click “Select image,” and then select the Kali Linux image that you just downloaded.

Etcher Select System Image

5. Click “Select target,” and then select your SD card. Etcher will now flash the Linux system image to your SD card, which may take a while.

6. Once Etcher has finished flashing your image, remove the SD card and insert it into your Raspberry Pi.

7. Attach your monitor to the Raspberry Pi using an HDMI cable.

8. Attach your keyboard to the Raspberry Pi device.

9. Plug the Raspberry Pi into a power source. Raspberry Pi should now boot automatically.

Raspberry Pi Flash Kali Linux

10. When prompted, log in using the default username of “root” and the default password “toor.” 

Install Kali Linux Raspberry Pi

11. Once you’re successfully logged in to Kali Linux, click the Wi-Fi symbol in the toolbar and connect to your network. 

You now have a Raspberry Pi that’s running Kali Linux, and you’re ready to begin testing your smart devices and home automation network.

Security test any smart device or network

You can perform many different security tests with Kali Linux, but as an example, I’m going to:

  • Scan a device on the network to see which ports are open and active and can therefore receive a connection. 
  • Attempt to gain access to this device using passwords that are publicly available online. 

Scanning for open ports with nmap

To start, I’m going to scan one of my smart devices using nmap:

1. Select the Kali logo.

2. Navigate to “Vulnerability Analysis -> nmap.”

Scan Smart Home With Nmap

3. In the window that appears, type:

In my example, I’m scanning a wireless camera that I use to monitor my front door, so my command is:

The nmap tool will now scan this camera for the top 20 most important services and display a breakdown of all identified ports. 

Hacking Station With Kali Linux

In the above screenshot, we have three open connections. 

For the purposes of this tutorial, I’m going to concentrate on port 22 SSH. If we manage to acquire a username and password for this device, then we can use SSH to remotely connect to the camera and execute commands. 

At this point, the camera is still fully protected against the theoretical hacker, so how might hackers try to gain access to this device?

Download publicly available passwords 

In this step we’re going to try and identify the camera’s login details using a wordlist, which is a list of passwords that are publicly available online. 

I’m going to use the wordlist that’s provided by Kali Linux: 

1. In the Kali Linux toolbar, give the “Terminal” icon a click.

2. In the Terminal, type the following command:

Press the Enter key. This command will provide a list of all the Kali packages and may take a few minutes to complete.

3. Once the previous command has finished running, you can install the password list using the following command:

The list of publicly-known passwords will now be downloaded to your Raspberry Pi.

Cracking passwords with Hydra

Now we can run Hydra, which is an application that tries to identify a device or network’s password, by attacking it with many different passwords in rapid succession: 

1. In the toolbar, select the “Kali Linux” icon.

2. Navigate to “Password attacks -> Online attacks -> Hydra.”

Hydra Password Cracking Tool

3. In the window that appears, enter the following command: 

4. Hydra will now attempt to access my security camera using all of the passwords provided by the wordlist. 

After a few minutes, Hydra should display its results. 

Testing Smart Home Camera Security Linux

As you can see in the above screenshot, my camera has a root password that’s publicly known.

By simulating a cyberattack, I’ve identified a huge security vulnerability in my home automation system that third parties could have used to access my camera. If you find a similar vulnerability in your own network, then it’s vital that you change your password to something more secure and consider changing every other device, app or account where you also use this publicly-known password. 

Conclusion 

In this tutorial, we saw how a malicious third party might launch an attack against your home network. By simulating cyberattacks in a controlled environment, you can identify potential security vulnerabilities before an attacker does.

This is just the beginning – now that your Kali Linux hacking station is up and running, you’ll have access to lots of additional tools and features that you can use to test your smart devices and home automation network.

Have you made any interesting discoveries with your hacking station? Let us know in the comments below! 

3 comments

  1. User ans password no longer valid with the new version of Kali

    1. Hi – Kali Linux are in the process of changing how their images work. You can find a good overview of the various usernames and passwords here : https://www.kali.org/docs/introduction/default-credentials/. If the “root/toor” method isn’t working for your version of Kali Linux, then you should be asked to create your own username and password when booting for the first time. If you ever see a message that you don’t have the rights to run a particular command, then you can elevate your privileges using “sudo.” I hope that helps!

  2. I think the article would be a lot more useful if it talked about using Kali to try gaining unauthorized access to my WiFi (ISP provided). We all know “security cameras” from China are not secure — that is why I run mine on a “private” network behind my ISP provided firewall. Finding out just how good these router firewalls really are would motivate me to try Kali, trying to find unsecured devices from China is a waste of effort as they pretty much all are.

Leave a Comment

Yeah! You've decided to leave a comment. That's fantastic! Check out our comment policy here. Let's have a personal and meaningful conversation.