涉及数据包的一些操作 的常用工具以及库

1、 wireshark  --------------- 数据包 抓取工具

 有linux版本  && window版本  ,可以截取想要编号的数据包

file -> export specified packets  导出一条数据流。


2、tcpdump  ------------------linux 命令行 抓包工具

如:   

tcpdump  -i   eth0  host 192.168.2.1 -w  lcf.pcap             

含义: 《通过网卡eth0 抓取 ip 192.168.2.1 的数据包 并将其 保存为 lcf.pcap》


3、tcpreplay    -------------------数据包回放指令 

如:  

tcpreplay  -i  eth3  -M 600  -l 1   t500.pcap 

       含义:  通过 网卡eth3 , 以600M/s 的速率, 循环一次回放 数据包 t500.pcap 里面的 数据,-l 0 表示循环播放

   (当然 你可以在某些网站下载一些数据包播放器)


有时候特殊 比如要发一个 很大的数据包 这个时候需要使用 PF_RING的用户态程序pfsend进行发包

pfsend & large pcap files
the idea of pfsend is to be able to reproduce the file as fast as possible. Hence we load the pcap in memory and inject it. The consequence is that in case of huge files we have the problem you reported.



4、Bittwiste - pcap 编辑工具

Bittwiste的官方开源地址:bittwist.sourceforge.net。软件提供了三个版本,分别针对FreeBSD、Linux、Windows系统。需要在什么平台编译,下载相关的源码包即可.


示例:

将目的ip从192.168.1.3修改为10.10.10.10

# bittwiste -I in.pcap -O out.pcap -T ip -d 192.168.1.3,10.10.10.10

将一个 数据包生成多个数据包,并将所有的数据包的 192.168.2.1 改为 192.168.2.X  

for((i=1;i<251;i++))
do
bittwiste -I  test.pcap -O test-${i}.pcap -T ip -s 192.168.2.1,192.168.2.${i} -d 192.168.2.1,192.168.2.${i}
done

reference:

 http://bittwist.sourceforge.net/

 http://www.lovemytool.com/blog/2011/05/bittwiste-pcap-capture-file-editor-by-joke-snelders.html

5、 libnet

    调用库函数的一些api填充里面的一些 结构体字段信息 ,以此来发送数据包 给特定ip


6、libpcap,winpcap 

同样调用一些库函数api,以此来抓取特定数据包,保存成pcap文件。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

tiny丶

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值