Explanation of PHP dangerous functions

Source: Internet
Author: User

You can use-Disable-cli during compilation. Once PHP in CLI mode is compiled and generated, it may be attacked.
Use this Program Create a web shell backdoor process or execute arbitrary code through PHP Code !

Phpinfo ()
Function Description: outputs information about the PHP environment, related modules, and Web environment.
Hazard level: Medium

Passthru ()
Function Description: allows execution of an external program and echo output, similar to Exec ().
Hazard level: high

Exec ()
Function Description: allows execution of an external program (such as a Unix shell or cmd command ).
Hazard level: high

System ()
Function Description: allows execution of an external program and echo output, similar to passthru ().
Hazard level: high

Chroot ()
Function Description: change the working root directory of the current PHP process, only when the system supports the CLI Mode
PHP only works, and this function is not applicable to Windows systems.
Hazard level: high

Scandir ()
Function Description: Lists files and directories in a specified path.
Hazard level: Medium

Chgrp ()
Function Description: Change the user group to which the file or directory belongs.
Hazard level: high

Chown ()
Function Description: Change the owner of a file or directory.
Hazard level: high

Shell_exec ()
Function Description: Execute the command through shell and return the execution result as a string.
Hazard level: high

Proc_open ()
Function Description: execute a command and open the file pointer for reading and writing.
Hazard level: high

Proc_get_status ()
Function Description: gets information about the processes opened with proc_open.
Hazard level: high

Error_log ()
Function Description: sends an error message to a specified location (file ).
Security note: In some PHP versions, error_log () can be used to bypass PHP safe mode,
Execute any command.
Hazard level: low

Ini_alter ()
Function Description: it is an alias function of the ini_set () function. Its function is the same as that of ini_set.
For more information, see ini_set ().
Hazard level: high

Ini_set ()
Function Description: used to modify and set PHP environment configuration parameters.
Hazard level: high

Ini_restore ()
Function Description: used to restore the PHP environment configuration parameters to their initial values.
Hazard level: high

DL ()
Function Description: loads a PHP external module while PhP is running (rather than starting.
Hazard level: high

Pfsockopen ()
Function Description: establishes a socket persistent connection in the internet or Unix domain.
Hazard level: high

Syslog ()
Function Description: You can call the system-layer syslog () function of a UNIX system.
Hazard level: Medium

Readlink ()
Function Description: returns the content of the target file to which the symbolic connection points.
Hazard level: Medium

Symlink ()
Function Description: Creates a symbolic link in a UNIX system.
Hazard level: high

Popen ()
Function Description: You can pass a command through the popen () parameter and execute the file opened by popen.
Hazard level: high

Stream_socket_server ()
Function Description: establishes an internet or Unix server connection.
Hazard level: Medium

Putenv ()
Function Description: used to change the system Character Set environment when PHP is running. This function can be used in PHP versions earlier than 5.2.6.
After modifying the system Character Set environment, use the sendmail command to send special parameters to execute the system shell command.
Hazard level: high

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.