SRINIVASAN55/NetSentinel

GitHub: SRINIVASAN55/NetSentinel

基于 Scapy 和 Python 构建的实时网络流量分析器,通过七条内置威胁规则检测端口扫描、洪泛攻击等异常行为。

Stars: 0 | Forks: 0


[![实时检测](https://img.shields.io/badge/⚡_LIVE_DETECTION-00b4d8?style=for-the-badge)]() [![Python](https://img.shields.io/badge/Python-3776AB?style=for-the-badge&logo=python&logoColor=white)]() [![免 Root 演示](https://img.shields.io/badge/Demo_Mode-No_Root_Needed-90e0ef?style=for-the-badge)]() [![IDS](https://img.shields.io/badge/7_Threat_Rules-023e8a?style=for-the-badge)]()
## 🛰️ 实时检测的内容 ``` 12:34:57 TCP 10.0.0.99 ──────────────────→ 192.168.1.1:22 [SYN] 60B 12:34:57 TCP 10.0.0.99 ──────────────────→ 192.168.1.1:80 [SYN] 60B 12:34:57 TCP 10.0.0.99 ──────────────────→ 192.168.1.1:443 [SYN] 60B ... 13 more ports ... ╔══════════════════════════════════════════════════════╗ ║ 🔴 [HIGH] PORT_SCAN ║ ║ 10.0.0.99 scanned 16 distinct ports in 10s ║ ║ Ports: [21,22,80,443,3306,5432,8080,8443,9200...] ║ ╚══════════════════════════════════════════════════════╝ 12:34:58 TCP 172.16.0.1 ─────────────────→ 192.168.1.1:80 [SYN] (×102) ╔══════════════════════════════════════════════════════╗ ║ 🚨 [CRITICAL] SYN_FLOOD ║ ║ 172.16.0.1 → 102 SYN packets in 10 seconds ║ ╚══════════════════════════════════════════════════════╝ ``` ## 🧠 检测引擎 | 规则 | 触发条件 | 严重程度 | |---|---|---| | `PORT_SCAN` | 来自同一 IP / 10秒内访问 15+ 个不同端口 | 🔴 高 | | `SYN_FLOOD` | 来自同一 IP / 10秒内 100+ 个 SYN 数据包 | 🚨 严重 | | `DNS_EXFILTRATION` | 来自同一 IP / 10秒内 30+ 次 DNS 查询 | 🔴 高 | | `ICMP_FLOOD` | 来自同一 IP / 10秒内 50+ 个 ICMP 数据包 | 🔴 高 | | `SUSPICIOUS_PORT` | 端口 4444、31337、1337、6969… 上的流量 | 🔴 高 | | `CLEARTEXT_CREDS` | FTP / Telnet / POP3 / IMAP 会话 | 🟡 中 | | `LARGE_PAYLOAD` | 单个数据包 > 65 KB | 🟡 中 | ## ⚡ 快速开始 ``` git clone https://github.com/SRINIVASAN55/NetSentinel cd NetSentinel # ── Demo 模式(无需 sudo,无需安装) ────────────── python netsentinel.py --demo -d 30 # ── 在 eth0 上进行实时抓包(Linux,需要 sudo) ───────── sudo python netsentinel.py -i eth0 -d 120 # ── 保存 JSON 报告 ──────────────────────────────────── sudo python netsentinel.py -i eth0 -d 60 -o report.json ``` ## 📊 流量统计仪表板 ``` Protocol Distribution: TCP 1,847 ████████████████████████ UDP 423 █████ ICMP 89 █ Top Talkers: 192.168.1.5 612 packets 10.0.0.99 289 packets ← suspicious Top Ports: 443 HTTPS 891 connections 53 DNS 210 connections 4444 ??? 3 connections ⚠ ```

SRINIVASAN55 构建 · LinkedIn

标签:Python, Scapy, 入侵检测系统, 安全数据湖, 异常检测, 插件系统, 无后门, 网络安全, 网络流量分析, 逆向工具, 隐私保护