How To Set Up a Headless Raspberry Pi Hacking Platform Running Kali Linux

The Raspberry Pi is a credit card-sized computer that can crack Wi-Fi, clone key cards, break into laptops, and even clone an existing Wi-Fi network to trick users into connecting to the Pi instead. It can jam Wi-Fi for blocks, track cell phones, listen in on police scanners, broadcast an FM radio signal, and apparently even fly a goddamn missile into a helicopter.The key to this power is a massive community of developers and builders who contribute thousands of builds for the Kali Linux and Raspberry Pi platforms. For less than a tank of gas, a Raspberry Pi 3 buys you a low-cost, flexible cyberweapon.

A cyberweapon that fits anywhere? Name something else in your pocket that creates a fake AP 

Of course, it’s important to compartmentalize your hacking and avoid using systems that uniquely identify you, like customized hardware. Not everyone has access to a supercomputer or gaming tower, but fortunately one is not needed to have a solid Kali Linux platform.

With over 10 million units sold, the Raspberry Pi can be purchased in cash by anyone with $35 to spare. This makes it more difficult to determine who is behind an attack launched from a Raspberry Pi, as it could just as likely be a state-sponsored attack flying under the radar or a hyperactive teenager in high school coding class.

Thinking Like an Attacker

The Raspberry Pi has several unique characteristics that make it a powerful and easily accessible tool in a penetration tester’s kit. In particular, the Pi is cheap and the components cost as little as a Lego set. Also, the Raspberry Pi is discreet; It’s small, thin, and easy to hide. And thanks to running Kali Linux OS natively, it is flexible and able to run a broad range of hacking tools from badge cloners to Wi-Fi cracking scripts. By swapping the SD card and adding or removing components like a packet-injection capable wireless adapter, the Raspberry Pi can be customized to suit any situation.

                         Raspberry Pi + projector = Kali on a huge screen

The Raspberry Pi on Offense

First, it’s important to manage your expectations and remain reasonable when selecting a Raspberry Pi as a hacking platform. The Raspberry Pi is not a super computer and doesn’t have a tremendous amount of processing power. It’s not well-suited to processor intensive tasks like brute-force WPA password cracking, or acting as a network attack as the connection is too slow to fool users. That being said, the Raspberry Pi is perfectly suited to many attack environments. We simply offload these tasks to bigger computers and use the Pi as a data collector.

                           An active Raspberry Pi Wi-Fi jamming setup.
In my experience, the Raspberry Pi works exceptionally well as a Wi-Fi attack platform. Due to its small size and large library of Kali Linux-based attack tools, it’s ideal for reconnaissance and attacking Wi-Fi networks. Our offensive Kali Linux build will be geared towards anonymous field auditing of wired and wireless networks.

The Basic Components of Our Attack System

Here are the basic components needed to build our Pi attack system, and why we need them. If you’re just starting out, this excellent Raspberry Pi Kit from CanaKit includes most of what you need to get your Pi set up.

  • Raspberry Pi: The Raspberry Pi 3 is the platform of these builds, coordinating and controlling all other components. Its low power consumption and flexible capabilities allow it to serve as a platform for running Linux-based operating systems besides Kali.
                                                       Raspberry Pi 3.

 

 

  • Command and control (C2) wireless card: The purpose of the C2 wireless card is to automatically connect the Pi to the command AP (access point) such as your phone hotspot or home network. This allows remote control of the Pi discreetly or from a great distance via SSH (Secure Shell) or VNC (Virtual Network Computing). Fortunately for us, the Raspberry Pi 3 has a Wi-Fi card internally, but a wireless network adapter can also be added to a Raspberry Pi 2.
  • Wireless attack card:: Our attack wireless card will be a Kali Linux-compatible Wi-Fi adapter capable of packet injection. This will be our attack surface and can be a long-range, short-range, or directional antenna depending on attack requirements.
  • OS build cards: The micro SD card hosts the OS and brain of the computer and can be precisely configured for any desired environment. By creating customized cards, it is possible to rapidly change the configuration and function of a Raspberry Pi by simply swapping the card and components.
  • Computer: You will also need a computer to download the firmware to load onto the micro SD card.
  • Power supply: The Raspberry Pi uses a standard Micro-USB power supply, and nearly any android phone charger or battery pack will work to power a Pi. This allows for a number of different battery configurations to suit long-endurance reconnaissance or continuiously powered operations.
                                        My Raspberry Pi hacking kit.
  • Ethernet cable (optional): An Ethernet cable allows you to bypass wireless authentication by directly interfacing with local networks to which you have physical access. Specialized attacks like PoisonTap can also take advantage of ethernet interfaces to infiltrate computers.
  • Bluetooth keyboard (optional): A Bluetooth keyboard is helpful for interfacing when you have an HDMI connection.
  • Case (optional): Every Pi needs a case to protect it.

Build Considerations

In designing this tutorial, I considered two primary modes in which you would be operating the Raspberry Pi. In our open configuration, the Raspberry Pi is connected to a display via HDMI cord with inputs running through a wireless mouse and keyboard. In our tactical configuration, you will use a laptop or smartphone to access the Raspberry Pi remotely via SSH. By connecting the Pi to our phone’s hotspot or a nearby friendly AP, we can access the Raspberry Pi while still being able to use cellular data in the field.

(Top) Lab configuration: Output over HDMI, input via Bluetooth keyboard. (Bottom) Tactical Configuration: Kali Linux via SSH.

How to Set Everything Up

In this guide, I’ll show the steps needed to set up a Raspberry Pi 3 as a basic hacking platform with Kali Linux. I’ll go over how to select a build to install, writing the disc image to a micro SD card, and the steps to run after first setting up your Pi. We’ll update Kali Linux to the latest version to ensure everything works correctly, change the default SSH keys, and take care of some housekeeping like changing the admin password.

Raspberry Pi in action connected to an HDMI output.

As a note, there are many ways to configure Kali on a Raspberry Pi 3. Some include touchscreens, some are completely headless (accessed via network connections without a keyboard or display), and others use the internal Wi-Fi card to create a hotspot for remote control of the Pi. In selecting this build, I discounted any designs that included a power-hungry and fragile touchscreen or additional hardware, and settled a version optimized for our two different C2 scenarios.

Step 1. Download Kali Linux Image for the Raspberry Pi

Head to Offensive Security and download the latest Kali Linux image for the Raspberry Pi. As of this writing, it is “RaspberryPi 2 / 3” on version 2.1.2.

Step 2. Flash the Image to the Micro SD Card

You can use a tool like ApplePiBaker for Mac or Etcher to load your Kali image onto your SD card, but sometimes these can result in errors. To prevent that, we’ll cover how to do this via Terminal on a Mac. If you use Windows, you can use Win32 Disk Imager to put your image on the card.

 

Step 3. Boot into Kali Linux

When finished, your SD card is ready to go! Insert the SD card into your Pi, connect it to HDMI, and attach your Bluetooth keyboard. Plug in the power source to boot into Kali Linux for the first time. To get to the desktop, your default login is “root” with “toor” being the password.

 

Kali Pi with power, HDMI, Ethernet, Bluetooth receiver, and secondary wireless adapter attached.

The login process is a problem for autonomous control, and we will need to disable it later. This will let us plug our Pi in and immediately connect to it remotely without a screen.

                                                 First boot of Kali.

Step 4.Update Kali Linux

Kali Linux is a special flavor of Debian Linux meant for penetration testing, and a favorite here on Null Byte. It’s compatible with some of the best and most advanced tools available for wireless hacking, and flexible enough to support a large number of hacking builds. It’s maintained by Offensive Security, and you’ll need to update it to the latest version to make sure all the tools work properly.

Before running, now is a good time to expand your installation to the size of the partition. To do so, run the following:

resize2fs /dev/mmcblk0p2

At the top right of the desktop, you’ll see an option to connect to a nearby wireless network. Connect to your phone’s hotspot or a friendly AP to fetch the update. Run the update by opening a terminal window and typing the following:

apt-get update
apt-get upgrade
apt-get dist-upgrade

Your Kali install is now up to date. Update the root password to something more secure than “toor” by typing:

passwd root

Then enter a new password for your Kali Linux system.

Step 5. Install OpenSSH Server

To communicate with our Raspberry Pi from a computer or phone, we’ll need to be able to log in. To do so, we can use SSH to connect via any Wi-Fi connection we share with the Pi. SSH, or the Secure Shell, is a network protocol that allows us to run commands remotely on a device. This means we don’t need to plug in a screen to interact with our Pi.

In a terminal, run the following to install openSSH server and update the runlevels to allow SSH to start on boot:

apt-get install openssh-server
update-rc.d -f ssh remove
update-rc.d -f ssh defaults

The default keys represent a huge vulnerability since anyone can guess them. Let’s change them immediately by running the following commands:

cd /etc/ssh/
mkdir insecure_old
mv ssh_host* insecure_old
dpkg-reconfigure openssh-server

This backs up the old SSH keys in another folder and generates new keys. Problem solved! Now let’s make sure we can log in via root by typing:

nano /etc/ssh/sshd_config

This will open your SSH configuration folder. Change this line:

PermitRootLogin without-password

To this line instead:

PermitRootLogin yes

And type Ctrl O to save the changes. If it already is correct, you don’t need to change anything.

                                                  Configuring sshd_config.

Great! Let’s restart the SSH service by typing:

sudo service ssh restart
update-rc.d -f ssh enable 2 3 4 5

Finally, to test that we’ve got SSH working, use the following to see if SSH is currently running.

sudo service ssh status

We should see something like this if we are successful.

If it’s not, run this to get it going:

This article is not mine.. it’s of the person namely”Skickar”….

But I pasted it for Raspberry pi lovers…

My intention for using this article are not for earning money and name…

I just wanted to help the pi users…

 

3 thoughts on “How To Set Up a Headless Raspberry Pi Hacking Platform Running Kali Linux”

  1. ottimo lavoro complimenti. vorrei sapere dove posso acquistare il Raspberry Pi 3 come quello usato da voi.
    Ciao grazie
    ottimo lavoro complimenti. vorrei sapere dove posso acquistare il lampone Pi 3 come quello usato da te.
    Ciao grazie

    Like

    1. Dude it’s not a theft… I love that article that’s why I just copy pasted here..
      By the way I am not earning money from your article…
      If u feel hurted I will remove this…
      Just chill dude..
      I thought Linux user do not get hesitated… We are from open source community…
      Don’t get this wrong….

      Like

Leave a comment