Skip to content

PHP script that scans all files in a directory, identifying if there are chunks of text/code in each file, and can remove it if necessary

Notifications You must be signed in to change notification settings

guiaparicio/phpScanDirectory

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

What does this script do?

PHP script that scans all files in a directory, identifying if there are chunks of text/code in each file, and can remove it if necessary.

alt text

Example of use:

Search for files that contain malicious code chunks after a JS injection attack on your WordPress website

Config

Before running the scan.php file, properly configure the variables existing at the beginning of the file.

// Enter the directory to be scanned here Ex: /home/myuser/var/www/html/
$dir = "/YOUR DIRECTORY HERE/"; 

// Include the code to be searched for in this file
$code = file_get_contents("code.txt");

// Set true if you want to remove the code when found
$removeCode = false; 

// Set types of files that will be searched
$searchExtensions = ["js","php","txt"];

Requeriments


PHP7+

About

PHP script that scans all files in a directory, identifying if there are chunks of text/code in each file, and can remove it if necessary

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages