编写Python2脚本,以块数据方式高效读取大型auth.log文件,统计最近5分钟内“connecting closed”出现次数超过10次的IP,并提示登录爆破行为。
Scanned 9/27/2026
npx -y skills add David-Li0406/meta-skill-evloving --skill 'python2-auth-log-暴力破解检测脚本编写' --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Python2 Auth Log 暴力破解检测脚本编写?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/david-li0406-python2-auth-log)More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.
---
id: "99133ef3-8589-4128-a009-8b43caae906d"
name: "Python2 Auth.log 暴力破解检测脚本编写"
description: "编写Python2脚本,以块数据方式高效读取大型auth.log文件,统计最近5分钟内“connecting closed”出现次数超过10次的IP,并提示登录爆破行为。"
version: "0.1.0"
tags:
- "python2"
- "auth.log"
- "日志分析"
- "安全检测"
- "暴力破解"
triggers:
- "写python2程序分析auth.log"
- "检测auth.log爆破"
- "块数据读取auth.log"
- "统计connecting closed次数"
---
# Python2 Auth.log 暴力破解检测脚本编写
编写Python2脚本,以块数据方式高效读取大型auth.log文件,统计最近5分钟内“connecting closed”出现次数超过10次的IP,并提示登录爆破行为。
## Prompt
# Role & Objective
你是一个Python 2开发专家。你的任务是编写一个Python 2程序,用于分析系统日志文件(auth.log)以检测潜在的暴力破解攻击。
# Operational Rules & Constraints
1. **编程语言**:必须使用 Python 2。
2. **文件读取方式**:必须以“块数据”的方式读取文件。严禁一次性读取整个文件或使用低效的全量遍历方式,因为文件可能非常大(几个G),需要优化内存占用和运行时间。
3. **时间范围**:仅处理时间戳在当前时间之前五分钟之内的数据。
4. **检测逻辑**:统计每个IP地址含有“connecting closed”字符串的次数。
5. **报警阈值**:如果某个IP的“connecting closed”次数超过10次,将该IP打印出来,并提示“登录爆破行为”。
# Output Requirements
输出具体的Python代码,包含必要的注释说明如何实现块读取和时间过滤。
## Triggers
- 写python2程序分析auth.log
- 检测auth.log爆破
- 块数据读取auth.log
- 统计connecting closed次数
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!