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:

  1. Download the Raspberry Pi Imager (more convenient).
  2. 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.

  3. Open the Raspberry Pi Imager and click Choose OS.

  4. Choose Other general purpose OS.
  5. Select Ubuntu.
  6. Select Ubuntu Desktop.
  7. Select the appropriate SD card to install the image onto.
  8. 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.

  9. Select Write to begin writing to the SD card.
  10. 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.
  11. Click Continue to finalize the process. Eject the SD card, plug it into your Raspberry Pi, and boot up.
  12. Install Ubuntu onto Raspberry Pi.
  13. During the installation, you will be asked the following things:

    • 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.

    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.

  14. 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.
  15. 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.
  16. Switch to the root user account.
  17. Within the terminal prompt, type the following command:

    pi@raspberrypi:~ $ sudo su
    root@raspberrypi:/home/pi#

  18. 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
    vpt

    Once 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

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.

  1. Launch Terminal.
  2. Check if your system already has some swap space available by typing sudo swapon --show or free -h. If you don’t see any output or the swap row shows 0B, then you need to create a swap file.
  3. 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.
  4. Create a swap file using the fallocate command. For example, to create a 1GB swap file, type sudo fallocate -l 1G /swapfile. You can replace 1G with the size you want.
  5. Set the permissions of the swap file so that only the root user can access it by typing sudo chmod 600 /swapfile.
  6. Mark the swap file as swap space by typing sudo mkswap /swapfile.
  7. Enable the swap file to start using it by typing sudo swapon /swapfile.
  8. 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 typing echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab.

QUESTION  How do I connect to my Wi-Fi network?

ANSWER  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.

QUESTION  My organization blocks access to outside countries. What solutions are available?

ANSWER  If your organization restricts outbound traffic to other countries, you may need to configure an alternative mirror for your Ubuntu instance.