PHP Shell Scanner is a tool designed to scan directories recursively for PHP files and detect the usage of sensitive functions. This tool helps in identifying potential security risks in your PHP code by logging the occurrences of functions that can be used for malicious purposes.
- Scans directories recursively for PHP files.
- Detects files with a variety of PHP-related extensions.
- Identifies and logs the usage of sensitive functions such as
exec,eval,system, and more. - Provides an easy-to-use web interface for specifying the directory to scan.
The following functions are considered sensitive and are checked by this tool:
execshell_execsystempassthruevalpopenproc_openfile_put_contentsfwritefopenfile_get_contentsunlinkrenamecopymove_uploaded_filescandiropendirreaddir
This tool scans files with the following extensions:
.php.php2.php3.php4.php5.php6.php7.phps.pht.phtm.phtml.pgif.shtml.htaccess.phar.inc.hphp.ctp.module
-
Clone the repository:
git clone https://github.com/yourusername/php-shell-scanner.git cd php-shell-scanner -
Make sure you have a web server running with PHP support.
-
Place the
scanner.phpfile in your web server's root directory or any accessible directory.
-
Open your web browser and navigate to the location of
scanner.phpon your web server. -
Enter the directory you want to scan in the input field and click the "Scan" button.
-
The tool will scan the specified directory recursively and log any occurrences of sensitive functions in a file named
sensitive_functions_log.txt. -
After the scan is complete, a link to the log file will be provided. Click the link to view the details.
Here's an example of how to use the PHP Shell Finder:
-
Navigate to
http://yourserver.com/php-shell-scanner/scanner.phpin your web browser. -
Enter the path to the directory you want to scan (e.g.,
/var/www/html). -
Click the "Scan" button.
-
After the scan completes, check the
sensitive_functions_log.txtfile for the results.
Contributions are welcome! Please feel free to submit a Pull Request.