How do I setup the pentesing Lab Using vagrant

Link to full Blog

Hello Friends Its been a long time since I Posted blog So I decided to post the blog on setting up the basic pen testing lab When I started to learn cybersecurity The first Thing I m faced was setting up the lab to test and learn the various web security. As every beginner, I started with the kali Linux but I don’t where to use the tools is it legitimate to test the other person website After a couple of months I came to know about the dvwa There also setting up was difficult for me since I m a noob Someway I managed and set up and started Learning

honet

But recently I came to know about vagrant Which help to automate the setup the environment. I m going to show how to use vagrant in the Linux this will be the same for the other also.

Pre-requiste

  1. vagrant Installation-link
  2. Virtualbox Installation-link

start

Ok Lets get started For this tutorial I m going to create and use the two vms - Attacker (Kalilinux) - Victim (Dvwa)

I m going to create the two folders as the name says - attacker - victim

ol

Now go to the attacker folder

$ cd attacker

Type the below command in the terminal

$ vagrant init vagrant init offensive-security/kali-linux

and start the machine by typing the below command in the terminal

vagrant up

now the Kali-machine is will be started login into this using the default credentials

username:root
Password:toor

We have successfully setup the attacker part

Now go to the victim folder

Type the below command in the terminal

$ vagrant init mmckinst/dvwa

Open the VagrantFile in any text editor and remove the comments in the vagrant file

  # config.vm.network "public_network"

so it can be accessed by any system in the network

and start the machine using the below command

$ vagrant up

and make sure to select the network 1)wla0

net

Now SSH into the victim machine using the below command

$ vagrant ssh

Type the below command in the terminal to find the ip

$ ifconfig

ip

Now open the browser in the kali machine and type the ip

Login into the machine using the default credential

username:admin
Password:password

s

We have successfully created the pentesting lab using the vagrant started using the vagrant

up

When we are finished with the work we can the below command to stop the machine

$ vagrant halt

To remove the vm image type the below command in the terminal

$vagrant destroy

References

  1. https://www.kali.org/news/announcing-kali-for-vagrant/

  2. https://www.youtube.com/watch?v=vBreXjkizgo&t=837s

If you have queries or feedback Feel free to reach me Thanks for reading my blog Have a nice day

Nifty tech tag lists fromĀ Wouter Beeftink