Skip to content

What to do after a WordPress brute-force attack

A senior-engineer runbook for the hours immediately after a brute-force run against a WordPress site — what to check, what to rotate, what to keep watching.

A brute-force run that filled the access log with wp-login.php POSTs is rarely a clean miss. Either the attacker found a credential and is now sitting on it, or they confirmed the site is exploitable and queued it for a more interesting payload later. Either way, “we blocked the IP” is not a finish line.

What’s happening

A brute-force window typically leaves three forensic surfaces: the web server access logs, the WordPress user activity (last login, post and option mutations), and the filesystem (recently modified PHP files). If any administrator account had a weak or reused password, assume it succeeded at least once during the window and work backwards from there.

How to verify

Start with the access log. Identify the attack window and the IPs involved:

grep 'POST /wp-login.php' access.log \
  | awk '{print $1}' | sort | uniq -c | sort -rn | head -20

Look for status 302 responses to wp-login.php POSTs — those are successful logins, not blocked attempts:

grep 'POST /wp-login.php HTTP/[12].[01]" 302' access.log

Then check WordPress itself:

wp user list --fields=ID,user_login,user_registered --orderby=user_registered --order=DESC
wp option get active_plugins
find wp-content -name '*.php' -newer /tmp/window_start -mtime -7

Any new administrator account, any plugin activated outside your deploy window, or any PHP file modified during the attack window is treated as a breach until proven otherwise.

The fix

  1. Rotate every administrator password and force re-authentication site-wide. With WP-CLI: wp user reset-password $(wp user list --role=administrator --field=ID).
  2. Invalidate active sessions: wp user session destroy --all $(wp user list --role=administrator --field=ID).
  3. Rotate any application passwords, REST API keys, and integration tokens that touched the site.
  4. Diff wp-content/ against the known-good copy from your last clean backup. Anything unexplained gets replaced from source control, not edited in place.
  5. Pull the database password, salts, and AUTH_KEY constants from wp-config.php and rotate every one — these are how an attacker keeps a foothold after you “fixed” the issue.
  6. Re-run the access log scan for the 7 days before the visible attack window. Brute-force is often the noisy second stage; the quiet first stage is what actually got in.

The hard part of post-brute-force is knowing what “back to normal” looks like. That’s the kind of decision our on-call engineers own under Monitoring & Support.