|
| 1 | +# NetDeflect |
| 2 | + |
| 3 | +**NetDeflect** is an easy to use real-time DDoS detection and mitigation tool for Linux-based systems. It captures, analyzes, and classifies traffic in real-time, blocks malicious IPs based on attack signatures, provides live metrics and Discord webhook alerts. |
| 4 | + |
| 5 | +--- |
| 6 | + |
| 7 | +### ✨ Features |
| 8 | + |
| 9 | +- 📊 **Live Network Monitoring**: Real-time PPS, MB/s, and CPU tracking. |
| 10 | +- 🚨 **Automated Detection**: Detects DDoS attacks using known protocol signatures and flags. |
| 11 | +- 🔥 **Auto-Mitigation**: Blocks offending IPs using `iptables`, `ipset`, `ufw`, or blackhole routing. |
| 12 | +- 🔍 **Traffic Analysis**: Uses `tcpdump` and `tshark` to capture and inspect attack patterns. |
| 13 | +- 📁 **Organized Reports**: Stores pcap captures and analysis logs per incident. |
| 14 | +- 📡 **Discord Webhook Support**: Sends alerts with attack stats and summaries. |
| 15 | +- 🔄 **Self-Updating Checker**: Notifies you when a new version is available on GitHub. |
| 16 | + |
| 17 | +--- |
| 18 | + |
| 19 | +### 🛠 Requirements |
| 20 | + |
| 21 | +- Linux (Debian-based preferred) |
| 22 | +- Python 3 |
| 23 | +- Packages `tcpdump`, `tshark` |
| 24 | +- Firewall `iptables`, `ipset` (optional) |
| 25 | +- PIP `psutil`, `requests` |
| 26 | + |
| 27 | +--- |
| 28 | + |
| 29 | +### 🚀 Installation |
| 30 | +(as root) |
| 31 | +```bash |
| 32 | +apt install tcpdump tshark -y |
| 33 | + |
| 34 | +git clone https://github.com/0vm/NetDeflect |
| 35 | +cd NetDeflect |
| 36 | + |
| 37 | +pip install psutil requests |
| 38 | + |
| 39 | +python3 netdeflect.py |
| 40 | +``` |
| 41 | + |
| 42 | +--- |
| 43 | + |
| 44 | +### ⚙️ Configuration |
| 45 | + |
| 46 | +On first run, a `settings.ini` file and a `notification_template.json` will be created with defaults. |
| 47 | + |
| 48 | +Your Discord webhook should be added to the `settings.ini` file. |
| 49 | + |
| 50 | +The `notification_template.json` defines the Discord embed layout and can be fully customized. |
| 51 | + |
| 52 | +Note: It's recommended to keep `enable_fallback_blocking` set to `False` to reduce the risk of false positives. |
| 53 | + |
| 54 | +--- |
| 55 | + |
| 56 | +### 🧠 Attack Vector Matching |
| 57 | + |
| 58 | +Attack signatures are loaded from `methods.json` and include detection for: |
| 59 | + |
| 60 | +#### Reflection & Amplification Attacks |
| 61 | +- DNS Amplification: ANY, RRSIG queries |
| 62 | +- NTP Reflection |
| 63 | +- SSDP Reflection |
| 64 | +- CLDAP Reflection |
| 65 | +- SNMP, MSSQL, SSDP, MDNS, Chargen Reflection |
| 66 | +- Memcached Reflection |
| 67 | +- STUN, CoAP, BACnet, QOTD, SIP, ISAKMP Reflection |
| 68 | +- TeamSpeak, Jenkins, Citrix, ARD, Plex, DVR, FiveM, Lantronix Reflections |
| 69 | +- BitTorrent Reflection |
| 70 | +- Apple serialnumberd Reflection |
| 71 | +- OpenVPN, DTLS, OpenAFS Reflection |
| 72 | +- vxWorks, Digiman, Crestron Reflection |
| 73 | +- XDMCP, IPMI Reflection |
| 74 | +- NetBIOS Reflection |
| 75 | +- NAT-PMP Reflection |
| 76 | +- GRE, ESP, AH Protocol Abuses |
| 77 | + |
| 78 | +--- |
| 79 | + |
| 80 | +#### Flooding Attacks |
| 81 | +- UDP Flood |
| 82 | +- Hex UDP Flood |
| 83 | +- Flood of 0x00 / 0xFF |
| 84 | +- Known Botnet UDP Floods |
| 85 | +- UDPMIX DNS Flood |
| 86 | +- TCP Flag Abuses (SYN, ACK, RST, PSH combos) |
| 87 | +- TCP SYN, SYN-ACK, SYN-ECN, FIN, URG, etc. |
| 88 | +- Unset TCP Flags / malformed TCP |
| 89 | +- Fragmented IPv4 Floods |
| 90 | +- ICMP Floods / ICMP Dest Unreachable |
| 91 | +- Ookla Speedtest abuse |
| 92 | + |
| 93 | +--- |
| 94 | + |
| 95 | +#### Game Server & Protocol Exploits |
| 96 | +- Source Engine Query (getstatus) Flood |
| 97 | +- ArmA Reflection (Ports 2302/2303) |
| 98 | +- TeamSpeak Status Flood |
| 99 | +- VSE (Valve Source Engine) Flood |
| 100 | +- FiveM Reflection |
| 101 | + |
| 102 | +--- |
| 103 | + |
| 104 | +#### TCP-Based Reflection Attacks |
| 105 | + |
| 106 | +Mimic or abuse standard TCP-based services: |
| 107 | + |
| 108 | +- HTTP/HTTPS Reflection |
| 109 | +- BGP Reflection |
| 110 | +- SMTP Reflection |
| 111 | + |
| 112 | +--- |
| 113 | + |
| 114 | +### 📦 Output Structure |
| 115 | + |
| 116 | +``` |
| 117 | +netdeflect.py |
| 118 | +settings.ini |
| 119 | +notification_template.json |
| 120 | +./application_data/ |
| 121 | +├── captures/ ← Raw .pcap traffic captures |
| 122 | +├── ips/ ← IPs identified during attacks |
| 123 | +├── attack_analysis/ ← Plaintext reports |
| 124 | +``` |
| 125 | + |
| 126 | +--- |
| 127 | + |
| 128 | +### 📢 Notification Example |
| 129 | + |
| 130 | +Sends alerts to Discord with information like: |
| 131 | + |
| 132 | +- PPS & MBps before mitigation |
| 133 | +- Blocked IP count |
| 134 | +- Attack vector |
| 135 | +- Mitigation status |
| 136 | + |
| 137 | +--- |
| 138 | + |
| 139 | +### 🧾 License |
| 140 | + |
| 141 | +MIT License — free to use, fork, and deploy however you like. |
0 commit comments