Security operations

How to Stop a Brute Force Attack on Windows Server (7 Controls)

Brute force attacks guess passwords until one works. Here are seven controls that stop them on Windows Server, from lockout policy to MFA and RDP hardening.

Cysoro Security TeamPublished · 7 min read
SECURITY OPERATIONS Brute force attacks Lock them out. Lock them down. password123 ✕ denied admin2024 ✕ denied MFA required ✓ Account locked after 5 tries
Quick answer

To stop a brute force attack on Windows Server, set an account lockout policy in Group Policy, require multi-factor authentication, disable or restrict Remote Desktop access, use strong unique passwords, block repeated failed logins at the firewall, and monitor Event ID 4625 for failed logons. Lockout plus MFA together remove most of the attacker's advantage.

Key takeaways

  • Account lockout turns unlimited guessing into a handful of tries before the account locks.
  • MFA stops stolen or guessed passwords from being enough on their own.
  • Exposed RDP is the most common entry point — restrict it before anything else.

A brute force attack is not clever. It is patient. Automated software tries password after password against your Windows Server — often through Remote Desktop — until one works. The fix is not clever either: limit the guesses, add a second factor, and stop exposing logins to the whole internet.

What is a brute force attack on Windows Server?

A brute force attack is an automated attempt to guess a password by trying many combinations against a login service, most often Remote Desktop Protocol (RDP) or Active Directory. The attacker does not need to know anything about you to start.

There are two main variants. A pure brute force tries every combination. A password-spraying attack tries a small list of common passwords against many accounts, which avoids tripping a simple lockout. Credential stuffing reuses passwords leaked in earlier breaches. All three exploit the same weakness: a login that accepts unlimited guesses.

Windows Server is a frequent target because RDP is often left open to the internet on port 3389. Once an attacker guesses a password, they have a server — and from there, a path into the rest of the network.

How do you know you are under attack?

You are under attack when the Security event log fills with Event ID 4625 failed logon events from the same IP address, especially against Administrator or common usernames. A spike in failed logons at odd hours is the clearest signal.

Open Event Viewer, go to Windows Logs, then Security, and filter for Event ID 4625. Look at the source IP addresses and the accounts targeted. A handful of failures from one user is normal. Hundreds from one IP in an hour is an attack.

Also check Event ID 4624 for successful logons from unfamiliar IPs. If an attack succeeded, that is the first place it shows up. Any success from an address you do not recognize needs immediate investigation.

How do you set an account lockout policy?

Set an account lockout policy in Group Policy under Computer Configuration, Windows Settings, Security Settings, Account Policies, Account Lockout Policy. A threshold of 5 failed attempts with a 30-minute lockout is a solid starting point for most organizations.

Account lockout: a safe starting point Threshold5failed attemptsthen lock Lockout duration30 minaccount stayslocked Counter reset30 minfailed attemptscount clears Microsoft notes a threshold of 0 means never lock — the default on a new domain.High-security: 3 attempts, lockout until an admin unlocks it.
Recommended lockout settings for a domain. Illustration by Cysoro.

The three settings work together. The threshold is how many failed attempts trigger a lock. The lockout duration is how long the account stays locked. The counter reset is how long without a failure before the count clears. Microsoft documents that a threshold of 0 means the account never locks, which is the default — and the reason so many servers fall.

Microsoft documents the lockout threshold, including that a value of 0 means never lock, in its account lockout threshold reference.

Apply the policy at the domain level in the Default Domain Policy, because account lockout is domain-wide. On a standalone server, use the Local Security Policy instead. After changing it, run gpupdate /force and test with a test account, not a real user.

Watch for the trade-off Microsoft warns about: an attacker can deliberately lock out every account, causing a denial of service. That is why lockout alone is not enough, and why the other controls in this guide matter.

Why is MFA the strongest single fix?

Multi-factor authentication is the strongest single fix because a guessed password alone is no longer enough to log in. The attacker also needs a code, a push approval, or a security key they do not have.

Require MFA for every remote login, especially RDP and VPN, and for all administrator accounts. Authenticator apps and security keys are stronger than SMS codes, which can be intercepted. NIST guidance in SP 800-63B recommends phishing-resistant factors where possible, and treats SMS as a restricted option.

Start with admins, then roll MFA out to everyone. A phased rollout avoids a flood of helpdesk calls, and admins are the accounts attackers target first. Check that service accounts are handled separately: they should not use interactive MFA, but they should have long random passwords and be restricted to the systems they need.

How do you harden Remote Desktop?

Harden RDP by removing it from the internet, requiring a VPN or Remote Desktop Gateway, restricting it to trusted IPs, and enabling Network Level Authentication. If nobody outside your office needs RDP, close port 3389 entirely.

ControlWhat it doesEffort
Close RDP to the internetRemoves the attack surface completelyLow
VPN or RD GatewayLogin happens behind a second gateMedium
IP allowlistOnly known offices can connectLow
Network Level AuthenticationAuthenticates before a session startsLow
MFA on RDPGuessed password is not enoughMedium
Rename or disable AdministratorRemoves the best-known target accountLow

CISA advises against exposing RDP directly to the internet in its secure remote access guidance.

Renaming the built-in Administrator account is a small win that removes the most-guessed username. Also disable RDP on servers that do not need it, and use a jump server for the ones that do. CISA advises against exposing RDP directly to the internet in its secure remote access guidance.

Changing the RDP port from 3389 helps only against casual scans. It is fine as a minor extra, but never treat it as the fix. Attackers scan every port.

What password rules actually help?

