SoFunction
Updated on 2025-03-10

PHP Hazard Function Interpretation Analysis

-disable-cli can be used at compile time. Once PHP is compiled and generated in CLI mode, it may be caused by an intruder
Use this program to create a WEB Shell backdoor process or execute arbitrary code through PHP!

phpinfo()
Function description: Output PHP environment information and related modules, WEB environment and other information.
Hazard level: Medium

passthru()
Function Description: Allows to execute an external program and echo the output, similar to exec().
Hazard level: High

exec()
Function Description: Allows execution of an external program (such as UNIX Shell or CMD commands, etc.).
Hazard level: High

system()
Function description: Allows to execute an external program and echo the output, similar to passthru().
Hazard level: High

chroot()
Function description: Can change the working root directory of the current PHP process only if the system supports CLI mode
Only work in PHP, and this function is not applicable to Windows systems.
Hazard level: High

scandir()
Function Description: Lists files and directories in the 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 the 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: Get information about the process opened using proc_open().
Hazard level: High

error_log()
Function Description: Send error messages to the specified location (file).
Security Note: In some versions of PHP, 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, and the function is the same as ini_set().
For details, see ini_set().
Hazard level: High

ini_set()
Function description: Can be used to modify and set PHP environment configuration parameters.
Hazard level: High

ini_restore()
Function Description: Can be used to restore PHP environment configuration parameters to their initial values.
Hazard level: High

dl()
Function description: Load a PHP external module during PHP run (rather than at startup).
Hazard level: High

pfsockopen()
Function description: Establish a socket persistent connection to the Internet or UNIX domain.
Hazard level: High

syslog()
Function description: The system-level syslog() function of the UNIX system can be called.
Hazard level: Medium

readlink()
Function description: Returns the content of the target file pointed to by the symbolic connection.
Hazard level: Medium

symlink()
Function description: Create a symbolic link in the UNIX system.
Hazard level: High

popen()
Function description: A command can be passed through the popen() parameter and execute the file opened by popen().
Hazard level: High

stream_socket_server()
Function description: Establish an Internet or UNIX server connection.
Hazard level: Medium

putenv()
Function Description: Used to change the system character set environment while PHP is running. This function can be utilized in PHP versions below 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