IncidentResponsev2

4.24 Stop Brute Force Attack

Task

Detect and stop active brute force attacks against local, domain, cloud, and application accounts in order to prevent unauthorized access, credential compromise, and potential lateral movement.


Conditions

Given:


Standards


End State


Notes

Brute force attacks can occur in many locations:

Brute force attacks may use:


Manual Steps

Step 1 → Detect Brute Force Activity

Indicators

Tools/Commands

Windows (Domain Controller Event Logs)
Get-WinEvent -FilterHashtable @{LogName='Security'; ID=4625} | Select-Object TimeCreated, Message
Linux (SSH Brute Force)
cat /var/log/auth.log | grep "Failed password"
grep "Invalid user" /var/log/auth.log
Azure AD
VPN Logs
SIEM / EDR

Step 2 → Contain Attack Sources

Block Source IP

Windows Firewall
New-NetFirewallRule -DisplayName "Block Brute Force Attacker" -Direction Inbound -RemoteAddress <IP> -Action Block
Linux Firewall (iptables)
iptables -A INPUT -s <attacker_ip> -j DROP
Cloud (Azure)
Cloud (AWS)
Cloud (GCP)

Step 3 → Secure Targeted Accounts

Set-ADAccountPassword -Identity username -Reset -NewPassword (ConvertTo-SecureString -AsPlainText "NewPassword!" -Force)
Azure AD
Linux
passwd -l username  # Lock the account
passwd username     # Reset password

Step 4 → Monitor and Validate Block


Step 5 → Implement Long-Term Mitigation

Windows (GPO)
Linux (pam_tally2 / faillock)
faillock --user username

Running Script Examples

Example → Linux Block IP After Detection
iptables -A INPUT -s 192.168.1.200 -j DROP
Example → Windows GPO Lockout Configuration
secedit /export /cfg C:\secpol.cfg
notepad C:\secpol.cfg
# Edit Lockout settings manually and apply using:
secedit /configure /db secedit.sdb /cfg C:\secpol.cfg /areas SECURITYPOLICY
Example → Azure Block Sign-in Immediately

Dependencies


Other Available Tools

Tool Platform Installation Usage
Splunk, Security Onion, ELK Cross-platform Installed Authentication and brute force detection
Fail2Ban Linux Installed Auto-ban brute force attempts
Azure Conditional Access Cloud Configured Block based on IP or login failure patterns
AWS WAF Cloud Configured Block IPs at edge
CrowdStrike / SentinelOne Cross-platform Installed Detect + isolate brute force tools running

Operator Recommendations and Best Practices

Operator Checklist

Best Practices


References


Revision History

Date Version Description Author
2025-05-02 1.0 Generated detailed operator workflow with containment, blocking, and recovery process Leo