This vulnerability was published in packetstorm. I converted it into Chinese and added some annotations to execute it on NT.
PHP friends have some help.
After you download PHP, the installation file in it helps PHP install in NT + Apache Web Server
The installation help will require you to add the following lines to the httpd. conf configuration file of Apache.
It will guide you to open your System Portal.
The command lines are as follows:
ScriptAlias/PHP/"C:/PHP /"
Addtype application/X-httpd-PHP. php
Action application/X-httpd-PHP "/PHP/php.exe"
We will further explain these three settings. These settings commands require Apache to directly map the/PHP/virtual directory to C:/PHP/
Directory, so when you use:
Http://www.example.com/php"
When you link a webpage, the web server directly accesses the C:/PHP/directory. At this time, you will see "Access Denied"
But when you use:
Http://www.example.com/php/php.exe"
Command to connect, you will find that the server sent back the "no input file specified." line, this line of words is by php.exe
The returned message indicates that you have just executed the PHP Execution file on this server.
If your server is configured using the installation method taught in PHP, you may have the following crisis.
[** Vulnerability 1 **]
We can exploit this vulnerability to read any file on this server, or even read it across disks, as long as the connection is as follows:
"Http://www.example.com/php/php.exe? C: \ winnt \ repair \ SAM"
PHP will throw the file "C: \ winnt \ repair \ SAM" to the browser and display it. This file is exactly Windows NT
Save the password,
"Http://www.example.com/php/php.exe? D: \ winnt \ repair \ SAM"
PHP will output the same file in D: disk.
With this Sam file, hackers can crack the password you set on this machine.
[** Vulnerability 2 **]
If you specify a file in the PHP Directory, your web server will attempt to execute this file and send an error message, so when you
Used:
Http://www.example.com/php/php4ts.dll"
This error will cause the web server to return "Couldn <|> T create child process: 22693: C:/PHP/php4ts. dll"
This information leaks the real directory of your PHP installation.
PS. After my tests, the second vulnerability will return the "internal server error" error when executed on PHP v4.11,
The directory structure is not leaked, but the first vulnerability is still valid in PHP v4.11.
Simple Solution: Use a long and difficult-to-determine virtual directory to place PHP Execution files, for example:
ScriptAlias/PHP-my-script/"C:/php411 /"
Addtype application/X-httpd-PHP. php
Action application/X-httpd-PHP "/PHP-my-script/php.exe"
In this way, intruders will not be able to learn about the directory where PHP is stored, thus reducing the chance of intrusion.
After changing httpd. conf, remember to restart apache service:
Net stop Apache
Net start Apache
[End]