Last active
April 6, 2018 11:57
-
-
Save tmugford/7cf37e96a1bef006de351640bb8077f7 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# Limit Login Attempts Reloaded (https://en-gb.wordpress.org/plugins/limit-login-attempts-reloaded/) | |
# doesn’t currently offer a way to quickly add logged IP addresses to the blacklist. The following | |
# one-liner uses WP-CLI and JQ (https://stedolan.github.io/jq/) to quickly merge the entire lockouts | |
# log with the blacklist, which is useful when the site is experiencing distributed brute force | |
# attempts on wp-login.php | |
cat <(wp option get limit_login_blacklist --format=json | jq -r '.[]') <(wp option get limit_login_logged --format=json | jq -r 'keys_unsorted | .[]') | jq -s -R 'split("\n") | .[0:-1] | unique' | wp option update limit_login_blacklist --format=json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment