Skip to content

This script checks which potentially dangerous PHP functions are still enabled in PHP configuration

Notifications You must be signed in to change notification settings

DiabloHTB/PHP-malicious-function-checker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

PHP Dangerous Functions Checker

This script checks which potentially dangerous PHP functions are still enabled in PHP configuration based on a given list of disabled functions. It helps you identify PHP functions that could be exploited.

Usage

Use phpinfo() to get a list of disabled fucntions under disable_functions from the target and clone this repository to your local machine and run the scrtipt:

git clone https://github.com/DiabloHTB/php-dangerous-functions-checker.git
cd php-dangerous-functions-checker
python3 php_function_check.py "list,of,disabled,fucntions" #Copy the list directly from the phpinfo page

Example

┌──(diablo㉿diablo)-[~]
└─$ python3 php_function_check.py "exec,system,passthru,proc_open,pcntl_exec,file_get_contents,fopen,include,include_once,require,require_once,fsockopen,pfsockopen,stream_socket_client,eval,create_function,preg_replace,assert,unserialize"
The following potentially dangerous PHP functions are still enabled:

- shell_exec
- popen
- extract

Check the following link on how to abuse them: https://book.hacktricks.xyz/network-services-pentesting/pentesting-web/php-tricks-esp/php-useful-functions-disable_functions-open_basedir-bypass
  ____ ___    _    ____  _     ___  
 |  _ \_ _|  / \  | __ )| |   / _ \ 
 | | | | |  / _ \ |  _ \| |  | | | |
 | |_| | | / ___ \| |_) | |__| |_| |
 |____/___/_/   \_\____/|_____\___/ 

Disclaimer

This script is for educational and security auditing purposes only. Use it at your own risk. The authors are not responsible for any misuse or damage caused by this script.

About

This script checks which potentially dangerous PHP functions are still enabled in PHP configuration

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages