JM00NJ/Nested-ICMP-Exploitation
GitHub: JM00NJ/Nested-ICMP-Exploitation
一款基于x86-64汇编与Python的高速网络压力测试工具,通过构造嵌套畸形ICMP数据包评估网络设备协议栈的安全性。
Stars: 1 | Forks: 0
# Nested-ICMP-Exploitation
🛡️ 概述
本项目是一款高速网络压力测试工具,旨在评估网络协议栈对畸形和嵌套 ICMP 数据包的抵御能力。它结合了 x86-64 Assembly 的原生性能以实现精确的数据包构造,并利用 Python 的多处理能力实现高吞吐量传输。
其核心逻辑专注于嵌套 ICMP 利用技术,即在“目标不可达”(Type 3, Code 3)错误消息中封装一个伪造的“回显请求”(Echo Request),并特意使用“负零”校验和来对内核级数据包进行压力测试。
# 效果说明:该工具对 Stateless 设备(路由器、IoT 设备、简单防火墙)最有效,因为它们必须处理 ICMP 错误消息。有状态系统(Windows WFP、现代 Android 内核)可能会因安全策略而静默丢弃这些非请求数据包。
# 故意畸形化:引擎故意构造非标准的 36 字节头部序列(IP | ICMP | ICMP)
🚀 主要特性
```
Assembly-Powered Crafting: IP and ICMP headers are manually constructed in Assembly to bypass standard OS limitations.
Nested Header Injection: Exploits logical flaws in how operating systems parse nested protocol headers.
IP Spoofing: Integrated randomized source IP generation for advanced anonymity and saturation testing.
Raw Socket Injection: Utilizes Raw Sockets via Python's ctypes to pass memory pointers directly to the Assembly engine.
```
⚡ 性能调优(NIC 优化)
为了防止网络接口卡(NIC)成为瓶颈并避免 ENOBUFS(内核缓冲区溢出)错误,必须调整传输队列长度。
默认的 txqueuelen 1000 不足以应对该引擎生成的 PPS(每秒数据包数)。强烈建议将此值增加到 10,000 或 20,000:
# 为您的接口设置传输队列长度
sudo ip link set txqueuelen 10000
🛠️ 技术深入剖析
“恶意”数据包结构
引擎构建一个 36 字节的头部序列,后跟自定义 payload:
```
IPv4 Header (20 bytes): Features a dynamic ID via RDTSC and a forced "Don't Fragment" (DF) flag.
Outer ICMP (8 bytes): Type 3 Code 3 (Destination Unreachable).
Inner "Evil" ICMP (8 bytes): A spoofed Echo Request with a 0xFFFF checksum, designed to trigger edge-case logic in packet parsers.
```
构建与编译
```
Assemble the core:
nasm -f elf64 libicmp_v4_encap.asm -o libicmp_v4_encap.o
Link as a shared object:
gcc -shared -o libicmp_v4_encap.so libicmp_v4_encap.o
```
有关 Assembly 代码的详细分解:
## 👉 NetaCoding - https://netacoding.blogspot.com/2026/02/nested-icmp.html
⚠️ 免责声明
本工具仅用于教育目的和经授权的安全审计。未经事先书面同意对系统进行未经授权的使用是非法且不道德的。
标签:0day挖掘, DDoS攻击, ICMP协议, ICMP嵌套, IP欺骗, Python, Raw Socket, x86-64, 内核安全, 协议封装, 安全报告生成, 快速连接, 情报收集, 拒绝服务, 无后门, 校验和绕过, 汇编语言, 流量生成, 漏洞研究, 物联网安全, 畸形数据包, 网络协议分析, 网络压力测试, 网络安全, 网络栈弹性, 逆向工具, 配置错误, 隐私保护