Before anyone guesses a password, they need a username. On a default WordPress site, getting one is easy, and it costs the attacker nothing to try. So the first thing I check on a site I'm handed is how many of its usernames it gives away for free.
There are four routes to look at. You can test each with curl from a machine that isn't logged in.
1. The author archive
Ask for an author by numeric ID and WordPress redirects you to that author's archive, which carries the login slug in the URL:
curl -s -o /dev/null -w "%{http_code} %{redirect_url} \n " "https://example.com/?author=1"
Enter fullscreen mode
Exit fullscreen mode
A 301 to https://example.com/author/johnd/ just told you user ID 1 logs in as johnd . A bot walks the IDs up from 1 and collects every name that redirects.
The fix, if you don't publish author pages on purpose, is to drop author requests for logged-out visitors:
<?php add_action ( 'template_redirect' , function () { if ( is_author () && !…