avatarStephen Chapendama

Summary

The provided web content outlines a step-by-step guide on building a cybersecurity testing lab at home using security operating systems like Parrot OS or Kali, emphasizing the importance of practice and hands-on experience for aspiring cybersecurity professionals.

Abstract

The article serves as a comprehensive walkthrough for setting up a virtualized cybersecurity testing environment, aimed at individuals interested in penetration testing and malware analysis. It details the necessary hardware, software, and resources required, including the recommendation of using a laptop with at least 8GB of RAM and the use of virtualization tools such as Oracle VirtualBox or VMWare Fusion. The guide focuses on installing Parrot Sec, a Debian-based security and privacy-focused operating system, and explains how to configure virtual machines with adequate resources to ensure stability and performance. The article also covers the use of essential tools like Nmap for network discovery and vulnerability scanning, and it provides practical examples of scanning a home network to identify devices and open ports. The author stresses the importance of understanding cyber attack methodologies to better defend against them and suggests that having a personal cybersecurity lab is a valuable learning resource for both beginners and professionals in the field.

Opinions

  • The author believes that hands-on experience with a home cybersecurity lab is crucial for understanding cybersecurity concepts and tools.
  • Practicing with tools like Nmap and learning to use them effectively is seen as a key skill for cybersecurity professionals.
  • The article suggests that Parrot OS is a user-friendly option for those new to Linux or cybersecurity, providing a familiar interface and pre-installed tools.
  • The author emphasizes the legal considerations of cybersecurity practice, referencing the Computer Misuse Act 1990 in the UK, and advises using a controlled home environment to avoid legal issues.
  • Setting up a Raspberry Pi as a target device for testing is recommended as a safe and legal way to practice penetration testing skills.
  • The author values the use of comprehensive guides and documentation, as well as leveraging platforms like YouTube for educational tutorials, to enhance the learning experience.
  • The article promotes the idea that a home lab environment allows for the exploration of vulnerabilities and the practice of exploits in a controlled setting, which is beneficial for career development in cybersecurity roles.
  • The author endorses The CyberWire podcast and ZAI.chat AI service as additional resources for staying informed about cybersecurity issues and gaining practical knowledge.
Cyber DIY isn’t so bad, right? — Photo by Rudi Endresen on Unsplash.

How to build your cybersecurity testing environment 🚀

Building a cybersecurity lab: A simple guide on using security operating systems to build a home lab

Often when we discuss pathways into cybersecurity, we emphasize how practice makes perfect, in fact, it’s often mentioned that it’s good to have a home setup. However, for those not in tech looking to understand what a home setup actually looks like this post is intended to be a walkthrough of setting up a virtualized environment with explanations as well to aid those starting out their journey into cybersecurity.

A very popular route into cybersecurity is penetration testing, so popular in fact, it’s often the first career that comes to mind when people hear about “hacking.” If you are interested in learning some of the tools pen testers are using this guide will help you set up a testing environment for you to learn how to use Parrot OS or Kali. We have seen a change in culture lately, more people are looking towards platforms like the Hack The Box and TryHackMe as gateways into pen testing, but having a home environment that you’re in control of also gives you so much more.

Things you’ll need:

  • A laptop/PC — For this, I am using a Macbook with 16gb RAM (I highly recommend using a laptop with 8gb and above as the minimum.)
  • Optional — A Raspberry Pi running Raspbian.
  • Oracle Virtualbox or VMWare Fusion.

Why did I specify the RAM when listing my laptop requirements?

Virtualized Machines (VMs) are described by Microsoft as:

A virtual machine is a computer file, typically called an image, that behaves like an actual computer. In other words, a computer is created within a computer.

For the VM to run, it will need resources (storage, RAM & processing power) and this must come from somewhere right? If you have a 4GB laptop, and you run 3 VMs with 1GB, that means your laptop is now left with 1GB of RAM to actually use for itself and yeah, things won’t work out well.

One key piece of advice for those starting out, read the settings once, and then twice and a 3rd time for good measure and understand how powerful or under-resourced the machine you’re building is. The knowledge used here is often the underlying knowledge people have when they move onto cloud deployments using GCP, AWS or Azure as using tools like Virtual Box & VMWare introduces you to setting up virtual networks and making sure your VMs can actually communicate. If you are interested in malware and building sandbox environments this is a good place to start by building your own environment.

Which operating system will we be installing? 💻

For this guide, we will be installing Parrot Sec but the instructions will apply if you choose to use Kali as well.

The Parrot Project — Courtesy of the Parrot Linux

Parrot OS is a GNU/Linux distribution based on Debian with a focus on security, privacy, and development. If this is your first time using Linux or aren’t comfortable with Linux, it will give you the best user experience as the out the box install we will be using is similar to a few operating systems you may have come across.

Ensure you download this one!

To download Parrot OS you will need to download and install Oracle Virtual Box or VMWare. Once installed, you will need to download the ISO image from the respective website of the operating system you wish to use.

Parrott OS Download Link

For this tutorial, we will be downloading Parrot Security MATE ISO as it includes the tools we need.

Remember back in the day we would input a CD to install a new operating system? Well, this is what an ISO is. On VMWare, you can just drag the ISO file and it will detect the operating system and build the system.

