Practicing of an activity or skill is the best way to become pro in it. It is applicable on any field. This is also applicable for cybersecurity and bug bounty. But here we got a problem.
We can not test our penetration testing skills anywhere, because attacking any system or website without proper permission is illegal. The solution is we can host our own website/server on our localhost system and practice there. Means we need to create our own penetration lab and practice there.
We can practice our skills and try to find bugs on our localhost web application. Many web applications are available in the market with bugs. They put bugs intentionally so that we can practice our skills. We have already discussed these on our DVWA and bWAPP tutorial. Not only two there are more buggy web applications available.
For better practice we need to use them but installing and configuring different vulnerable web applications on our system is a lengthy and boring process.
In this tutorial we are going to learn how we can easily manage these web applications on our localhost system and make a better penetration testing lab.
We use a GitHub tool called "pentestlab". This bash script is used to install and manage those buggy web applications automatically on our localhost system.
Let's open the terminal in our Kali Linux system and clone pentestlab from it's GitHub repository by using following command:
The screenshot of the command is following:
After it cloned in our machine we need to navigate to it's directory by using cd command:
Then we need to install docker in our system.
Now what is docker and how it works? We have a detailed article on it for beginners, check it out now. We are not going in depth in this article.
We use the following command to install docker in our system:
This command will install docker in our system.
Now after this installation we are ready to use this pentestlab in our system.
Let's start by using the list of vulnerable web apps we are getting with this tool.
For this we use following command:
The screenshot is following:
We can see in the screenshot that we are getting lots of vulnerable webapps. The list is following:
- bwapp -- bWAPP
- webgoat7 -- WebGoat 7.1
- webgoat8 -- WebGoat 8.0
- dvwa -- Damn Vulnerable Web App
- mutillidae -- Mutillidae II
- juiceshop -- OWASP Juice Shop
- vulnerablewordpress -- WPScan Vulnerable WordPress
- securityninjas -- OpenDNS Security Ninjas
- altoro --Altoro Mutual
For the first run it will download the bwapp docker image and store in our machine and then start it. It will take a minute depending on our internet speed.
After downloading it will start bwapp on our machine.
We already downloaded bwapp and running for second time so we don't need to wait, we can see that bwaap is started on our docker in the following screenshot.
Now in the following screenshot we can see that we have started bwapp on our system using this time saving way without any error. It also shows us the default credentials of bwapp. Also pentestlab tool set a host name in our /etc/hosts configuration, also given instruction that we need to go to http://bwapp/install.php for first time one click installation. To do this manually we need to go through a lengthy process. To check that process go to our bwapp installation tutorial.
We just need a click to install it |
Now for another example we start OWASP WebGoat 8.0 on our system. To do this we apply following command in our terminal:
In the following screenshot we can see that our pentestlab tool is downloading webgoat8 on our system.
After the download complete it will start webgoat8 on our system as we can see in the following screenshot.
Webgoat8 download and started in one command |
We are starting a lab using start command and when we need to stop it we can use stop command. If we want to stop webgoat8 then we need run following command:
After this command WebGoat8 will stop and the host name is removed from /etc/hosts file, as we can see it on following screenshot.
This way we can easily host our vulnerable web server on our system by using docker. This is a very efficient way to set up our penetration testing laboratory and practice more. Practicing more will improve our skills also visiting our website regularly will show the way of improvement π.
Comments