Skip to content

Instantly share code, notes, and snippets.

@mrl22
Last active February 13, 2023 13:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrl22/43fee088ce58dcdddbe95f0ec05922e3 to your computer and use it in GitHub Desktop.
Save mrl22/43fee088ce58dcdddbe95f0ec05922e3 to your computer and use it in GitHub Desktop.
Find files by MD5 Checksum
# 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