Sponsored
Web Penetration Testing

Web Application Pentest Lab Setup on Docker

Hey Folks, In this tutorial we will learn how we can configure the vulnerable web application on docker. As we know that docker gives us the ability to run multiple containers simultaneously on a given host and even we can run containers within host machines that are actually virtual machines. So with the help of this great technology we will install our vulnerable web application for testing purposes.

What shall we do ?

Docker

  • WebGoat & WebWolf
  • Juice-Shop
  • bWAAP
  • DVWA
  • Mutillidae
  • Sqli-Labs
  • XVWA

Lets do it πŸ™‚ !!

Docker

First we have to download the docker on our terminal which are quite simple just we need to execute the below command and it will be automatically downloaded.

apt-get install docker.io

We need to execute the following command to start the docker service.

systemctl enable docker
systemctl start docker

Now the docker is successfully configured on the web server and now we can host our web applicaitons.

WebGoat & WebWolf

WebGoat and WebWolf both are insecure application that allows interested developers just like you to test vulnerabilities commonly found in Java-based applications that use common and popular open source components.
We need to download it from the github page in which we will get the docker configuration file and we will be able to host it on the docker.

git clone https://github.com/WebGoat/WebGoat.git

The downloaded directory contains the configuration file to which we will go. Now we only need to execute the last command which will automatically host this vulnerable web application on the web server.
Usage πŸ™‚ docker run -p < Any Port >:8080 -p < Any Port >:9090 -e Image

cd WebGoat/
docker run -p 8080:8080 -p 9090:9090 -e TZ=Europe/Amsterdam webgoat/goatandwolf

Next step to browse the following location and click on β€œregister new user” option.

http://127.0.0.1:8080/WebGoat

We can set user and password as required.

Thats it πŸ™‚ here you can see that our first vulnerable web application is successfully hosted on the docker.

After Browse the following location you will get your WebWolf vulnerable web application.

http://127.0.0.1:9090/WebWolf

Without much effort, we have successfully hosted our first vulnerable web application on Docker.

Juice-Shop

Juice Shop is written in Node.js, Express and Angular. It was the first application written entirely in JavaScript listed in the OWASP XVWA Directory. The application contains a vast number of hacking challenges of varying difficulty where the user is supposed to exploit the underlying vulnerabilities.
Source : OWASP

For this project we do not need to put a lot of effort as the docker provides this service to download the terminal to the project. Now we will execute the β€œpull” command which will automatically download the docker’s image.

docker pull bkimminich/juice-shop

After executing the above command we will host it on the docker using the following command.

docker run --rm -p 3000:3000 bkimminich/juice-shop

This will take some time and after doing this you can use the following URL to see your juicy web application.

http://localhost:3000

bWAAP

bWAPP is a vulnerable web application which is a free and open source. bWAPP is a PHP application that uses a MySQL database. It can be hosted on Linux/Windows with Apache/IIS and MySQL. prepares one to conduct successful penetration testing and ethical hacking projects.

We have to download the following image by using the pull command.

docker pull raesene/bwapp

Just host the web application on port 80 by using the following command.

docker run --rm -p 80:80 raesene/bwapp

Now we will open the given link in which we have to click on highlighted hyperlink that will establish mysql database.

http://localhost/install.php

After doing all this we can login into the web application by using the bee and bug credentials.

Here you can see that we have successfully hosted it and now we can start out penetration testing.

DVWA

DVWA is an vulnerable web application which coded in PHP/MYSQL. Seriously it is too vulnerable. With the help of this application ethical hackers can test their skills and run this tools in a legal environment. The aim of DVWA is to practice most common web vulnerability, which contains different types of level.

Now we will execute the following command and it will download the DVWA image from the docker hub.

docker pull vulnerables/web-dvwa

Keep in mind it may be give you error of bind address hence you can use the different port number in your case. But anyway just execute the following command.

docker run --rm -p 80:80 vulnerables/web-dvwa

Browse the following location and you will find the login page where you have to enter admin and password in the input field to login to the web application.

http://localhost/setup.php

Click on reset database and after that it will give us location of login in which we have to click.

Thats it πŸ™‚ Again we have successfully configured our web application.

Mutillidae

Mutillidae is a another pen source web application provided to perform pen-test and hack a web application. Mutillidae can be installed on Linux, Windows XP, and Windows 7 using XAMMP making It easy to install, only we need to configure the linux, apache, mysql and php on web server.

docker pull citizenstig/nowasp

Execute the following command pull command which will automatically download Docker images from a registry.

docker run -d -p 82:80 citizenstig/nowasp

We need to open the following location on our browser where the web application is hosted. Then we will click on the β€œopt-out” option which will appear at the end of the page.

http://localhost:82

Congratulations 🎊 ! our vulnerable web application is successfully configured on the docker.

SQli-Labs

SQLI-LABS is a platform to learn SQLI Following labs are covered for GET and POST scenarios. It is an open source that is hosted on github page and especially designed to learn sql injection.

Like every time, this time also we will execute the pull command to download this project from the docker hub.

docker pull acgpiano/sqli-labs:latest

Now we will run the following command that will help us to host our web application without much effort.

docker run -d -p 83:80 acgpiano/sqli-labs:latest

Again open the given URL on browser and now we donot need to do more thing.

http://localhost:83

XVWA

XVWA is an another vulnerable web application written in PHP/MySQL that helps security enthusiasts to learn application security. XVWA is designed to understand following security issues and with the help of this vulnerable application we can enhance our penetration testing skills.

We will first download it as Github page and then we need to go inside the directory of the tool where we will get the docker file. After receiving it, I think you already know what our next step is πŸ™‚ ! just execute the following command.

git clone https://github.com/tuxotron/xvwa_lamp_container.git
cd xvwa_lamp_container/
sudo docker run --name xvwa -d -p 84:80 tuxotron/xvwa

This configuration is quite easy from all web applications as we do not need to do much, just browse the following location and start testing.

http://localhost:84/xvwa/

After configured all the vulnerable web application we can see all the location of the web application by using the β€œps” command.

docker ps

Done πŸ™‚ If we want to check how many images we have on our docker then we can use the following command.

docker images
About the Author
Shubham Goyal Certified Ethical Hacker, information security analyst, penetration tester and researcher. Can be Contact on Linkedin.
Sponsored

Recent Posts

Termux Cheat Sheet for Hackers

Hey Folks :) !! In this article, we present the "Termux Cheat Sheet for Hackers"…

1 month ago

Cracking the X-Factor in Cybersecurity: How Humans are Protecting the Systems?

Amid the rapid advancement of technology, the significance of human involvement in cybersecurity frequently goes…

8 months ago

Cariddi – Hidden Endpoint Finder for Bug Hunting

Hey Folks, we are back today after such a long break, but don't worry we…

2 years ago

API Security Testing 101: Know Everything About API Security Testing!

The security of your API should be one of the top priorities of companies. Without…

2 years ago

7 Best Tools for Web Penetration Testing: Comprehensive Details

Hey Folks, In today's business world, it is essential to have an online presence. However,…

2 years ago

Cyber Security Audits: Everything You Need to Know About It

Hey Folks, Is your business prepared in case of a cyber attack? Many companies don't…

2 years ago
Sponsored

This website uses cookies.