Long, unique passwords help; forced complexity and frequent expiry do not. Require at least 14 characters for admin accounts, ban known breached passwords, and stop forcing password changes every 30 days unless there is evidence of compromise.

NIST SP 800-63B moved away from complexity rules and short expiry periods because they push people toward predictable passwords written on sticky notes. Length is what makes guessing expensive. A passphrase of four random words beats a short password with symbols.

Check your passwords against known breaches. You can test whether a password appears in breach data with our pwned password checker.

Check a new password's strength with the password strength checker, and use a password manager so every account gets its own long password.

How do you block attackers at the firewall?

Block attackers by restricting login ports to trusted IP ranges in Windows Defender Firewall, and by automatically banning IPs that fail too many logons. Firewall rules stop the traffic before it reaches the login prompt.

In Windows Defender Firewall with Advanced Security, create inbound rules for RDP and other login services that allow only your office IPs, VPN range, or jump server. Everything else is denied by default. This single change ends most internet brute force attempts overnight.

For servers that must stay public, add a tool that watches failed logons and blocks the source IP after a set number of failures. This is the Windows equivalent of fail2ban on Linux. It complements lockout policy: the firewall blocks the IP, while lockout protects the account.

How do you monitor for brute force attacks?

Monitor by collecting Security log events centrally, alerting on Event ID 4625 spikes, and reviewing successful logons from new locations. Without central logs, an attack on one server can go unnoticed for weeks.

Set up Windows Event Forwarding or a SIEM to pull Security logs from every server into one place. Alert when one IP generates more than a set number of failed logons in an hour, when the Administrator account is targeted, or when a logon succeeds from an unusual country.

Keep logs long enough to investigate. Thirty days is a minimum for small environments; ninety days is better. If you use a cloud SIEM, confirm that the retention period covers the time you need to spot a slow, patient attack.

What do you do during an active attack?

During an active attack, block the attacking IPs at the firewall, force password resets for targeted accounts, and check Event ID 4624 for any successful logons from those IPs. Act on successes first; the failures are noise.

Active attack: first hour checklist 1. Block the source IPs at the firewall 2. Check Event ID 4624 for successful logons from those IPs 3. Force password resets for targeted accounts 4. Disable any compromised account and review its activity 5. Apply lockout, MFA, and RDP restrictions before reopening access Successes matter more than failures — investigate those first.
What to do in the first hour of a brute force attack. Illustration by Cysoro.

If a logon succeeded, treat it as a breach, not just an attack. Disable the account, review what it accessed, check for new accounts or scheduled tasks the attacker may have created, and look for lateral movement to other servers.

Our guide to how to know if your phone is hacked covers similar signs of compromise on personal devices, and the same instinct applies here: unexpected new accounts or software are red flags.

The bottom line

Brute force attacks work because too many servers accept unlimited guesses on a login anyone on the internet can reach. Lockout policy limits the guesses, MFA makes a guessed password useless, and closing RDP to the internet removes the target entirely.

Do those three first, then add firewall allowlists and monitoring. You can start by checking whether your own passwords have appeared in a breach with the free pwned password checker.

Frequently asked questions

What is a brute force attack on Windows Server?

A brute force attack is an automated attempt to guess a password by trying many combinations, often against Remote Desktop or Active Directory logins. Attackers use software that can try thousands of passwords quickly, so any account with a weak password and no lockout is at risk.

How do I know if my Windows Server is under a brute force attack?

Check the Security event log for many Event ID 4625 failed logon events from the same source IP, especially against the Administrator account or RDP. A sudden spike in failed logons, or logons at unusual hours, is a strong sign.

What lockout settings should I use on Windows Server?

A common starting point is a threshold of 5 failed attempts, a 30-minute lockout duration, and a 30-minute counter reset. High-security environments use 3 attempts and a lockout that needs an admin to clear. Balance security against the risk of locking out real users.

Does MFA stop brute force attacks?

Yes, in most cases. Even if an attacker guesses the password, they still need the second factor, such as an authenticator app code or a security key. MFA is the single most effective control after removing internet exposure.

Should I change the RDP port to stop brute force attacks?

Changing the default RDP port from 3389 reduces noise from automated scans, but it is not real security. Attackers scan all ports. Restrict RDP by IP, require a VPN or gateway, and add MFA instead of relying on a port change.

Can I block brute force attacks with Windows Firewall?

Yes. You can restrict RDP and other login services to trusted IP addresses, and use Windows Defender Firewall with Advanced Security to block repeated offenders. For automated blocking, tools that watch failed logons and ban the source IP add a useful layer.

What should I do during an active brute force attack?

Block the attacking IP addresses at the firewall, force a password reset for targeted accounts, check for any successful logons from those IPs, and review what the attacker may have reached. Then apply the long-term fixes in this guide so it does not happen again.

Sources

  1. Microsoft Learn — Account lockout threshold
  2. CISA — Secure Remote Access
  3. Microsoft Learn — Remote Desktop Services security
  4. NIST — Digital Identity Guidelines (SP 800-63B)
Written & fact-checked byCysoro Security Team

The engineers and analysts who build Cysoro's domain scanner, email-authentication checks and free security tools. We test what we write about every day — SPF, DKIM, DMARC, certificates, look-alike domains and phishing — and check each guide against the relevant standards, government guidance and vendor documentation.

  • Email authentication
  • Phishing & BEC
  • Domain & DNS security
  • Small-business security

Checked against Microsoft account lockout and Remote Desktop guidance, CISA secure remote access guidance, and NIST SP 800-63B.

How we write and fact-check →

Free tools for this topic

No account needed.

See where your domain stands

Free for up to 3 domains. No card, no installs.

Start free