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 pentesing lab When I started to learn cyber security The first Thing I m faced was setting up the lab to test and learn the various web security.As the every beginner I started with the kali linux but I dont where to use the tools is it legiitmate to test the other person webiste After the couple of month I came to know about the dvwa There also setting up was difficult for me Since I m a noob Someway I managed and setup and started Learning

honet

But Recently I came to know about vagrant Which help to automate the setup the enviroment.I m going to show how to use vagrant in the linux this will be 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 folder 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 defaudlt credentials

username:root
Password:toor

We have succesfully 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 the any text editor and remove the comments in the vagrant file

  # config.vm.network "public_network"

so it can be acces by the 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 sucessfully create the pentesing 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