DevwithMujeeb/security-tools

GitHub: DevwithMujeeb/security-tools

一套包含端口扫描、子域名枚举和 JWT 安全分析的 Python CLI 安全工具集,用于信息安全学习与授权测试场景。

Stars: 1 | Forks: 0

# 🛠️ 安全工具 一系列作为我 90 天开源构建挑战的一部分而开发的 Python CLI 安全工具。每个工具都是独立的、有文档记录的,并且可以从命令行运行。 ![Python](https://img.shields.io/badge/Python-3.8+-3776AB?style=flat&logo=python&logoColor=white) ![License](https://img.shields.io/badge/License-MIT-blue.svg) ## 🔧 工具 | 工具 | 描述 | 状态 | | ----------------------- | ----------------------------------------------------------- | ------- | | 🔍 端口扫描器 | 带有服务检测的 TCP 端口扫描器 | ✅ 完成 | | 🌐 子域名枚举器 | 基于字典的子域名发现,支持 HTTPS + 导出 | ✅ 完成 | | 🔑 JWT 分析器 | 用于解码、检查和安全分析 JWT token 的 CLI 工具 | ✅ 完成 | ## 🚀 安装说明 ``` git clone https://github.com/DevwithMujeeb/security-tools.git cd security-tools pip install -r requirements.txt ``` ## 📖 用法 ### 🔍 端口扫描器 扫描目标的开放 TCP 端口,并识别正在运行的服务。 ``` cd tools/port_scanner python scanner.py python scanner.py python scanner.py python scanner.py ``` **示例:** ``` python scanner.py localhost python scanner.py localhost 80 python scanner.py localhost 1 1000 python scanner.py localhost 1 1000 0.5 ``` **输出:** ``` [+] Port 22 OPEN SSH [+] Port 80 OPEN HTTP [+] Port 443 OPEN HTTPS ``` ### 🌐 子域名枚举器 使用字典发现子域名。优先尝试 HTTPS,失败后回退至 HTTP。可选择将结果保存到文件中。 ``` cd tools/subdomain_enum python enumerator.py python enumerator.py python enumerator.py python enumerator.py ``` **示例:** ``` python enumerator.py google.com python enumerator.py google.com ../../wordlists/subdomains.txt python enumerator.py google.com ../../wordlists/subdomains.txt 5 python enumerator.py google.com ../../wordlists/subdomains.txt 5 results.txt ``` **输出:** ``` [+] FOUND https://www.google.com (200 OK) [~] REDIRECT https://mail.google.com (301) [-] NOT FOUND ftp.google.com ``` ### 🔑 JWT 分析器 从命令行解码并进行 JWT token 的安全分析。检查过期时间,标记弱算法,并显示所有声明。 ``` cd tools/jwt_analyzer python analyzer.py ``` **示例:** ``` python analyzer.py eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjEyMyIsInJvbGUiOiJhZG1pbiJ9.signature ``` **检查内容:** - 解码 header、payload 和 signature - Token 过期状态及剩余时间 - 标记危险算法 (`none`) —— 可伪造的 token - 标记弱算法 (`HS256`) —— 暴力破解风险 - 显示签发时间和过期时间戳 **输出:** ``` HEADER algorithm : HS256 type : JWT PAYLOAD id : 123 role : admin iat : 1234567890 exp : 1234568790 EXPIRY CHECK status : ✅ VALID expires at : 2026-05-15 17:45:48 UTC time remaining : 14m 32s SECURITY ANALYSIS algorithm : ⚠️ WEAK — 'HS256' risk : Vulnerable to brute-force if secret is short or common. recommendation : Use RS256 or HS512 with a strong secret (32+ chars). ``` ## 📁 项目结构 ``` security-tools/ ├── tools/ │ ├── port_scanner/ │ │ └── scanner.py │ ├── subdomain_enum/ │ │ └── enumerator.py │ └── jwt_analyzer/ │ └── analyzer.py ├── wordlists/ │ └── subdomains.txt ├── requirements.txt ├── .gitignore └── README.md ``` ## 🗺️ 90 天构建挑战的一部分 | Project | Description | Status | | ------------------------------------------------------------------------- | ----------------------------------- | ----------- | | [安全认证 API](https://github.com/DevwithMujeeb/secure-auth-api) | 具备 RBAC 的生产级 JWT 认证 | ✅ 已发布 | | [漏洞 Web 实验室](https://github.com/DevwithMujeeb/vulnerable-web-lab) | OWASP Top 10 漏洞利用与修复实验室 | ✅ 已发布 | | 安全工具(此仓库) | Python CLI 安全工具 | ✅ 已发布 | | 安全全栈应用 | 带有安全层的 React + Node.js | 🔜 开发中 | ## 👨‍💻 作者 **Abdulmujeeb Uthman** - GitHub: [@DevwithMujeeb](https://github.com/DevwithMujeeb) - X: [@JeebExplains](https://x.com/JeebExplains) - LinkedIn: [Abdulmujeeb Uthman](https://linkedin.com/in/abdulmujeeb-uthman) ## 📄 许可证 MIT License —— 可随意将这些工具用于学习和授权测试。
标签:JWT分析, Python, 子域名枚举, 插件系统, 数据统计, 无后门, 端口扫描, 系统安全, 系统独立性, 逆向工具