安装

brew install tcpreplay
yum install tcpreplay

tcpreplay 回放

tcpreplay is a tool for replaying network traffic from files saved with tcpdump or other tools which write pcap(3) files.

tcpreplay回放的报文要具备一定的格式pcap,格式不对,无法回放

使用网卡en0,报文syn.pcap回放10次
tcpreplay -i en0 -l 10 syn.pcap

tcpprep过滤报文;帮助信息 man tcpprep

tcpprep is a 'pcap(3)' file pre-processor which creates a cache file which provides "rules" for 'tcprewrite(1)' and 'tcpreplay(1)' on how to process and send packets

The basic operation of tcpreplay is to resend all packets from the input file(s) out a single file.  Tcpprep processes a pcap file and applies a set of user-specified rules to create a cache file which tells tcpreplay whether or not to send each packet and which interface the packet should be sent out of.

    For more details, please see the Tcpreplay Manual at: http://tcpreplay.appneta.com

tcpreplay默认回放*.pcap里所有的报文,而tcpprep的作用是进行过滤,通过过滤留下某些报文

生成目的端口为80的报文缓存文件
tcpprep -i *.pcap -o *.cache -p 80

tcprewrite 修改报文

Tcprewrite  is  a  tool  to rewrite packets stored in pcap(3) file format, such as created by tools such as tcpdump(1) and wireshark(1).  Once a pcap file has had it's packets rewritten, they can be replayed back out on the network using tcpreplay(1)  

把报文的端口修改为80->8080
tcprewrite -r 80:8080 -i syn-2.pcap -o test.pcap

tcpreplay-edit 直接回放编辑后的报文,不生成中间文件

遗留问题

有没有tcp拦截修改报文的工具?

参考

https://tcpreplay.appneta.com/wiki/captures.html

tcpreplay使用介绍的更多相关文章

  1. tcpreplay的使用指导

    Tcpreplay的介绍 简单的说, tcpreplay是一种pcap包的重放工具, 它可以将用ethreal, wireshark工具抓下来的包原样或经过任意修改后重放回去. 它允许你对报文做任意的 ...

  2. tcpreplay,tcprewrite的使用---张子芳

    [关键字]: tcpreplay, tcpprep, tcprewrite, libpcap, winpcap, linux, windows, cygwin[摘要]: 本文总结了tcpreplay的 ...

  3. TCPReplay使用---张子芳

    TCPReplay主要功能是将PCAP包重新发送,用于性能或者功能测试.但是在测试环境与原转包系统结构一般是不同的.比如被测试机的二层MAC地址与抓包机器的MAC不同,所以被测试机在二层处理时发现目的 ...

  4. tcpreplay安装使用

    #Author: ypguo#Data: 2010.4.23#Version:  1.2 增加了修改VLAN tag内容.                 1.1 修改了cygwin下安装的内容    ...

  5. tcpreplay安装使用经验

    tcpreplay安装使用经验   #Author: ypguo#Data: 2010.4.23#Version:  1.2 增加了修改VLAN tag内容.                 1.1 ...

  6. CSS3 background-image背景图片相关介绍

    这里将会介绍如何通过background-image设置背景图片,以及背景图片的平铺.拉伸.偏移.设置大小等操作. 1. 背景图片样式分类 CSS中设置元素背景图片及其背景图片样式的属性主要以下几个: ...

  7. MySQL高级知识- MySQL的架构介绍

    [TOC] 1.MySQL 简介 概述 MySQL是一个关系型数据库管理系统,由瑞典MySQL AB公司开发,目前属于Oracle公司. MySQL是一种关联数据库管理系统,将数据保存在不同的表中,而 ...

  8. Windows Server 2012 NIC Teaming介绍及注意事项

    Windows Server 2012 NIC Teaming介绍及注意事项 转载自:http://www.it165.net/os/html/201303/4799.html Windows Ser ...

  9. Linux下服务器端开发流程及相关工具介绍(C++)

    去年刚毕业来公司后,做为新人,发现很多东西都没有文档,各种工具和地址都是口口相传的,而且很多时候都是不知道有哪些工具可以使用,所以当时就想把自己接触到的这些东西记录下来,为后来者提供参考,相当于一个路 ...

随机推荐

  1. HiveQL 数据装在与导出

    一.向管理表中装载数据 1.向表中装载数据load 1)load语法 2)LOCAL  指的是操作系统的文件路径,否则默认为HDFS的文件路径 3)overwrite关键字 如果用户指定了overwr ...

  2. yum和apt-get 软件包管理器的用法及区别

    yum( Yellow dog Updater, Modified)是一个在Fedora和RedHat以及SUSE中的Shell前端软件包管理器. 一般来说著名的linux系统基本上分两大类: 1.R ...

  3. Tyvj P2044 ["扫地"杯III day2]旅游景点

    二次联通门 : Tyvj P2044 ["扫地"杯III day2]旅游景点 /* Tyvj P2044 ["扫地"杯III day2]旅游景点 并查集 先把大 ...

  4. redis系列(四):切换RDB备份到AOF备份

    1.准备环境 redis.conf服务端配置如下: daemonize yes port logfile /data//redis.log dir /data/ dbfilename dbmp.rdb ...

  5. GoCN每日新闻(2019-09-29)

    1. 干货满满的Go Modules和goproxy.cn https://juejin.im/post/5d8ee2db6fb9a04e0b0d9c8b 2. gnet: 一个轻量级且高性能的 Go ...

  6. Tkinter 之磁盘搜索工具实战

    一.效果图 二.代码 miniSearch.py from tkinter import * from tkinter import ttk, messagebox, filedialog from ...

  7. SyntaxError: Non-ASCII character 'æ' in file csdn.py on line 7, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

    错误信息: SyntaxError: Non-ASCII character , but no encoding declared; see http://python.org/dev/peps/pe ...

  8. 三大框架 之 Struts2

    目录 Struts2 Struts2简介 Struts2框架的作用 常见web层的框架 web框架特点 Struts2基本使用 Struts2执行流程 Struts2配置 struts2的加载顺序 P ...

  9. 解决url传递过程中加号变空格的问题<转>

    url传递过程中加号变空格在接收url参数的过程中,会发现如果参数中存在‘+’号,接收后会变成空格. 如11+22接收后变成11 22.要解决这个问题,需要将加号替换为%2B进行传递. 如11%2B2 ...

  10. longitudinal models | 纵向研究 | mixed model

    A longitudinal study refers to an investigation where participant outcomes and possibly treatments o ...