Last active
February 13, 2023 13:11
-
-
Save mrl22/43fee088ce58dcdddbe95f0ec05922e3 to your computer and use it in GitHub Desktop.
Find files by MD5 Checksum
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# We have a client who came to us with a website which was infected with a virus, we found that the virus overwrote and created new files all with the same md5 checksum. | |
# here is a snippet of code showing how we found all infected files, which could then be modified to delete the files. | |
find . -name '*.php' -type f -exec bash -c 'md5sum "$0" | grep -q e23bb1f44089aa4aeca6fbd5cf5addd8 && echo $0' {} \; | |
# Other useful commands | |
grep -rnw 'md5( sha1' * | |
grep -rnw 'md5( sha1' * | cut -d ':' -f 1 | xargs -I{} echo {} | |
grep -rnw 'md5( sha1' * | cut -d ':' -f 1 | xargs -I{} rm {} | |
grep -rnw 'basename( plugin_dir_path( __FILE__' * |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment