Skip to main content

Posts

Showing posts with the label directory checksum

Directory Checksum

Recently I found on some of my websites suspicious files. After some research I discovered that most of my custom html and php files were also modified and were containing base64 encoded code. So I decided to make universal script that will allow me to take site fingerprint and then manually check it for any changes in my files weekly. This php script takes md5sums of all files in directory specified (including subdirectories) and save the result in custom data file. The next time you run it it will show you new files, files that were not changed and files that WERE CHANGED. The output and some other options can be customized inside the code itself. Anyway if you have ssh access to your webserver, you can do almost the same by running find test5 -type f | xargs md5sum <?php #comment this if you want to debug the script error_reporting(0); function lookDir($path) {   $handle = @opendir($path);   if (!$handle)   return false;   while ($item = readdi...