Skip to content

Brute-Forcing WordPress Logins: How the Attack Works

Brute-forcing is a numbers game played against the login form. An attacker does not break the password, he guesses it, and the only thing standing between a guess and a dashboard is how many attempts the server allows before it stops answering.

The cost of a guess has fallen for ten years. A rented botnet, a proxy pool and a list of leaked passwords turn a slow manual job into a script that tries thousands of combinations an hour. The defence did not get cheaper, it got simpler: count attempts, raise the price of each one, and make the last step useless without a second factor.

Three shapes of the same attack

Classic guessing tries common passwords against one account. The list comes from breaches, so the first hundred attempts are the ones people actually use: the site name with a year, a child’s name, a keyboard pattern. This is cheap and still works, because a password reused from an old forum is not a weak password in the attacker’s eyes, it is the password.

Password spraying moves in the other direction. One common password is tried against every account on the site, so the counter per account never rises and the lockout never fires. A hundred users, one guess each, and the attacker waits for one success.

Credential stuffing uses pairs stolen elsewhere. No guessing at all: the script replays email and password pairs from a breach against the login form, the REST API or XML-RPC. Against a site with no second factor and no rate limit this works at a rate of about one success per few hundred pairs.

What the server sees

Every attempt is a POST request. The address changes between batches, the browser header looks real, and the request arrives at the same speed as a person typing. Nothing in the body marks it as hostile.

The signal lives in the aggregate. Forty addresses, five attempts each, against the same twenty usernames in ten minutes is not a busy morning, it is a pattern. A single-address limit sees nothing here, which is why the counter runs per subnet as well.

The second signal is the answer time. A login page that replies in 200 ms for a wrong password and 900 ms for a right one tells the attacker which half of the pair is correct. Equal timing is part of the defence, not a performance detail.

Where a per-address limit fails

A limit of five attempts per hour sounds strict until the addresses rotate. A proxy pool gives the attacker a fresh address for every ten requests, and the counter resets before it matters.

Headers can be forged. A missing or invented X-Forwarded-For moves the counter to whatever address the script chooses. The plugin reads the address the connection came from and trusts the header only when a proxy is configured in front of the site.

XML-RPC is the cheapest door. One request can carry hundreds of login attempts, so a limit of five per hour is bypassed by a single call. A site that does not publish from a desktop client does not need XML-RPC at all, and closing it removes the door instead of guarding it.

Application passwords are the quiet path. The REST API accepts a separate credential, and a limit that watches only wp-login.php never sees the request.

The ladder: attempts, cost, ban

A useful protection has three steps and one budget. BotBlocker uses five failed logins in fifteen minutes for the slow path, a CAPTCHA at around thirty requests per minute, and a ban at fifty. The numbers are settings, because an office behind one address and a password manager do not behave like a single person on a laptop.

The order matters. Banning on the first failure locks out the owner who forgot which password belongs to which site. Sending every attempt to a CAPTCHA after one wrong password punishes normal people. The ladder starts with a pause, then adds a task, then closes the door, and it resets after a quiet period.

A ban that grows with each return visit is what makes the attack expensive. A fixed ban is a wait, and a script can wait.

The second factor ends the argument

A correct password stops being enough. With TOTP enabled, the attacker needs a code from the account holder’s device, and ten backup codes per account cover a lost phone. Five attempts at a six-digit code is a different problem from five attempts at a word, and the counter is separate.

The second factor does not replace the ladder. It removes the value of a correct password that came from a breach, which is the one case the ladder cannot see: the right password from a clean address looks like the owner logging in.

What to watch afterwards

The event log is where the attack becomes visible. Each entry keeps the address, the path and the rule that fired, with 55 event codes in 12 categories. Read the bans first, then the addresses that returned, then the usernames they aimed at. A wave that stops after a ban is a script that moved on. A wave that continues from new addresses is a botnet, and the next step is the firewall layer, before WordPress loads.

One scan is never proof that the site is clean, and one quiet night is never proof that the attack ended.

Questions we hear

How do I stop a brute force attack on WordPress?

Raise the cost of every attempt: a limit per address and per subnet, a challenge after a few failures and a second factor on each admin account. Blocking a single IP only moves the attack to the next address.

Is a strong password enough?

Not on its own. A password reused from a breach is correct and useless as a signal. The second factor is what separates a stolen password from a login.

Does a CAPTCHA stop brute-forcing?

It slows it down and makes each attempt cost a task. A script that solves the task at scale exists, which is why the CAPTCHA sits between the pause and the ban instead of replacing them.

Will a ban lock out my own team?

Only if the team shares one address and types wrong passwords. Set the first step by office, keep the reset window short, and give the administrator account two-factor authentication.

Does closing XML-RPC break anything?

Desktop publishing clients and some mobile apps use it. A site that publishes from the browser does not, and closing the door is cheaper than guarding it.

Next step

Turn on the ladder, close XML-RPC if nothing uses it, and enable TOTP for every administrator. The brute force protection page lists the defaults, the two-factor authentication page covers the setup, and the prices name the tier. OWASP keeps the authentication baseline in its cheat sheet.