Skip to content

Instantly share code, notes, and snippets.

@ethanpil
Last active September 4, 2023 22:33
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 ethanpil/b5fc976b9761783ed1b73d203a7148d6 to your computer and use it in GitHub Desktop.
Save ethanpil/b5fc976b9761783ed1b73d203a7148d6 to your computer and use it in GitHub Desktop.
Hacked Wordpress Command Line Tools
# Find suspicious php files
find . -type f -name '*.php' | xargs egrep -i "(mail|fsockopen|pfsockopen|stream\_socket\_client|exec|system|passthru|eval|base64_decode) *("
# Find suspicious images
find wp-content/uploads -type f -iname '*.jpg' | xargs grep -i php
#Find iframes
find . -type f -name '*.php'| grep -i '<iframe'
#Find files modified in last 3 days
find . -type f -name '*.php' -ctime -3
# Verify checksums of code and identify unexpected files
wp core verify-checksums
wp plugin verify-checksums --all
# WP-CLI Force refresh of all wordpress plugins and theme files
wp core download --force
wp plugin install $(wp plugin list --field=name) --force
wp theme install $(wp theme list --field=name) --force
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment