A PowerShell-based tool for detecting suspicious activities in Active Directory environments.
Hunt smarter, hunt harder
-
🚨 Real-time Detection of:
- Password Spray Attacks
- Brute Force Attempts
- Account Lockouts
- Suspicious Authentication Patterns
-
⚡ Smart Analysis:
- Timing-based Attack Detection
- Pattern Recognition
- Activity Correlation
- User Behavior Analysis
-
📊 Comprehensive Reporting:
- Detailed Event Timelines
- Attack Pattern Visualization
- Activity Summaries
- Export Options (CSV, JSON, HTML)
- Windows Server with AD Domain Services
- PowerShell 5.1 or higher
- Domain Admin privileges
- WinRM or RPC access to Domain Controllers
.\Start-ADThreatHunt.ps1 -Hours 24 -UseWinRM
NOTE: I did not test RPC, WinRM does work. Please halp.
# Hunt last 48 hours with specific user focus
.\Start-ADThreatHunt.ps1 -Hours 48 -Identity "username" -UseWinRM
# Export results to CSV
.\Start-ADThreatHunt.ps1 -Hours 24 -ExportPath "C:\Reports" -ExportFormat CSV
The tool includes a test framework for simulating various attack scenarios:
# Simulate password spray
.\test\Invoke-ADThreatSimulation.ps1 -PasswordSpray
# Simulate brute force against specific user
.\test\Invoke-ADThreatSimulation.ps1 -BruteForce -TargetUser "administrator" -EventCount 15
# Simulate account lockout
.\test\Invoke-ADThreatSimulation.ps1 -AccountLockout -TargetUser "testuser"
# Generate random attack patterns
.\test\Invoke-ADThreatSimulation.ps1 -Random -Verbose
The tool analyzes several key indicators:
- Attack duration and intensity
- Attempts per minute
- High activity time windows
- Pattern correlation
- Password Sprays: Multiple accounts, same password
- Brute Force: Single account, multiple passwords
- Mixed Attacks: Random patterns and combinations
- Failed login attempts (Event ID 4625)
- Account lockouts (Event ID 4740)
- Authentication patterns
- Logon type distribution
- Collection: Gathers security events from Domain Controllers
- Analysis:
- Groups events by time windows
- Identifies attack patterns
- Calculates activity metrics
- Detection:
- High-frequency attempts
- Suspicious timing patterns
- Known attack signatures
- Reporting:
- Detailed summaries
- Visual indicators
- Actionable insights
- Run regularly as part of security monitoring
- Use appropriate time windows (-Hours parameter)
- Export results for long-term analysis
- Combine with other security tools
- Test in lab environment first
- Use in production environments with caution
- Monitor resource usage on large domains
- Consider network impact when using WinRM
- Review audit policies for proper logging
Made with ❤️ by defenders for defenders