Setup your pentest lab

Virtualbox

Create your virtual attacking machine with Kali Linux

  1. Download Virtualbox and install it: https://www.virtualbox.org/

  2. Download Virtualbox and install it from here

  3. Download the lastest kali linux virtualbox image (it is going to be our attacker machine) Make sure to take the virtualbox image and not the vmware one:

  1. Install Kali:

  • Go to virtualbox and click on « File » > « Import Appliance… »

  • Click on the yellow folder and navigate to the image of kali you downloaded, select it and click on open

  • Click on next and then click on import. It will take a little while… And then launch it for the first time. Username should be kali and password kali but you can find this info on their website or on the description of your machine in virtualbox

How to use vulnerable VM to practice

  • Once your have your kali installed, you can also take vulnerable machines to practice on them.

  • The idea here is to connect your kali with this machine so that you can hack it from your kali.

Where to find vulnerable machines

IMPORTANT NOTICE: These are vulnerable machines so use with caution. Also always check and research about a machine before installing it

How to connect your kali with another machine

  • Once you have chosen the machine you wish to try, and deployed it, you will need to connect it.

  • In this example I am going to show you how to proceed with Metasploitable 2. You can find it here.

Install Metasploitable 2

  • Unzip the downloaded file in a folder you will easily find later

  • Go to virtualbox click on new machine

  • Give a name to your new machine I will call it Metasploitable

    • Click on the yellow folder

    • Click on add

    • Navigate to the metasploitable folder you have just dowloaded and select the .vdmk file

    • Select it and then click on choose

    • Finally click on create

  • You can now start the machine for the first time (it should take a few minutes to start login is msfadmin and password is msfadmin)

  • Shut down the machine

Connect Kali and Metasploitable 2 together

  • Both machine should be shut down for this process

  • Go to virtualbox

  • Click on file > preferences > network

  • Click on the plus

  • Rename the network as you like or leave it like this

  • And click on ok

  • Click on Metasploitable

  • Settings

  • Network

  • And select Nat Network from the dropdown menu

  • And then ok

  • Ensure that Allows VM is selected in promiscuous mode

  • Do the Same for the kali machine

Check if our machines can communicate

  • In your Metasploitable type ip a and check your ip address

  • In you kali open the terminal and type ping

    • In my case: ping 10.0.2.4

  • Now type ip a in your kali and ping it from your Metasploitable.

  • They can connect to each other both ways.

Docker

  • sudo apt install docker.io install docker

  • sudo systemctl status docker check docker status

  • sudo systemctl start docker start docker (if not started)

  • sudo docker run hello-world check the install

  • sudo docker pull parrotsec/security:latest pull a parrot img

  • sudo docker run -it --name parrotos parrotsec/security

  • sudo docker exec -it parrotos bash start parrot OS when we need it

  • If you are using a vpn or need to use your host network you can also create a container that will do this with the option --net sudo docker run -it --name parrotos-route-host parrotsec/security --net=host

  • If you want to use files from your host (say you want to use openvpn from docker and you need to use your ovpn file) you can use the -v option docker run -it --name parrotos-shared-files -v /path/on/host:/path/inside/container parrotsec/security

Useful commands

  • sudo docker start parrotos start the container parrotos

  • sudo docker stop parrotos stop a container parrotos

  • sudo docker ps see containers

  • sudo docker stats see the status of our containers

  • ctrl + d exit from an existing container

  • To remove an a container sudo docker rm container-name

AWS

Digital Ocean

COMING SOON

Resources

Alternative labs for general pentests

Labs for specific pentests

Thick Client

API

Android

Firewalls

Jenkins

SNMP

IDS IPS

Cloud

Tomcat

Memcached

Microsocks

Proxies

VOIP

SMTP

Routers

Active Directory

Last updated