tcpreplay(常用的测试流量 播放工具)
来源:互联网 发布:python回调函数传参数 编辑:程序博客网 时间:2024/05/21 17:35
类似的播放的性质,将已经录好的pcap或tcpdump包,按照自己的定制方法(如播放次数、播放速度、指定端口等信息)播放流量
下载链接地址(可以官网下载,这里提供自己的网盘):http://pan.baidu.com/s/1vb8Ts
操作说明文档PDF :http://pan.baidu.com/s/1pBSZp
tcpreplay解析:
tcpreplay: Command line arguments required
tcpreplay (tcpreplay) - Replay network traffic stored in pcap files
USAGE: tcpreplay [ -<flag> [<val>] | --<name>[{=| }<val>] ]... <pcap_file(s)>
-q, --quiet Quiet mode
-T, --timer=str Select packet timing mode: select, ioport, rdtsc, gtod, nano, abstime
--sleep-accel=num Reduce the amount of time to sleep by specified usec
--rdtsc-clicks=num Specify the RDTSC clicks/usec
-v, --verbose Print decoded packets via tcpdump to STDOUT
-A, --decode=str Arguments passed to tcpdump decoder
-K, --enable-file-cache Enable caching of packets to internal memory
--preload-pcap Preloads packets into RAM before sending
-c, --cachefile=str Split traffic via a tcpprep cache file
-i, --intf1=str Server/primary traffic output interface
-I, --intf2=str Client/secondary traffic output interface
--listnics List available network interfaces and exit
-l, --loop=num Loop through the capture file X times
--pktlen Override the snaplen and use the actual packet len
-L, --limit=num Limit the number of packets to send
-x, --multiplier=str Modify replay speed to a given multiple
-p, --pps=num Replay packets at a given packets/sec
-M, --mbps=str Replay packets at a given Mbps
-t, --topspeed Replay packets as fast as possible
-o, --oneatatime Replay one packet at a time for each user input
--pps-multi=num Number of packets to send for each time interval
-P, --pid Print the PID of tcpreplay at startup
--stats=num Print statistics every X seconds
-V, --version Print version information
-h, --less-help Display less usage information and exit
-H, --help Display usage information and exit
-!, --more-help Extended usage information passed thru pager
--save-opts[=arg] Save the option state to a config file
--load-opts=str Load options from a config file
Options are specified by doubled hyphens and their name
or by a single hyphen and the flag character.
tcpreplay is a tool for replaying network traffic from files saved with
tcpdump or other tools which write pcap(3) files.
一般使用步骤:
方法一:(摘自pdf文档)
需要指定cache、pcap位置,可以构造新的报文替换到里面的ip地址和mac地址使得播放出新数据包源地址为本机IP地址
测试第一步:预处理生成Cache,命令为
tcpprep -a client -i test.tcpdump -o test.cache
这条命令将PCAP文件分成客户端和服务端,默认为客户端。发送时packet将分别从客户端和服务端发出。
测试第二步:重写IP地址和MAC地址,命令为
tcprewrite -e 192.85.1.2:192.85.2.2 --enet-dmac=00:15:17:2b:ca:14,00:15:17:2b:ca:15 --enet-smac=00:10:f3:19:79:86,00:10:f3:19:79:87 -c test.cache -i test.tcpdump -o 1.pcap
这条命令将eth0设为服务端接口,eth1设为客户端接口,重写了IP和MAC,可通过wireshark等工具打开1.pcap,查看修改是否成功。
测试第三步:重放packet,首先为了获取更高的发送速度,可以把文件放到/dev/shm目录下,最高速度有1倍左右的加速。重放命令为:
tcpreplay -i eth0 -I eth1 -l 1000 -t -c /dev/shm/test.cache /dev/shm/1.pcap
方法二:(播放测试流量最常使用的方法)
直接播放 可以解析的pcap报文,播放的源ip地址仍为录制的pcap文件中的源ip地址
(下面的测试包使用snort数据包记录器模式,记录生成。也可以使用wireshark,sniffer等抓包工具捕获)
tcpreplay -i eth1 -l 1000 -t /root/snort.log.1381554309
- tcpreplay(常用的测试流量 播放工具)
- [解决]libnids接收不到tcpreplay打入的流量数据包
- 巧用Tcpreplay重写攻击流量
- 巧用Tcpreplay让攻击流量瞒天过海
- android语音播放工具(播放的同时异步存储)
- tcpreplay,tcprewrite的使用
- tcpreplay的使用方法
- tcpreplay,tcprewrite的使用
- tcpreplay
- tcpreplay
- YUV测试序列下载及视频序列的单帧播放工具使用
- tcpreplay重放速度的控制
- tcpreplay回放捕获的数据包
- Tcpreplay让协议测试从此无忧
- Tcpreplay让协议测试从此无忧
- 常用网络命令(十七)TcpReplay发包工具
- 音效播放工具类的简单封装
- Qt基于libzplay库的音乐播放工具
- TouchEvent事件中的 速度跟踪类----------------VelocityTracker----
- jquery的DOM操作
- java中获取路径的方法
- JAVA运行原理
- [转载]图像处理和计算机视觉中的经典论文(转)
- tcpreplay(常用的测试流量 播放工具)
- VS2005下QT学习笔记-导入.qrc资源文件
- java异常分类
- _vimrc4Vim73
- [转载]收藏:49 款人脸检测/识别的API、库和软件
- Android 中数据库查询方法 query() 中的 selectionArgs 的用法
- OC中 #include、#import、@class 区别
- 凡客陷资金链危机 传闻雷军或将接盘
- android长按home键流程