Vr1me/soc-python-tools

GitHub: Vr1me/soc-python-tools

面向 SOC 分析师的一组 Python 脚本工具集,整合了文件恶意检测、日志暴力破解分析和网络侦察功能。

Stars: 0 | Forks: 0

# SOC Python Tools 一个不断扩充的 Python 脚本集合,用于 SOC Analyst 任务 —— 在学习网络安全和完成 HackTheBox 靶机的过程中构建。 ## 结构 ``` soc-python-tools/ ├── folder-monitor-vt/ # Real-time folder monitor with VirusTotal API ├── log-analysis/ # Log parsing and brute force detection ├── network/ # Port scanning, DNS, network recon ├── monitoring/ # Auth log monitoring and alerting ├── writeups/ # HackTheBox writeups and study notes └── samples/ # Sample log files for testing ``` ## 工具 ### 文件夹监控 + VirusTotal ⭐ | 脚本 | 描述 | |--------|-------------| | [`folder-monitor-vt/`](folder-monitor-vt/) | 实时监控文件夹。当出现新文件时:计算 SHA256,查询 VirusTotal API,如果任何 AV 引擎标记该文件则引发 ALERT。已通过 EICAR 测试(检出率 53/59) | ### 日志分析 | 脚本 | 描述 | |--------|-------------| | `log_parser.py` | 解析 Apache/Nginx access.log 和 auth.log —— 检测暴力破解攻击,输出 Top IP,将警报保存为 CSV | | `log_search.py` | 在日志文件中搜索关键字并输出匹配的行 | | `generate_test_log.py` | 生成用于测试的 access.log 样本 | ### 网络 | 脚本 | 描述 | |--------|-------------| | `NetPortScanner.py` | TCP/SYN/UDP 端口扫描器,支持 banner 抓取和子网扫描 | | `nmap_scan.py` | 自动化 Nmap 扫描并将结果保存到文件 | | `dns_lookup.py` | 将域名解析为 IP 地址 | ### 监控 | 脚本 | 描述 | |--------|-------------| | `auth_monitor.py` | 分析 Linux auth.log —— 检测基于 IP 的 SSH 暴力破解,标记超过阈值的 IP,导出 CSV 报告 | ## 用法 ``` # 使用 VirusTotal 进行实时文件夹监控 cd folder-monitor-vt pip install -r requirements.txt cp .env.example .env # add your VirusTotal API key python monitor.py # 检测日志文件中的暴力破解攻击 python log-analysis/log_parser.py --file access.log # 自定义阈值与输出 python log-analysis/log_parser.py --file access.log --threshold 3 --output alerts.csv # 监控 SSH auth logs python monitoring/auth_monitor.py # 运行 port scanner python network/NetPortScanner.py # DNS lookup python network/dns_lookup.py ``` ## HackTheBox Writeups - [Starting Point](writeups/htb-starting-point.md) - [Dancing](writeups/htb-dancing-writeup.md) ## 学习笔记 - [MITRE ATT&CK](writeups/mitre_notes.md) —— Tactics、Techniques、CAR、D3FEND ## 作者 **Mykhailo Vlasov** —— Junior SOC Analyst GitHub: [github.com/Vr1me](https://github.com/Vr1me)
标签:AMSI绕过, Apache, Ask搜索, Auth.log, Banner Grabbing, CDN识别, CTI, DNS查询, HackTheBox, Nginx, Nmap, PoC, Python, SSH监控, VirusTotal, Web安全, 免杀技术, 威胁检测, 安全脚本, 安全运营中心, 密码管理, 恶意文件监控, 插件系统, 数据统计, 文件夹监控, 无后门, 日志解析, 暴力破解, 暴力破解检测, 横幅抓取, 病毒扫描, 端口扫描, 网络安全工具包, 网络映射, 网络调试, 自动化, 蓝队分析, 虚拟驱动器, 证书伪造, 逆向工具