Screenshot by Stephen Chapendama

As we can see from the screenshot, I have given the VM access to 1 core and 4GB of RAM leaving 12GB available for my machine to use. Before I had adjusted the memory, it had given the virtual machine 2GB memory and access to 2 cores. This would’ve made the VM unstable as it would’ve impacted performance on the host machine. As I plan on running 2 virtual machines, 1 for active use and 1 to perform tests on I need to be conservative with memory resources.

Storage allocation — by Stephen Chapendama

As we can see for storage I have given the VM 16GB, this means that the machine will now take a chunk out of my own laptop storage, so if you have a laptop that’s full, you may struggle running VMs. To be fair, I could give it 6GB but I am not looking to run into storage issues as it can sometimes be a hassle to resize and allocate storage again.

And before you know it, it’s installed! — Screenshot by Stephen Chapendama

Once you log in, you can view the pentest menu as the screenshot above shows. The reason I chose Parrot OS over Kali for this tutorial is that it perfectly puts some of the industry-standard tools in nice classifications. So if you start doing tutorials on breaking into databases, you can see what arsenal you have at your disposal. With these tools, you can’t just read a manual and be an expert, you need to keep using them and learning from each mistake. I recommend always checking the documentation and then finding guides on Youtube.

Okay, it’s installed, now what? 👩🏾‍💻👨🏽‍💻

As this is a home deployment, it’s good to have it installed on your network with devices that you know are on your network. As if you live in the UK, the Computer Misuse Act 1990 is real and you can get prosecuted for cyber activities, it’s worth building another virtual machine with a standard OS, Windows or another Linux flavour. As I already had a Raspberry Pi set up, I will be using that.

Alternative operating systems you can deploy to test as VMs:

Let’s see what we have on the network!

Nmap, short for Network Mapper, is a free, open-source tool for vulnerability scanning and network discovery. Network administrators use Nmap to identify what devices are running on their systems, discovering hosts that are available and the services they offer, finding open ports and detecting security risks.

How do I scan my whole network? 🗺

We can open up a terminal session on our Parrot OS VM and run the following command. It will scan across all IP ranges on the following subnet and tell us which hosts are responding and alive.

If you are not comfortable with Nmap I recommend using this cheat sheet or utilizing the documentation.

nmap -sP 192.168.0.101/24

Output:

Screenshot showing output of an nmap scan.

The following results show that currently on my network, there is 6 devices connected and the network addresses. It has also identified a raspberry pi with the host address 192.168.0.37.

The rest of the other devices are most likely my phone and other devices currently connected to the router. I can now run further probes to find out what these devices are.

We will use this address to now do a full scan:

As this is my environment, the scan below is actually very loud (in terms of it can be easily detected)! And would easily be detected by good sys admins with even the lightest monitoring in place. So I wouldn’t use this unless for testing purposes to see a full result.

nmap -sT -p- -A -sC -vv -n -Pn 192.168.0.XX

Output:

This is not the complete output but from the initial scan, we can see that it first started out by seeing what’s open on this host by probing all the ports.

We can see that common ports like 22 (ssh), 80 (HTTP) are open. As an attacker using Parrot I will now be looking for brute force tools and also tools to do with finding out about HTTP to see if I can find a way in.

I am also seeing unusual port numbers, 19999 which means I will need to do more work to find out what’s running here.

But the good thing about the comprehensive scan is it does most of the work for me. So that rogue port running a service on 19999?

So as we can see, it’s actually returned a 400 code letting me know what kind of web service is running. This is called an information leak, as now I’m aware that something is definitely running that allows credentials and it’s called NetData Embedded HTTP Server. As it’s also done me a favour and told me it’s running v1.21 I can now focus on finding what vulnerabilities this software version has and how I can exploit them. This is one of the benefits of having some of these tools deployed in your own environment.

From this information now, I can choose what kind of path I want to go down. Perhaps a brute force SSH attack to try force my way in? Or I could just try every automated attack I have to see what hits and what sticks and lets me in. Sometimes this can be as simple as performing DDOS attacks on the Raspberry Pi to knock it off the network but when we now consider in real life how easy it is for attackers to scan and map a network and then launch attacks, that maybe we don’t have to connect to every free wifi we see in airports and hotel lobbies.

The important thing to realise about tools like Kali and Parrot OS is that literally anyone can download these and start using them. From running a Nmap scan, I found out there was a machine on my network, I found out which services were running and then I now have an arsenal of tools available to run exploits. As a cybersecurity professional, we often need to know how attacks happen and work, for us to be able to defend against them. Having an environment such as this is a great way to learn how to protect against these threats. Your career might not head towards penetration testing, but being comfortable with deploying VMs and also knowing how to use the basic tools will help boost your knowledge. Whether you work in cyber policy or log analysis & audit, it’s good to know what the attackers know.

And to help you with your journey here is the last tutorial focused on hacking into a raspberry pi with Parrot OS by YouTuber Novaspirit Tech.

And last but not least, during this crisis, I recommend keeping up to date with cyber issues with one of my favourite podcasts currently The CyberWire!

By Stephen Chapendama

Cybersecurity
Technology
Computing
Network Security
Business
Recommended from ReadMedium