A lightweight intrusion pre tool that watches a log file for repeated failed login attempts and automatically blocks attacking IPs using real Windows Firewall rules — a minimal, purpose-built of what fail2ban does on Linux servers. Written by Joel Odum.
After building a brute-force login tester that cracked 's login in under a second, my next question was: what would actually stop that? Rate-limiting and account lockouts help at the app level, but there's a lower layer worth thinking about — blocking the attacking IP at the firewall before the request e the application. That's what this tool does.
The log-watching approach here is the same pattern fail2ban uses in production. Tail a log file, parse failure lines as they arri failures per IP within a sliding time window, and fire a block when the threshold is crossed. Building it from scratch made the design decisions in real tools like fail2ban make a lot more sense — particularly why the time window matters more than a raw failure count, and why cleanup on exit isn't optional.
FAILED_LOGIN entriessimulate_attacks.py script that generates realistic failed login log entries so you can test without needing a liThis tool is the direct defensi to my brute-force login tester. The tester shows how fast a weak password falls when there's no protection. This blocker shows what that protection looks like — and demonstrates that it works, not just that it should.
netsh requires elevated priStart the blocker (as Administrator):
In a second terminal, simulate an attack:
Check Windows Defender Firewall → Ad Settings → Inbound Rules for BruteForceBlocker_ entries confirming the blocks landed. Hit Ctrl+C to stop the blocker — it removes all rules it created before exiting.
| Flag | Default | What it controls |
|---|---|---|
| --log | auth.log | Log file to watch |
| --threshold | 5 | Failures before blocking |
| --window | 60 | Time window in seconds |
| --ban-duration | 300 | Seconds before auto-unban |
MIT — for authorized use on systems you own or manage.
开发语言:Python
Star 数:2
该项目属于防护思路方向的开源资源,代码结构清晰,适合安全研究人员学习参考。项目围绕A lightweight intrusion prevention tool.展开,提供了可运行的实现,对理解相关安全机制、工具原理与攻防技术具有较高的研究价值。
从技术实现角度看,此类项目的核心在于对底层原理的深入理解与工程化落地。开发者在研究过程中可以结合官方文档与社区讨论,梳理项目的初始化流程、核心模块职责与数据流转,逐步掌握其中的技术细节与设计思路。
1. 下载源码压缩包,解压到本地环境。
2. 根据项目类型准备对应的运行环境与依赖。
3. 按照 README 中的步骤完成配置与部署。
4. 在隔离的测试环境中运行验证,避免影响生产系统。
本资源来源于开源社区,仅供安全研究、技术学习与合法授权范围内的攻防演练使用,请勿用于任何非法或侵害他人权益的用途。使用本项目产生的一切后果由使用者自行承担。
| 资源标题 | brute-force-blocker - A lightweight intrusion prevention tool. |
| 所属分类 | 防护思路 |
| 发布作者 | admin |
| 发布时间 | 2026-10-06 00:20:29 |
| 下载权限 | 免费下载 |
| 附件数量 | 2 个下载链接 |
| 浏览次数 | 330 |
| 讨论数量 | 0 |
| 主题状态 | 正常讨论中 |