防火墙 IP 分片测试套件-fragroute

防火墙 IP 分片测试套件 - Linux 版本

概述

本测试套件基于 fragroute 工具,用于测试防火墙对 IP 分片的处理能力和安全性。

测试环境

  • **Fragroute 主机**: 192.168.1.2

  • **DUT (防火墙)**: 192.168.1.1

  • **目标 PC**: 192.168.2.2

测试拓扑

+--------mgt network---------+-----------------------+

| | |

| | |

| | |

ens160:10.9.105.143 | ens160:10.9.105.142

| | |

Fragroute ens192:192.168.1.2 -- DUT -- target ens192: 192.168.2.2

系统要求

  • Linux 操作系统(Ubuntu/Debian/CentOS/RHEL)

  • Root 或 sudo 权限

  • 网络连接正常

快速开始

1. 安装依赖

```bash

sudo bash install_dependencies.sh

  1. 运行测试前检查

bash#

bash pre_test_checklist.sh

  1. 执行完整测试套件

bash#

sudo bash run_tests.sh

  1. 或者使用快速启动脚本

bash#

sudo bash quick_start.sh

目录结构

plaintext

testcase/

├── configs/ # fragroute 配置文件

│ ├── normal_frag_256.conf

│ ├── normal_frag_512.conf

│ ├── tiny_frag_8.conf

│ ├── large_frag_2000.conf

│ ├── overlap_frag.conf

│ ├── ooo_frag.conf

│ ├── teardrop.conf

│ ├── flood.conf

│ └── invalid_frag.conf

├── logs/ # 测试日志

├── captures/ # 抓包文件

├── install_dependencies.sh # 依赖安装脚本

├── pre_test_checklist.sh # 测试前检查脚本

├── main.sh # 主测试执行脚本

├── run_single_test.sh # 单个测试执行脚本

├── quick_start.sh # 快速启动脚本

├── test_results.csv # 测试结果

└── README.md # 本文档

单独运行测试用例

查看所有可用测试

bash#

./run_single_test.sh

运行特定测试

bash#

正常分片测试(256字节)

sudo ./run_single_test.sh normal_256

微小分片测试

sudo ./run_single_test.sh tiny_8

Teardrop 攻击测试

sudo ./run_single_test.sh teardrop

查看结果

测试结果 CSV

bash#

cat test_results.csv

测试报告

bash#

cat test_report.txt

执行日志

bash#

tail -f logs/test_execution.log

分析抓包文件

bash#

使用 tcpdump 查看

tcpdump -r captures/test_name_timestamp.pcap

使用 Wireshark 图形界面查看

wireshark captures/test_name_timestamp.pcap

配置说明

修改网络接口

编辑 run_tests.sh,修改以下行:

bash#

INTERFACE="eth0" # 改为你的网卡名称,如 ens33, enp0s3 等

查看可用网卡:

bash#

ip addr show

修改 IP 地址

编辑脚本中的以下变量:

bash#

DUT_IP="192.168.1.1"

TARGET_IP="192.168.2.2"

FRAGROUTE_IP="192.168.1.2"

自定义 fragroute 配置

编辑 configs/ 目录下的 .conf 文件:

conf

分片大小

ip_frag <size> old\|new

乱序

order random|reverse

延迟(毫秒)

delay first|last|random <ms>

丢弃概率

drop first|last|random <prob-%>

TCP 分段

tcp_seg <size> old\|new

TTL 值

ip_ttl <ttl>

服务类型

ip_tos <tos>

参考资料

fragroute 官方文档

IP Fragmentation Attacks

测试 Checklist: firewall_ip_fragmentation_test_checklist.md

版本历史

v1.0 (2026-04-27): Linux 版本,支持自动化测试和结果记录

plaintext

tcp 部分未完成,静待后续。

完整代码下载https://download.csdn.net/download/dangdanding/92889523


相关推荐
JWIPC2 分钟前
MyClaw 3.0 自动化数据采集实战指南
linux·运维·笔记·科技·深度学习·物联网·自动化
Risehuxyc24 分钟前
MTU 和 MSS 详解
网络·智能路由器
Flynt38 分钟前
自托管重开实录:照 HN 419 分热帖让 AI 从零搭一遍,15 分钟踩了三个真坑
linux·开源·ai编程
ikgy1 小时前
JAVA EE:7.网络初识
网络
AlanAshley2 小时前
移动端省流方案:压缩+缓存
网络·缓存
EmbeddedChen3 小时前
Linux 怎么查看 IP 地址和网络状态?常用网络命令入门
linux·网络·ip·route·ping
FakeOccupational3 小时前
fpga系列 HDL : 选择RAM IP(Two Port IP核) 乒乓缓冲(Ping-Pong Buffer)工作流程
网络协议·tcp/ip·fpga开发
爱和冰阔落4 小时前
【Linux网络】GET 和 POST 真的只是参数位置不同吗?从 HTTP 请求方法、抓包分析到长连接与路由实战
linux·c++·http·网络编程·get与post
无足鸟ICT4 小时前
【RHCA+】_proc_pid_attr_exec
linux·运维·服务器
牙牙7054 小时前
接口一直超时,后端却查不出问题:TIME_WAIT 把本地端口耗尽了
linux·网络·tcp·连接池·故障排查·time_wait