monish4030/ip_analyzer

GitHub: monish4030/ip_analyzer

一个基于 Python 的轻量级 OSINT 侦察工具,能够从 URL 出发自动完成 DNS 解析、IP 地理定位、ASN 查询、nmap 端口扫描及风险评级,并生成结构化报告。

Stars: 0 | Forks: 0

# 🔍 URL IP 分析器
![Python](https://img.shields.io/badge/Python-3.8+-blue?style=for-the-badge&logo=python&logoColor=white) ![Platform](https://img.shields.io/badge/Platform-Kali%20Linux-557C94?style=for-the-badge&logo=linux&logoColor=white) ![License](https://img.shields.io/badge/License-MIT-green?style=for-the-badge) ![Ethics](https://img.shields.io/badge/Use-Ethical%20Only-red?style=for-the-badge) **一款基于 Python 的强大 Kali Linux 网络安全侦察工具** 由 **Monish Paramasivam** 用 ❤️ 打造
## 📌 功能说明 **URL IP Analyzer** 接收任何 URL 并执行完整的侦察流程: 1. 🌐 **解析** URL —— 提取协议、根域名和子域名 2. 🔎 **解析** 域名到其对应的 IP 地址(通过 DNS) 3. 🗺️ **获取 IP 情报** 从 [ipinfo.io](https://ipinfo.io) —— 位置、ISP、ASN 4. 🛡️ **可选运行 nmap 扫描** —— 检测开放端口和服务 5. 📊 **评估风险等级** —— 基于暴露的端口判定为低 / 中 / 高 6. 📝 **用通俗易懂的英语解释发现** —— 每个端口的含义及安全见解 7. 💾 **保存结果** 到 `.json` 和 `.txt` 报告文件中 ## 🖥️ 预览 ``` ① TARGET INFO Original URL : https://sub.example.com Full Domain : sub.example.com Root Domain : example.com Subdomain : sub ② IP DETAILS IP Address : 93.184.216.34 Country : US City : Norwell ISP / Org : Edgecast Inc. ASN : AS15133 ③ SCAN RESULTS Risk Level : MEDIUM ┌──────┬──────────┬───────┬─────────┬──────────────────┐ │ Port │ Protocol │ State │ Service │ Version │ ├──────┼──────────┼───────┼─────────┼──────────────────┤ │ 80 │ tcp │ open │ http │ Apache 2.4.41 │ │ 443 │ tcp │ open │ https │ OpenSSL 1.1.1 │ │ 22 │ tcp │ open │ ssh │ OpenSSH 8.2p1 │ └──────┴──────────┴───────┴─────────┴──────────────────┘ ④ EXPLANATION Plain-English breakdown of findings + security insights ``` ## ⚙️ 安装说明 ### 1. 克隆仓库 ``` git clone https://github.com/YOUR_USERNAME/url-ip-analyzer.git cd url-ip-analyzer ``` ### 2. 安装 Python 依赖 ``` pip install requests rich ``` ### 3. 安装 nmap(可选 —— 用于端口扫描) ``` sudo apt install nmap ``` ## 🚀 使用方法 ### 交互模式(推荐初学者使用) ``` python3 url_ip_analyzer.py ``` ### 直接传入 URL ``` python3 url_ip_analyzer.py --url https://example.com ``` ### 附带 nmap 扫描 ``` python3 url_ip_analyzer.py --url https://example.com --nmap ``` ### 完整 nmap 扫描(前 1000 个端口)+ 保存结果 ``` python3 url_ip_analyzer.py --url https://example.com --nmap --full --save ``` ## 🏳️ CLI 标志 | 标志 | 缩写 | 描述 | |------|-------|-------------| | `--url` | `-u` | 要分析的目标 URL | | `--nmap` | `-n` | 对解析出的 IP 运行 nmap 扫描 | | `--full` | `-f` | 完整扫描(前 1000 个端口)而非快速模式 | | `--save` | `-s` | 将结果保存到 `.json` 和 `.txt` 文件中 | ## 🗂️ 输出文件 当使用 `--save` 时(或在提示时选择是),将创建两个文件: | 文件 | 格式 | 内容 | |------|--------|----------| | `url_ip_report__.txt` | 纯文本 | 人类可读的完整报告 | | `url_ip_report__.json` | JSON | 机器可读的结构化数据 | ## 🔐 风险等级说明 | 等级 | 含义 | |-------|---------| | 🟢 **低** | 未暴露关键端口 | | 🟡 **中** | 一些值得注意的端口开放(SSH、HTTP 等) | | 🔴 **高** | 暴露了关键端口 —— RDP、Telnet、MySQL、Redis、MongoDB、FTP、SMB | ## 📦 依赖项 | 包 | 用途 | |---------|---------| | `requests` | 从 ipinfo.io 获取 IP 情报 | | `rich` | 彩色 CLI 输出、表格、面板 | | `socket` | DNS 解析(内置) | | `subprocess` | 运行 nmap(内置) | | `nmap` *(系统)* | 端口扫描 —— 单独安装 | ## 🧠 工作原理 ``` URL Input │ ▼ Parse URL ──► Extract domain + subdomain │ ▼ DNS Resolution ──► socket.gethostbyname() │ ▼ IP Intelligence ──► ipinfo.io API (free) │ ▼ nmap Scan ──► subprocess → parse output │ ▼ Risk Scoring ──► Based on open port analysis │ ▼ Explanation ──► Plain-English security insights │ ▼ Display + Save Report ``` ## ⚠️ 免责声明 ## 👤 作者 **Monish Paramasivam** ## 📄 许可证 ## ![License](https://img.shields.io/badge/License-CC%20BY--ND%204.0-red?style=for-the-badge)
⭐ **如果您觉得这个工具有用,请给仓库点个 Star!** ⭐
标签:AES-256, ASN查询, DNS解析, ESC4, GitHub, IP地理定位, Nmap, OSINT, Python, URL解析, 威胁情报, 字符串匹配, 安全报告生成, 开发者工具, 开源项目, 插件系统, 数据统计, 无后门, 无线安全, 漏洞评估, 端口扫描, 网络安全, 自动化安全分析, 虚拟驱动器, 逆向工具, 隐私保护, 风险评分