OWASP WebGoat Tutorial: Setup and First Lessons (2026)

Web Security
15 min read
OWASP WebGoat Tutorial: Setup and First Lessons (2026)
On this page
  1. What Is OWASP WebGoat?
  2. How to Install WebGoat With Docker
  3. First Login: There Is No Default Password
  4. Which WebGoat Lessons to Do First
  5. Walkthrough: The SQL Injection (Intro) Lesson
    1. Page 9: String SQL injection
    2. Page 10: Numeric SQL injection
    3. Page 11: Compromising confidentiality
  6. Setting Up Burp Suite or ZAP With WebGoat
  7. Three Lessons Worth Your Time After SQL Injection
    1. JWT tokens
    2. Insecure Direct Object References
    3. The Challenges
  8. WebGoat vs DVWA vs OWASP Juice Shop
  9. Legal and Ethical Considerations
  10. Frequently Asked Questions
  11. Your Next Steps

Most vulnerable practice apps hand you a target and wish you luck. WebGoat does something different: it teaches first, then lets you attack. Every lesson explains a vulnerability in plain language, shows you the broken code pattern, and only then gives you a form to exploit. For a beginner who wants to understand why an attack works rather than just copy a payload, that order makes a real difference.

OWASP WebGoat is a free, deliberately insecure Java application, and its lesson menu follows the OWASP Top 10 category by category. This WebGoat tutorial covers the Docker install, the account you have to create yourself, the lessons worth doing first, and a worked solution for the SQL injection lesson that trips up most newcomers. If you would rather attack something in your browser in the next two minutes with nothing to install, our Web Application Attacks course covers the same vulnerability classes with hosted labs.

TL;DR: WebGoat is OWASP's lesson-based vulnerable web app. Run docker run -it -p 127.0.0.1:8080:8080 -p 127.0.0.1:9090:9090 webgoat/webgoat, open http://127.0.0.1:8080/WebGoat, and register your own user (there is no default login). Start with the General lessons, then the SQL Injection (intro) lesson in the Injection category. Change Burp Suite's listener port first, because both default to 8080.

What Is OWASP WebGoat?

OWASP WebGoat is a deliberately insecure web application, maintained by the Open Worldwide Application Security Project, that teaches web security through short interactive lessons: each one explains a vulnerability, then asks you to exploit it in a built-in exercise. It is free and open source under the GPL-2.0-or-later license.

It is also one of the oldest training targets still in active development. Early versions were announced on the webappsec mailing list in 2002 by Jeff Williams and Bruce Mayhew of Aspect Security. The current code is a Spring Boot application, and the project ships regular releases: the latest at the time of writing is v2026.5, published in October 2026, which added lessons on HMAC timing attacks, password storage, command injection and HTTP parameter pollution.

Three things set it apart from the other free targets:

  • The lessons are the product. Each lesson is a series of numbered pages. Most pages are a short explanation followed by an assignment, and the page bar at the top marks the assignments you have already solved.
  • The menu maps to the OWASP Top 10. Categories are labeled (A1) Broken Access Control, (A2) Cryptographic Failures, (A3) Injection and so on. They use the 2021 numbering, so the labels do not match the 2025 edition one for one, but the vulnerability classes are the same.
  • It ships an attacker sidekick called WebWolf. WebWolf runs on port 9090 and plays the role of your attacker server: it hosts files and logs incoming requests, which you need for lessons like XXE and password reset where the victim app has to call out to you.

The OWASP project page lists it as a Lab project in the training category. In plain terms: this is the official OWASP teaching app, not a side project somebody abandoned on GitHub.

How to Install WebGoat With Docker

Docker is the install to use. WebGoat needs a recent Java runtime to run from the JAR (the current build targets Java 25), and the container saves you from managing that yourself.

  1. Check Docker works. Run docker version. If it returns both a client and a server version, you are ready. On Windows and macOS, Docker Desktop has to be running in the background.
  2. Start the container. Run the command from the official README:
    docker run -it -p 127.0.0.1:8080:8080 -p 127.0.0.1:9090:9090 webgoat/webgoat
    The 127.0.0.1: prefix on each port matters. It binds WebGoat to your own machine only, so nobody else on your network can reach it.
  3. Set your timezone. A few lessons compare times between your browser and the server. Add -e TZ=Europe/Paris (or your own zone) to the command so they line up.
  4. Open it. Browse to http://127.0.0.1:8080/WebGoat. WebWolf lives at http://127.0.0.1:9090/WebWolf. The capital letters in the path are not optional, and http://127.0.0.1:8080/ on its own will not show you the app.

