bWAPP has a bee for a mascot, a movie database full of superheroes, and over 100 deliberately broken pages. It is also one of the best free places to watch the same vulnerability survive a weak filter and then die to a proper fix. This bWAPP tutorial gets you from zero to your first three exploits: install it with Docker, log in, pick a bug, and break it at low, medium and high security.
bWAPP's menu is organized around the 2013 edition of the OWASP Top 10, so every category you practice maps to a risk you will see in real reports. If you want to try the main technique before your container has even finished downloading, the Query Quake lab runs a UNION-based SQL injection challenge in your browser with nothing to install.
TL;DR: bWAPP (buggy web application) is a free PHP/MySQL training app with over 100 vulnerabilities. Run docker run -d --name bwapp -p 127.0.0.1:8080:80 raesene/bwapp, open http://127.0.0.1:8080/install.php, click "here" to create the database, then log in with bee / bug. Start with SQL Injection (GET/Search) on low, then switch levels and see which payloads still work.
What Is bWAPP?
bWAPP, short for "buggy web application", is a free, deliberately insecure PHP web application with over 100 vulnerabilities, built by Belgian security trainer Malik Mesellem as part of his ITSEC GAMES project. You pick a bug from a dropdown, choose a security level, and attack it.
The final release is v2.2, dated 2 November 2014 in the project's release notes and still the newest file on SourceForge. Nothing new has shipped since. That sounds like a reason to skip it, but the bugs it teaches (SQL injection, command injection, XSS, file inclusion) have not changed in a decade, and the code is old enough to make the root causes very easy to read.
A few things make it different from the other classic practice targets:
- Sheer breadth. The README lists SQL, LDAP, XPath, SMTP, SSI and OS command injection, XXE, SSRF, CSRF, file inclusion, insecure uploads, session flaws, CORS, clickjacking and more. The menu lists 18 separate SQL injection pages alone, from a simple search box to injection through the User-Agent header.
- Three security levels on every page. Low has no protection, medium adds a weak filter, high applies a proper fix. Switching levels and retrying the same payload is the whole lesson.
- A companion VM called bee-box. It is a Linux virtual machine with bWAPP preinstalled plus deliberately outdated server software, so a handful of bugs (Heartbleed, Shellshock, POODLE, a remote buffer overflow) only work there. The pages for those bugs are marked "bee-box only".
The OWASP Vulnerable Web Applications Directory lists bWAPP as a free, open-source offline app. The license in the source code is Creative Commons BY-NC-ND 4.0, which means free for personal training but not for resale or modified redistribution.
How to Install bWAPP With Docker
The official install is a ZIP file you drop into Apache with PHP and MySQL. Skip that. bWAPP 2.2 calls the old mysql_* PHP functions that were removed in PHP 7, so it will not run on a modern XAMPP. A Docker image that bundles an old LAMP stack solves the problem in one command.
- Check Docker works. Run
docker versionand make sure both a client and a server version appear. On Windows and macOS, Docker Desktop has to be running. - Start the container. The most used community image is
raesene/bwapp(over 480,000 pulls on Docker Hub):
Thedocker run -d --name bwapp -p 127.0.0.1:8080:80 raesene/bwapp127.0.0.1:prefix binds the app to your own machine, so nobody else on your Wi-Fi can reach it. Port 8080 on your side avoids clashing with anything already on port 80. - Apple Silicon only: the image is built for
amd64. Add--platform linux/amd64afterdocker runand Docker Desktop will emulate it. It is slower but works fine for a PHP app. - Create the database. Browse to
http://127.0.0.1:8080/install.phpand click the "here" link in "Click here to install bWAPP". If the page reports that "The bWAPP database already exists...", you have already done this step. - Go to the login page. Open
http://127.0.0.1:8080/login.php. If you installed from the ZIP instead, everything lives one folder deeper, under/bWAPP/.
Stop the lab with docker stop bwapp and bring it back with docker start bwapp. Your database survives as long as you do not delete the container. If you break something badly (and you will, the SQL injection pages let you run any query), docker rm -f bwapp followed by the run command gives you a clean copy in seconds.
Expect antivirus alerts and keep it local. SourceForge shows a "Malware detected" warning on the download, and security software may flag the Docker image too. That is expected: bWAPP ships a PHP backdoor page, exploit scripts and a folder literally named evil. It is fine on your own machine, but never expose it to the internet. Several pages give you command execution on the host.
First Login: bee/bug and the Security Level
The default bWAPP login is username bee and password bug. The login form also has a security level dropdown, set to low by default. Leave it on low for your first session.
After logging in you land on portal.php, which asks "Which bug do you want to hack today? :)" and shows a long list grouped under the OWASP 2013 headings, from A1 Injection to A10 Unvalidated Redirects & Forwards, plus an "Other bugs..." section. Select a bug, click Hack, and you are on its page. Every page carries the same two dropdowns at the top: one to change the security level, one to jump to another bug.
Here is a detail most tutorials skip. bWAPP stores the security level in a plain cookie called security_level, with values 0 (low), 1 (medium) and 2 (high). Open your browser's developer tools, go to the Storage or Application tab, and you can see it and change it. In a training app that is a convenience. In a real application, a security decision stored in a cookie the user controls is a vulnerability, and spotting that pattern is a skill worth having.
Which bWAPP Bugs to Hack First
The menu follows the OWASP order, which is a reference order, not a learning order. With over 100 entries, beginners tend to click randomly and give up. This route works better:
| Order | Bug (menu name) | What you learn |
|---|---|---|
| 1 | HTML Injection - Reflected (GET) | How input ends up in the page, with no JavaScript involved yet |
| 2 | SQL Injection (GET/Search), then (GET/Select) | Breaking out of a string, UNION queries, and numeric injection |
| 3 | OS Command Injection | Chaining shell commands, and why character blacklists fail |
| 4 | Cross-Site Scripting - Reflected (GET) | Running JavaScript in the victim's browser |
| 5 | Insecure DOR (Change Secret), Directory Traversal - Files, Remote & Local File Inclusion (RFI/LFI) | Access control and file handling bugs |
| 6 | SQL Injection - Blind - Boolean-Based | Extracting data one yes/no question at a time |
Leave the "bee-box only" bugs alone unless you install the VM, because they need the vulnerable server software that the Docker image does not include. The denial-of-service pages are also best skipped: they can freeze the container, and you learn little from them.
Walkthrough: bWAPP SQL Injection From Low to High
Open SQL Injection (GET/Search). It is a movie search box, and the server builds this query (from sqli_1.php):
SELECT * FROM movies WHERE title LIKE '%your input%'
Low: break the string and count the columns
- Confirm the bug. Search for a single quote:
'. You get a MySQL error starting with "Error: You have an error in your SQL syntax". The quote closed the string early, so the query broke. That error is your proof of injection. - Count the columns. Search
' ORDER BY 7-- -and the page loads normally. Try' ORDER BY 8-- -and MySQL answers "Unknown column '8' in 'order clause'". Themoviestable has 7 columns. The-- -comments out the rest of the query, including the trailing%'. - Find which columns are displayed. Search
' UNION SELECT 1,2,3,4,5,6,7-- -. A new row appears with 2 under Title, 3 under Release, 5 under Character and 4 under Genre. Those four positions are your output slots. - Dump the users table. Put the interesting columns in those slots:
Two new rows appear:' UNION SELECT 1,login,password,email,secret,6,7 FROM users-- -A.I.M.andbee, each with the password hash6885858486f31043e5839c735d99457f045affd0.
That hash is 40 hex characters, which points to SHA-1, and it has no salt. It is simply the SHA-1 of bug. In practice, this is the moment a SQL injection turns into an account takeover: dumped hashes go straight into a cracker, and an unsalted SHA-1 of a short password falls in well under a second. You can try that exact step on the Crack SHA1 Hash challenge.
Medium: the quote is escaped, so change pages
Set the level to medium and repeat the payload. It now returns "No movies were found!". On medium, this page runs your input through PHP's addslashes(), which puts a backslash before every quote. Your ' no longer closes the string, it becomes part of the search text.
Now open SQL Injection (GET/Select). This page picks a movie from a dropdown and sends its ID in the URL as ?movie=1. The query is SELECT * FROM movies WHERE id = 1, with no quotes around the number. Medium applies mysql_real_escape_string(), which escapes quotes too, but a numeric payload does not need any:
http://127.0.0.1:8080/sqli_2.php?movie=0 UNION SELECT 1,login,password,email,secret,6,7 FROM users LIMIT 1,1&action=go
movie=0 matches no real film, the UNION supplies the rows, and because this page only displays the first result, LIMIT 1,1 skips A.I.M. and shows bee. Your browser encodes the spaces for you. The lesson is the most important one in this walkthrough: escaping quotes does nothing when the input was never inside quotes.
High: the real fix
Switch to high and bWAPP silently redirects SQL Injection (GET/Select) to sqli_2-ps.php, a version that uses a prepared statement. The ID is sent to the database separately from the query, so nothing you type can change the SQL structure. bWAPP has no "View Source" button like DVWA, so open the PHP files from the ZIP (or the GitHub mirrors) and compare the two versions side by side. That comparison teaches more about SQL injection prevention than any slide deck.
Once you understand the manual steps, run sqlmap against the low level and compare its findings with yours. Our SQL injection chapter in the Web Application Attacks course covers blind and error-based techniques that bWAPP's other SQL pages expect you to know.
Walkthrough: Command Injection and Reflected XSS
OS Command Injection
This page offers a "DNS lookup" form. Behind it, the server runs shell_exec("nslookup " . $input), pasting whatever you typed into a shell command.
- Low: enter
127.0.0.1; whoami. The semicolon ends the nslookup command and starts a new one, so the output ends with the name of the account the web server runs as (usuallywww-data). Try127.0.0.1; lsnext and you will see the bWAPP files. - Medium: the code now strips
∧from your input. The pipe was not on the list, so127.0.0.1 | whoamistill works. This is the blacklist problem in one line: the developer blocked two separators and the shell has several more. - High: input goes through
escapeshellcmd(), which escapes every shell metacharacter. Command chaining stops working.
Cross-Site Scripting - Reflected (GET)
The page asks for a first and last name and prints "Welcome" followed by both. On low, put this in the first name field and anything in the last name:
<script>alert(document.cookie)</script>
A popup shows your PHPSESSID and security_level cookies. That is the whole point of XSS: script running in the victim's browser can read what the page can read.
Now switch to medium and send the same payload. It still fires. Medium on this page uses addslashes(), the same function from the SQL page, and the bWAPP source even carries the comment "Do NOT use this for XSS or HTML validations!!!". Your payload has no quotes, so there is nothing to escape. High uses htmlspecialchars(), which turns < into <, and the payload is displayed as harmless text.
Notice the pattern across all three walkthroughs: medium is always a filter that guesses what an attack looks like, and high is always a function that changes how the input is handled. That difference is the single most useful idea bWAPP teaches.
bWAPP vs DVWA vs WebGoat vs Juice Shop
All four are free and run locally, and they complement each other more than they compete.
| bWAPP | DVWA | WebGoat | Juice Shop | |
|---|---|---|---|---|
| Stack | PHP 5, MySQL | PHP, MariaDB | Java, Spring Boot | Node.js, Angular |
| Number of bugs | Over 100 | 19 modules | Dozens of lessons | 116 challenges |
| Still maintained | No, last release 2014 | Yes | Yes | Yes |
| Explains each bug | No | View Source and help pages | Yes, lesson first | Hints only |
| Best for | Seeing many bug variants | Comparing difficulty levels | Learning the theory | Realistic discovery |
Our take: bWAPP is the best of the four for breadth. Where DVWA gives you two SQL injection modules (classic and blind), bWAPP gives you eighteen, including injection through a login form, a CAPTCHA-protected form, a stored blog post and an HTTP header. It is the weakest at explaining itself and it will never get new bugs. If you are brand new, start with the explained lessons in our WebGoat tutorial, use DVWA's four security levels to see a single bug in depth, then come to bWAPP to practice variations until the patterns become automatic.
Legal and Ethical Considerations
Critical reminder: Always get explicit written authorization before testing any system. bWAPP on your own machine is authorized by definition. Anything you do not own needs permission in writing.
- The payloads work on real sites.
' UNION SELECTand; whoamibehave the same way on production servers. Trying them on a site you do not own is unauthorized access under the CFAA in the US, the Computer Misuse Act in the UK, and similar laws in most countries. - Public bWAPP instances are not invitations. Search results include bWAPP copies hosted by strangers. You do not know who runs them or what else is on that server. Use your own container.
- Mind the license. bWAPP's CC BY-NC-ND 4.0 license allows free use for learning, but not selling it or redistributing modified versions.
- Move to bug bounty programs for live targets. They give you written permission and a defined scope. Read the scope before you send a single request.
Frequently Asked Questions
What is the bWAPP default login?
The default bWAPP username is bee and the password is bug. The bee-box virtual machine uses the same bee/bug credentials. You can also create your own user from the "New User" link on the login page.
What does bWAPP stand for?
bWAPP stands for "buggy web application". It was created by Malik Mesellem as part of the ITSEC GAMES project, which aims to teach IT security through hands-on practice.
Why does bWAPP install.php not work on XAMPP?
bWAPP 2.2 was released in 2014 and many of its pages use the mysql_* PHP functions, which were removed in PHP 7.0. Current XAMPP versions ship PHP 8, so pages fail with errors. Use a Docker image such as raesene/bwapp, which bundles an old compatible LAMP stack.
What is the difference between bWAPP and bee-box?
bWAPP is the web application itself. bee-box is a Linux virtual machine with bWAPP preinstalled plus outdated server software, which makes extra bugs like Heartbleed, Shellshock and a remote buffer overflow exploitable. If you only want the web bugs, the Docker image is enough.
Is bWAPP still maintained?
No. The last release, version 2.2, came out in November 2014. The core web vulnerabilities it teaches are still relevant, but it will not receive new bugs or fixes. DVWA, WebGoat and OWASP Juice Shop are actively maintained alternatives.
Is bWAPP good for beginners?
Yes, once you know basic HTTP. Each page focuses on one bug, the low level has no protection at all, and the three security levels show you how weak filters fail. It does not explain the vulnerabilities, so pair it with a tutorial or course for the theory.
Your Next Steps
A good first bWAPP evening looks like this: run the Docker image bound to localhost, click install, log in with bee/bug, then work SQL Injection (GET/Search), OS Command Injection and XSS Reflected (GET) at low, medium and high. Write down why each medium filter failed. That list is your cheat sheet for every vulnerable app that comes after.
What bWAPP cannot give you is a fresh target that does not announce its bugs in a menu. When you are ready for that, try Query Quake for SQL injection or Ping Pwn for command injection, both running in your browser with flags to capture. For the theory behind every bug in this tutorial, the Web Application Attacks course walks through each vulnerability class in order. Start with HackerDNA's free tier - no credit card required.
Part of the OWASP Top 10 series
Related articles: