防火墙 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


相关推荐
做运维的阿瑞31 分钟前
Python 标准库汇总:分类速览与常用模块清单
linux·运维·python
百万蹄蹄向前冲1 小时前
密码都对Node.js却连不上Linux数据库
linux·mysql
广州宏帝箱包1 小时前
出口箱包的包装标准:防潮、防摔、运输安全的设计要点
大数据·网络
彧azz1 小时前
Linux 网络编程学习总结
linux·网络·笔记·学习·面试
updayday8542 小时前
离职域账号状态变更与Ping64操作记录核对
大数据·网络·数据库·安全·智能路由器
susplus2 小时前
【ARM 裸机开发 (IMX6ULL-mini)】GNU工具、Makefile 工程构建、链接脚本详解|C 语言点灯 + 蜂鸣器驱动
linux·arm·makefile·imx6ull
Shadow(⊙o⊙)2 小时前
Linux进阶知识1.0
linux·运维·服务器
>Andre<2 小时前
UFS5.0标准中文全译·卷一:范围、术语与架构
android·linux·嵌入式硬件
安易算力3 小时前
PUE优化工程实践:从1.5到1.2的制冷架构与气流组织改造路径
网络·python·容器·架构·kubernetes
用户0510122572963 小时前
Linux下有关QT显示环境变量设置
linux·嵌入式