The startup log is long. Wait for the line saying the application has started before you open the browser, which usually takes under a minute on a laptop.

There are two alternatives. If you do not want to install Burp or ZAP on your own machine, the webgoat/webgoat-desktop image runs a full Linux desktop in your browser with the tools preinstalled: docker run -p 127.0.0.1:3000:3000 webgoat/webgoat-desktop, then open port 3000. And if you already have the right Java version, the standalone JAR from the releases page runs with java -jar webgoat-<version>.jar.

Keep it off the internet. The WebGoat README warns that your machine is "extremely vulnerable to attack" while it runs, and several lessons give you command execution on the host. Never drop the 127.0.0.1: prefix to make it reachable from another device, and never run it on a public server.

First Login: There Is No Default Password

This is the question that sends most beginners to a search engine. WebGoat has no default username or password. On first visit you click the register link under the login form and create your own account. The account only exists inside your local WebGoat, so use something throwaway.

The registration form is stricter than it looks, and its error messages are easy to miss:

  • Username: 6 to 45 characters, lowercase letters, digits and hyphens only. Alice fails twice (too short and uppercase). alice-01 works.
  • Password: 6 to 10 characters. A long password manager string gets rejected, which surprises people.
  • Progress: your solved lessons are stored inside the container. If you delete the container, you start from zero. Stop it with Ctrl+C and restart it with docker start -ai <container-name> instead of running a fresh one. docker ps -a shows the name Docker gave it.

Once you are in, the left menu shows the lesson categories and the top bar has a language selector. The interface is available in English, French, German, Spanish and Dutch, though not every lesson is translated.

💻
Practice this now: Query Quake - a UNION-based SQL injection challenge that runs in your browser, so you can try the technique before your Docker install has even finished.

Which WebGoat Lessons to Do First

The menu is ordered like the OWASP Top 10, which is a sensible reference order and a poor learning order. Broken Access Control sits first because it is the top risk, not because it is the easiest place to start. Here is the route we recommend for a complete beginner:

Order Category Lessons Why now
1 General HTTP Basics, HTTP Proxies, Developer Tools Every later lesson assumes you can read and modify a request
2 (A3) Injection SQL Injection (intro), then Cross Site Scripting The clearest cause-and-effect lessons in the app
3 (A1) Broken Access Control Insecure Direct Object References, Missing Function Level Access Control The bug class behind most real bug bounty payouts
4 (A7) Identity & Auth Failure JWT tokens, Authentication Bypasses, Password reset Modern apps live and die by their tokens
5 Challenges Admin lost password, Without password, and the rest No hand-holding, closest to a CTF

Two categories are worth leaving for later. SQL Injection (advanced) and the mitigation lesson are much denser than the intro, and Insecure Deserialization expects you to be comfortable with Java object serialization. You will also notice there is no A4 in the menu. Insecure Design is hard to turn into a single exercise, so the app skips it.

Do not skip the HTTP Basics lesson because it looks too easy. It asks you to find a hidden "magic number" in the request using your browser's developer tools, and that habit of reading every request is what the rest of WebGoat is built on.

Walkthrough: The SQL Injection (Intro) Lesson

This lesson lives under (A3) Injection and has 13 pages. Pages 2 to 5 are a gentle SQL refresher: you get full admin rights and write normal queries, such as SELECT department FROM employees WHERE first_name='Bob' AND last_name='Franco'. The injection starts on page 9.

Page 9: String SQL injection

You are shown the query the server builds:

"SELECT * FROM user_data WHERE first_name = 'John' and last_name = '" + accountName + "'"

Instead of a text box, you get three dropdowns, and the goal is to return every row in the table. Pick Smith', then or, then '1' = '1. The query becomes:

SELECT * FROM user_data WHERE first_name = 'John' and last_name = 'Smith' or '1' = '1'

The quote after Smith closes the string early, or '1' = '1' is true for every row, and the final quote is supplied by the application itself. That last detail is why the option '1' = '1' with a closing quote fails: you would end up with one quote too many and a syntax error.

Page 10: Numeric SQL injection

