PHP Wrappers
Try to gain RCE using one of the PHP wrappers and read the flag at /
Step 1 - Check if allow_url_include is on:
Capture the php.ini file:
curl "http://SERVER_IP:SERVER_PORT/index.php?language=php://filter/read=convert.base64-encode/resource=../../../../etc/php/7.4/apache2/php.ini"
Copy the base64 string (W1BIUF0KCjs7Ozs7Ozs7O ...SNIP ... 4dGVuc2lvbj1leHBlY3QK) to a file
Look for the allow_url_file with the command
cat curl.txt | base64 -d | grep allow_url_include
Step 2 - Remote Code Execution:
Base64 encode a PHP web shell:
Test the web shell:
Look for the flag on the / directory:

Retrieve the flag:

And we got the flag!
Last updated