Introduction
When working with web application security testing, having access to vulnerable applications is essential for practice and skill development. While a dedicated Kali Linux environment offers comprehensive pentesting tools, sometimes we just need a quick environment to practice specific security concepts without the overhead of a full virtual machine.
This guide demonstrates how to deploy bWAPP (buggy web application) using Docker, providing a lightweight alternative that uses fewer system resources than a virtualised environment. This approach is perfect for quick security practice sessions when you have limited time or system resources.
Note
Prerequisites
- Docker installed on your system
- Basic familiarity with command-line operations
- Understanding of web application security concepts
Getting started with bWAPP on Docker
Understanding the Docker image
Before we begin, let's examine what we'll be using:
- bWAPP: A deliberately vulnerable PHP application designed for security testing
- Docker image: We'll use the
hackersploit/bwapp-dockerimage, which packages bWAPP with all its dependencies - Container ports: The application will run on port 80 inside the container, which we'll map to our local machine
Setting up the environment
The setup process is straightforward and requires just two commands to get a working bWAPP instance.
-
Pull the Docker image:
docker pull hackersploit/bwapp-docker -
Run the container with port mapping:
docker run -d -p 80:80 hackersploit/bwapp-dockerThis command:
- Creates a detached container (
-dflag) - Maps port 80 from the container to port 80 on your host machine
- Uses the
hackersploit/bwapp-dockerimage
- Creates a detached container (
-
Access the installation page in your browser:
http://127.0.0.1/install.php -
Complete the installation by clicking the "Install" button on the page
-
Log in with the default credentials:
- Username:
bee - Password:
bug
- Username:
Tip
Managing your bWAPP container
Viewing running containers
To see your running container:
docker ps
Stopping the container
When you're finished with your testing session, stop the container:
docker stop <container_id>
Replace <container_id> with the ID shown in the docker ps output.
Restarting for future sessions
To restart an existing container:
docker start <container_id>
Common issues and troubleshooting
Database connection errors
If you encounter database connectivity issues, the most common solution is to restart the container:
docker restart <container_id>
Container port conflicts
If you receive an error about port 80 being already in use, choose a different port mapping as shown in the tip above.
Security considerations
Warning
Alternative vulnerable applications
While bWAPP is an excellent learning tool, you might also consider these alternatives:
- DVWA (Damn Vulnerable Web Application)
- OWASP Juice Shop
- WebGoat
Each offers different vulnerabilities and learning opportunities for security practitioners.
Additional resources
- bWAPP Official Repository
- OWASP Top Ten Project
- Docker Documentation
- AlexisAhmed/bWAPP-Docker GitHub Repository
Conclusion
Setting up bWAPP with Docker provides a quick and resource-efficient way to practice web application security testing. This approach allows you to spin up a vulnerable environment in seconds, practice specific techniques, and tear it down when you're doneāall without the overhead of a full virtual machine.
Whether you're preparing for a security certification, developing your pentesting skills, or just exploring web vulnerabilities, this containerised approach offers flexibility and convenience for your security testing needs.-- title: Quick access to bWAPP on Docker date: 2022-02-19 22:18 category: code tags: [bwapp,infosec,pentesting] slug: bwapp-docker status: published
Introduction
While we may do most of our tinkering in our dedicated Kali setup, we may just want to access bWAPP on our workstation for a quick refresher when we have a few minutes to kill. For such instances we can just run a quick container that won't demand as many cycles from our CPU as a virtualised Kali environment.
We'll use the image that AlexisAhmed/bWAPP-Docker created for this.
- AlexisAhmed/bWAPP-Docker
- tutum/lamp image has not been updated for 7 years
Pulling and running the Docker image
- run
docker pull hackersploit/bwapp-docker - run
docker run -d -p 80:80 hackersploit/bwapp-docker - access browser:
http://127.0.0.1/install.php - Happy hacking!