How to Setup Your Own Pentest Lab on VirtualBox

Every hacker or pentester needs to have safe place where he can test new exploits without involving his real working environment. That’s how professional hackers work. Most of them have private pentest labs to train their skills. So I decided to make easy tutorial where I will show you how to setup your own Pentest Lab using VirtualBox.

In this lab we will use Win XP as target machine and Kali Linux as attacker. You can setup more machines if needed.

First make sure you have all needed requirements:

  • VirtualBox
  • Kali Linux
  • Windows XP

So let’s get started, first you need to Download and Install VirtualBox. Installation is simple so I won’t go through it.

Once you’re done with installation open VirtualBox > File > Preferences > Network.Screenshot_1

Click on green + icon. You will see new network is created. Now we have to edit it. Click on screwdriver icon. A new window will show and thats where we can edit configuration for our network where all our machines will be connected on.

Network Name: PentestLab

Network CIDR:

Uncheck Supports DHCP (we will set IPv4 manually so we don’t need it).


It should look something like this. Now you have to setup new virtual machine. Click on New and follow instructions. I think it’s easy and no reason to explain it here. If you would like to see tutorial in that, please let me know in the comments.

Ok, so when we have our Kali Linux and Windows XP machines you have to select Kali Linux and click on Settings. Go to Network and select NAT Network and as Name select network we made in previous step. It should look like this.


Now do the same thing for Windows XP and/or other machines you want to include in your Pentest Lab.

We’re ready to start Kali; Select Kali Linux machine and click on Start. We have to setup our connection. Click on connection in up-right corner.


Wired Connectiod > Wired Settings > Wired > Settings (right-down icon) > IPv4 and enter following info like on image down.


Click on Apply and restart your machine. Now we have to make same thing on Windows XP machine.

Once Windows Xp is booted go to Start > Control Panel > Network Connections >Right click on Local Area Connection > Properties > Double click on Internet Protocol (TCP/IP). Enter info you see on screenshot.


Now click on Ok, Ok and your pentest lab is done. Let’s scan our network using nmap on Kali so we can see our machines.

[email protected] >  nmap -v

As you can see there’s our gateway and Windows XP box.


That’s it for this tutorial, I hope you enjoyed it and until next time, Happy Hacking!

If you have any suggestions or questions please use comments section below.



  • Manvendra wagadre Reply

    March 3, 2016 at 7:00 am

    Very helpfull…Thanks

  • Lurker Reply

    March 9, 2016 at 6:27 am

    May I know why do we use as the default gateway?

    • Luka Reply

      March 9, 2016 at 4:51 pm

      Because It’s default NAT network on QEMU Virtualization.

Leave a Comment


Welcome! Login in to your account

Remember me Lost your password?

Don't have account. Register

Lost Password