• We just launched and are currently in beta. Join us as we build and grow the community.

Web Application Pentest Lab Setup on Docker

g.bit

Machine Learning Attacker
G Rep
0
0
0
Rep
0
G Vouches
0
0
0
Vouches
0
Posts
149
Likes
144
Bits
2 MONTHS
2 2 MONTHS OF SERVICE
LEVEL 1 300 XP
Black-and-Blue-Simple-Technology-Business-Plan-Presentation.png


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.io1apt-get install docker.io

1-3.png


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

systemctl enable docker
systemctl start docker12systemctl enable dockersystemctl start docker

2-3.png


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.git1git clone

3-4.png


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/goatandwolf12cd WebGoat/docker run-p8080:8080-p9090:9090-eTZ=Europe/Amsterdam webgoat/goatandwolf

4-3.png


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


5-2.png


We can set user and password as required.

6-2.png


Thats it 🙂 here you can see that our first vulnerable web application is successfully hosted on the docker.

7-2.png


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


8-2.png


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-shop1docker pull bkimminich/juice-shop

9-2.png


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

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

10-2.png


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


11-2-1024x532.png

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/bwapp1docker pull raesene/bwapp

12-2.png


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

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

13-2.png


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


14-2.png


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

15-2.png


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

16-2.png

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-dvwa1docker pull vulnerables/web-dvwa

17-2.png


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-dvwa1docker run--rm-p80:80vulnerables/web-dvwa

18-3.png


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.


19-2.png


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

20-2.png


Thats it 🙂 Again we have successfully configured our web application.

21-2.png

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/nowasp1docker pull citizenstig/nowasp

22-2.png


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

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

23-2.png


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.


24-2.png


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

25-2-1024x647.png

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:latest1docker pull acgpiano/sqli-labs:latest

26-1.png


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:latest1docker run-d-p83:80acgpiano/sqli-labs:latest

27.png


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


28.png

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/xvwa123git clone
https://github.com/tuxotron/xvwa_lamp_container.gitcd xvwa_lamp_container/sudo docker run--name xvwa-d-p84:80tuxotron/xvwa

29-1.png


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.


30-1-1024x636.png


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

docker ps1docker ps

last.png


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

docker images1docker images

last2.png
About the AuthorShubham Goyal Certified Ethical Hacker, information security analyst, penetration tester and researcher. Can be Contact on Linkedin.
 

429,436

311,911

311,920

Top