Deploying vPenTest on a Raspberry Pi
Overview
The vPenTest Agent can be installed on a Raspberry Pi and is fully capable of performing a penetration test and/or vulnerability assessment with very little resources required.
Some requirements that you'll need prior to getting started are:
- A USB keyboard to control your Raspberry Pi
- A network cable to give the Raspberry Pi internet access.
- An HDMI monitor to connect to the Raspberry Pi (HDMI to micro-HDMI cable needed)
NOTE A USB monitor may work, but you may experience several issues when it comes to DisplayLink drivers getting it to work. Not recommended and we cannot provide support for this.
Important resource requirements:
- Memory: 8 GB
- Hard Disk Space: 80 GB
- Networking adapter mode preference: Wired Ethernet
- Network download speeds: 5 MB/s
- Operating System: Ubuntu Desktop/Server 22.04 (64-bit)
Installation process
To begin deploying Ubuntu onto the Raspberry Pi, perform the following steps:
- Download the Raspberry Pi Imager (more convenient).
- Open the Raspberry Pi Imager and click Choose OS.
- Choose Other general purpose OS.
- Select Ubuntu.
- Select Ubuntu Desktop.
- Select the appropriate SD card to install the image onto.
- Select Write to begin writing to the SD card.
- Select Yes on the warning screen to overwrite all contents on the SD card.
Please read this step carefully. Only click Yes if you understand that you'll overwrite everything on your SD card (meaning you'll lose all the data that's on it already).
This process will take several minutes, depending on your SD card's write speed. - Click Continue to finalize the process. Eject the SD card, plug it into your Raspberry Pi, and boot up.
- Install Ubuntu onto Raspberry Pi.
- Choose your language: (US English)
- Choose your keyboard layout: (English US)
- Choose your wireless network: [wifi network here]
- Choose your location.
- .Configure your username: This is a very important part of the installation.
- Log in to your new user account. Once the Raspberry Pi loads up into the desktop, it will prompt you for a username and password. Use the credentials you provided during the installation.
- Open the Terminal app. You can press the Windows key on your keyboard to bring up the app finder/search window, and type in Terminal.
- Switch to the root user account.
-
Run the installation command. Log in to vPenTest and create an Agent and capture the installation command. Or, if you have an existing Agent, you can reuse the UUID.
This command will trigger a series of events, such as installing prerequisite software, updates, etc. Once it's completed, you'll see the following at the end of the prompt:
[*] Prerequisites installed!
[*] Type the following command on your command line: source ~/.bashrc
[*] Afterwards, you'll be able to type the following command to open the Agent's menu: vpt
[*] For any issues, please email support@vpentest.io or visit the Help Center.After you see this, you can type the following commands (as shown in the output above):
source ~/.bashrc
vptOnce you type the vpt command as shown above, you'll be at the vPenTest Agent prompt, as shown below:
****************************************
* vPenTest Remote Access Agent v1.35 *
* Agent UUID: n/a *
* Your public IP: X.X.X.X *
****************************************
1. Assign IP address configuration
2. Register Agent
3. Reboot
4. Shut down
5. Exit
Choose an option:From this point on, you're able to continue with the process of setting up and managing your Agent from within the portal. Refer to the following article: Creating and managing internal Agents
Choose the version of Raspberry Pi Imager that's appropriate for your operating system. In this example, we're going to be using the macOS version.
NOTE Before completing this option, you'll need to have an SD card attached to your computer. Although the image itself is only about 500 MB, we highly recommend adhering to the resource requirements above. We require at least 80 GB of storage space on the SD card.
NOTE If you do not see an SD card listed above, please double check that you have an SD card attached to the computer. If you do and still do not see the SD card listed in the above screenshot, you may have to do some additional troubleshooting. You may also want to check to see if whether or not the SD card is formatted properly to be read by the operating system.
During the installation, you will be asked the following things:
NOTE Please note that your username and password are critical components of the installation process. These settings cannot be recovered by Vonahi Security if you forget your password at some point in the future.
Within the terminal prompt, type the following command:
pi@raspberrypi:~ $ sudo su
root@raspberrypi:/home/pi#
Troubleshooting
Here are just a few common troubleshooting tips in case you're having issues with your Raspbian OS image:
How do I connect to my Wi-Fi network?
During the installation, this information will be requested in the second stage. You can configure your wireless network, along with the credentials, and the Raspberry Pi will use those settings going forward.
I am getting out-of-memory errors.
When installing Ubuntu Desktop it doesn't create a swap partition and 8GB is usually enough but sometimes it does require more and as long as it can swap to disk temporarily it will continue to work. Please do the following to create a swap partition using the CLI.
- Launch Terminal.
- Check if your system already has some swap space available by typing
sudo swapon --show
orfree -h
. If you don’t see any output or the swap row shows 0B, then you need to create a swap file. - Check the available space on your hard drive partition by typing
df -h
. Find the device with/
in the Mounted on column and see how much space is available. You can choose the size of your swap file according to your needs and preferences, but a general rule is to make it equal to or double the amount of RAM on your system. - Create a swap file using the
fallocate
command. For example, to create a 1GB swap file, typesudo fallocate -l 1G /swapfile
. You can replace 1G with the size you want. - Set the permissions of the swap file so that only the root user can access it by typing
sudo chmod 600 /swapfile
. - Mark the swap file as swap space by typing
sudo mkswap /swapfile
. - Enable the swap file to start using it by typing
sudo swapon /swapfile
. - To make the swap file permanent, you need to edit the
/etc/fstab
file and add an entry for the swap file. You can do this by typingecho '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
.