Two fields this time, Login_Count and User_Id, and the lesson warns that only one of them is injectable. Look at how the server code handles them: Login_Count goes through a prepared statement, while User_Id is pasted straight into the query string. So any number works in the first field, and the second gets the payload:

Login_Count: 1
User_Id:     1 or 1=1

No quotes are needed, because a numeric value is not wrapped in quotes in the query. This page teaches something more useful than the payload: a single parameterized field does not make a query safe. One concatenated value is enough.

Page 11: Compromising confidentiality

Now the story gets more realistic. You are John Smith, your TAN (an authentication code) is 3SL99A, and you want to see your colleagues' salaries. The query is:

"SELECT * FROM employees WHERE last_name = '" + name + "' AND auth_tan = '" + auth_tan + "'"

Enter Smith as the name and ' OR '1'='1 as the TAN. The WHERE clause turns into last_name = 'Smith' AND auth_tan = '' OR '1'='1'. Because AND is evaluated before OR, the whole condition is true and every employee comes back.

Pages 12 and 13 continue the same story: you chain a second query with ; to raise your own salary, then delete the access_log table that recorded what you did. Together the three pages walk you through confidentiality, integrity and availability, the CIA triad, in the order an attacker would break them.

In practice, the best feature of this lesson is the feedback. After each attempt WebGoat prints "Your query was:" followed by the exact SQL it ran. When a payload fails, read that line before you try anything else. Nine times out of ten the problem is a quote you counted wrong. Once these pages feel easy, the SQL Injection (advanced) lesson moves on to UNION attacks and blind injection, which is where real-world SQL injection gets interesting.

Setting Up Burp Suite or ZAP With WebGoat

From the HTTP Proxies lesson onwards, many assignments expect you to intercept and edit requests. Two problems catch nearly everyone the first time.

Port 8080 is taken twice. Burp Suite's proxy listener defaults to 127.0.0.1:8080, which is exactly where WebGoat is running. Whichever starts second fails or behaves strangely. The easy fix is in Burp: go to Proxy settings and change the listener to 127.0.0.1:8081, then point your browser or FoxyProxy at 8081. Leave WebGoat on 8080, because WebWolf and several lessons expect the default ports.

Browsers skip the proxy for localhost. Modern browsers send requests to localhost and 127.0.0.1 directly, ignoring your proxy settings, so Burp sees nothing. The WebGoat README solves this with host entries. Add this line to /etc/hosts (or C:\Windows\System32\drivers\etc\hosts on Windows):

127.0.0.1 www.webgoat.local www.webwolf.local

Then start the container with two extra variables so the app generates matching links:

docker run -it -p 127.0.0.1:8080:8080 -p 127.0.0.1:9090:9090 \
  -e WEBGOAT_HOST=www.webgoat.local -e WEBWOLF_HOST=www.webwolf.local \
  -e TZ=Europe/Paris webgoat/webgoat

Browse to http://www.webgoat.local:8080/WebGoat/ and your traffic now flows through the proxy. If you have never used one, our Burp Suite tutorial covers intercepting, Repeater and the basic workflow you will need for the rest of WebGoat.

Three Lessons Worth Your Time After SQL Injection

Once the intro lesson clicks, these three give you the most transferable skill per hour.

JWT tokens

The JWT lesson starts by decoding a token, then asks you to tamper with one to become an admin and reset the votes in a small voting app. A later page hands you a token signed with a weak HMAC secret and asks you to crack the key offline, then forge a new token with the username changed. This is one of the best free JWT exercises anywhere, because it makes you understand the signature instead of treating it as noise.

💻
Practice this now: JWT Bypass - crack a weak signing secret and forge your own token against a fresh target, with a flag waiting at the end.

Insecure Direct Object References

You log in as one user, look at your own profile, and notice that the data coming back includes your internal user ID. Request a profile with a different ID, and you are reading another user's data. Then you edit it. IDOR bugs are simple to understand and extremely common in real applications, and this lesson shows you the full loop of spotting the ID, guessing a neighbor, and proving impact.

The Challenges

The final category (labeled Security exercises in recent builds) drops the explanations. Each exercise gives you an outcome, such as "Can you login as Larry?", and a flag field to submit when you get there. It feels much closer to a beginner CTF than the rest of the app. Do not start here, but come back once you have finished the Injection and Broken Access Control lessons, and treat it as your exam.

