Cheap Security Lab Training with Raspberry Pi 4, Docker & Kali Linux

The Raspberry Pi is a small yet power platform that is perfect for building a cost effective cybersecurity training lab. In this article we will look at installing Docker on a Raspberry Pi 4 (4GB) running Kali Linux (64 bit).

The case pictured is the Official Raspberry Pi 7″ touchscreen in a modified touchscreen case. It was made for the Pi 3, only slight modifications were made so the Pi 4 could fit in it. Modify cases at your own risk, you could cut yourself or destroy your case.

Installing Kali Linux on a Pi 4

This article assumes that you have already installed and updated Kali Linux on your Pi 4. If you have not, simply download the 64 bit Kali Linux 4 ARM image from Offensive Security.

Extract the image, write it to an MicroSD Card, insert it into your Pi4, attach peripherals, and power last of all. Allow the system to boot up completely.

Login with “kali/ kali” – Since Kali 2020, you no longer use “root/ toor” to log in. Reboot, Update and Upgrade, and reboot one last time. You are now ready to install Docker.

Installing Docker on Raspberry Pi

Full docs for installing Docker on the Pi are available on the Official Kali Website: https://www.kali.org/docs/containers/installing-docker-on-kali/

  • sudo apt update
  • sudo apt install -y docker.io
  • sudo systemctl enable docker –now
  • docker

You can add a user to the Docker group if you wish:

  • sudo usermod -aG docker username

You may need to start the Docker service manually

  • sudo service docker start

That’s it! You can now run Docker and install any Docker images that you want.

OWASP Juice Shop on the Raspberry Pi

Some Docker containers will not run on ARM, but you can find ports for some of the more popular ones. Just realize that some times these aren’t “Official” images, so proceed with due caution.

Also, the purposefully vulnerable Docker Images are just that, so follow all precautions necessary to protecting your systems while running them. The most preferred method is a stand alone local address only test LAN, disconnected or firewalled from both the internet and any production systems.

We will install the Docker “OWASP Juice Shop” image from the Docker library. This is an ARM port of the official OWASP Juice Shop program.

Tool website: https://hub.docker.com/r/santosomar/juice-shop-arm64

To install, and run, simply open a terminal and type:

  • docker run -d –name juice-shop -p 3000:3000 santosomar/juice-shop-arm64

Docker will pull down the image, and run it.

Once it is installed:

  • Open a browser and navigate to localhost:3000 or IP_Address:3000

You are now good to go! You can begin testing your skills locally on the Pi or you can use a LAN system to practice your skills. A full write up on “Pwning OWASP Juice Shop” can be found here:

https://bkimminich.gitbooks.io/pwning-owasp-juice-shop/

and a list of Solutions can be found here:

https://bkimminich.gitbooks.io/pwning-owasp-juice-shop/content/appendix/solutions.html

A list of challenges for Juice Shop is available. As you complete each challenge, the website keeps track of your pwning progress. Here is one of my favorites, the “Melee Kitty”!

Enjoy and most importantly, have fun!

If you would like to learn a lot more about using Raspberry Pis in the security field, check out my latest book, “Security Testing with Raspberry Pi“!