📺
World Television Day Celebrating the power of visual media. 📺
💬 Share
Cyber Security

Brute Force Attacks on Website Logins: How to Detect and Block Them

Bots try thousands of passwords on admin pages every day. Here's how to recognise a brute force attack and stop it.

In this article · 5 sections
  1. How to tell if you're being targeted
  2. Types of brute force
  3. Defences that work
  4. For custom PHP admin panels
  5. FAQs
  6. Does changing the login URL help?
  7. Will Cloudflare stop brute force?

A brute force attack is when bots try thousands of username and password combinations on your login page until one works. WordPress wp-login.php, /admin panels, cPanel, email and FTP logins are all common targets. Weak or reused passwords make it easy; a few simple controls make it nearly impossible.

How to tell if you're being targeted

  • Many failed logins in your CMS security log or server logs
  • Hosting alerts about high CPU from login pages
  • Account lockout emails you didn't trigger
  • Traffic spikes to /wp-login.php, /xmlrpc.php or /admin/login

Types of brute force

  • Classic: trying many passwords for one account
  • Dictionary: common passwords like Admin@123, password, business name + year
  • Credential stuffing: using email/password pairs leaked from other websites
  • Password spraying: one common password tried across many accounts

Defences that work

  1. Strong unique passwords with a password manager. See password policy for small business
  2. Two-factor authentication for admin users. See 2FA guide
  3. Rate limiting: allow only a few attempts per IP per minute
  4. Account lockout or delays after repeated failures (with care, to avoid locking out real users)
  5. CAPTCHA on login after failed attempts
  6. Don't use "admin" as a username
  7. Firewall / WAF rules blocking known bad IPs. See WAF explained
  8. Restrict admin access by IP or add HTTP authentication on the admin folder
  9. Disable XML-RPC on WordPress if you don't need it

For custom PHP admin panels

  • Hash passwords with password_hash() and check with password_verify()
  • Store failed attempts in the database and block after a threshold
  • Regenerate the session ID after login
  • Log every login with IP and time

See our step-by-step secure PHP login tutorial.

FAQs

Does changing the login URL help?

It reduces bot noise but isn't real security on its own. Combine it with strong passwords and 2FA.

Will Cloudflare stop brute force?

Its rate limiting and bot features help a lot. See Cloudflare free plan.

Was this article helpful?

Your answer helps us improve our guides

Share this article

Joboo Web

Web design, SEO & digital marketing team · Ludhiana, Punjab

Joboo Web has helped Indian businesses grow online since 2019 — building fast websites and running SEO, Google Ads and social campaigns for clients in 80+ cities. About us →

Keep reading

💬
👋 Need a website or more leads? Ask me!