WebGoat vs DVWA vs OWASP Juice Shop

These three are the classic free local targets, and they are better together than as rivals. The honest difference is how much each one teaches versus how much it makes you find.

WebGoat DVWA Juice Shop
Stack Java, Spring Boot PHP, MariaDB Node.js, Angular
Explains each bug Yes, a lesson before every exercise Partly, through View Source No, you find bugs yourself
Difficulty levels Intro and advanced lessons Low to Impossible 1 to 6 stars
Realistic discovery Low Low High
Best for Learning the theory and the vocabulary Seeing root cause in source code Practicing like a real test

Our take: start with WebGoat if you are coming from zero and want to know what an injection, a token or an access check actually is. Use DVWA when you want to watch the same bug survive three increasingly clever filters. Move to OWASP Juice Shop once you can solve exercises without hints, because it is the only one of the three that makes you find the vulnerable endpoint yourself.

WebGoat has real weaknesses too. Some lessons break between versions, and an answer that worked in an old write-up may not match the current page. The hints sometimes give away the whole solution if you click through all of them. And because every lesson tells you which vulnerability you are looking at, it trains recognition far more than discovery. Use it to learn the concepts, then move on.

Critical reminder: Always get explicit written authorization before testing any system. WebGoat on your own machine is authorized by definition. Any system you do not own needs permission in writing.

  • WebGoat's own warning is worth repeating. The README says that if you are caught attacking systems without authorization, "claiming that you were doing security research will not work."
  • The payloads are real. ' OR '1'='1 works the same way on a production login form. Trying it on a site you do not own is unauthorized access under the CFAA in the US, the Computer Misuse Act in the UK, and equivalent laws almost everywhere else.
  • Stay inside the app. The Challenges introduction asks you to keep your work within WebGoat and not to target other systems or learners. That applies to shared classroom installs too.
  • Use 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 WebGoat default username and password?

There is none. WebGoat asks you to register your own account on first visit. The username must be 6 to 45 characters using lowercase letters, digits and hyphens, and the password must be 6 to 10 characters. The account exists only in your local installation.

What URL and port does WebGoat use?

WebGoat runs on port 8080 at http://127.0.0.1:8080/WebGoat, and its companion WebWolf runs on port 9090 at http://127.0.0.1:9090/WebWolf. The path is case sensitive, so /webgoat in lowercase will not load the app.

Is WebGoat free?

Yes. WebGoat is an open source OWASP project released under the GPL-2.0-or-later license. The Docker images and release JARs are free to download from Docker Hub and GitHub, and there is no paid tier.

What is WebWolf in WebGoat?

WebWolf is a separate small web application that ships with WebGoat and simulates an attacker's server. It can host files you want the victim application to fetch and records incoming requests, which several lessons need. You only use it when a lesson shows the wolf icon.

Does WebGoat have flags like a CTF?

Only in its final category. Regular lessons check your answer automatically and mark the assignment as solved. The Challenges section (Security exercises in recent builds) gives you a goal without instructions and asks you to submit a flag, which makes it the most CTF-like part of the app.

Should I learn WebGoat or Juice Shop first?

WebGoat first if you are a complete beginner, because every exercise comes with an explanation of the vulnerability. Juice Shop hides its vulnerabilities inside a modern shopping app and gives no explanations, which is better practice once you know what you are looking for.

Your Next Steps

A good WebGoat routine is simple: run the Docker image bound to localhost, register a throwaway account, do the General lessons, then work through SQL Injection (intro) while reading the "Your query was" output after every attempt. Change Burp's port before you need it, and save the Challenges for when the lessons stop feeling hard.

What WebGoat cannot give you is a target that does not explain itself. When you are ready for that, try Query Quake for SQL injection or JWT Bypass for token forgery, both running in the browser with nothing to install. Our Web Application Attacks course walks through each vulnerability class in order. Start with HackerDNA's free tier - no credit card required.

HackerDNA Team

HackerDNA Team

Written by the HackerDNA team - cybersecurity professionals building hands-on hacking labs and educational content to help you develop real-world security skills.

Meet the Team

Ready to put this into practice?

Stop reading, start hacking. Real machines, in your browser, free.

Start Hacking Free
39,000+ Hackers Real labs Free
Start Hacking Free or solve today's hack, no account needed