packet capture tool: tshark

在solaris下使用tshark命令可以方便抓取现网上的gtp-c v0/v1/v2/echo的包,gtp-u v0/v1的包,diameter s6a/s9的包,dns的包。

If needed, you can modify the name of the capture NIC and the file name:

gtpc: tshark -i igb0 -a files:2 -b filesize:1024 -b files:2 -w gtpc.cap -f "mpls and udp port 2123 or (udp port 3386 and ip[29]!=0xff)"


gtpcv0: tshark -i igb0 -a files:2 -b filesize:1024 -b files:2 -w gtpcv0.cap -f "mpls and udp port 3386 and ip[29]!=0xff"

gtpcv1: tshark -i igb0 -a files:2 -b filesize:1024 -b files:2 -w gtpcv1.cap -f "mpls and udp port 2123 and (ip[29]>=16 and ip[29]<=21)"

gtpcv2: tshark -i igb0 -a files:2 -b filesize:1024 -b files:2 -w gtpcv2.cap -f "mpls and udp port 2123 and ((ip[29]>=32 and ip[29]<=37) or (ip[29]>=66 and ip[29]<=69) or (ip[29]>=95 and ip[29]<=100) or (ip[29]>=162 and ip[29]<=165))"

gtpu: tshark -i igb0 -a files:2 -b filesize:1024 -b files:2 -w gtpu.cap -f "mpls and udp port 2152 or (udp port 3386 and ip[29]==0xff)"

gtpuv0: tshark -i igb0 -a files:2 -b filesize:1024 -b files:2 -w gtpuv0.cap -f "mpls and udp port 3386 and ip[29]==0xff"

gtpuv1: tshark -i igb0 -a files:2 -b filesize:1024 -b files:2 -w gtpuv1.cap -f "mpls and udp port 2152"

diameter s6a: tshark -i igb0  -a files:2 -b filesize:1024 -b files:2 -w dia_s6a.cap -f "mpls and ip[9]==132 and (ip[55]>=61 and ip[55]<=67)"
tshark -i igb0  -a files:2 -b filesize:1024 -b files:2 -w dia_s6a.cap -f "mpls and sctp port 3868 and (ip[55]>=61 and ip[55]<=67)"

dns: tshark -i igb0 -a files:2 -b filesize:1024 -b files:2 -w dns.cap -f "mpls and udp port 53"

echo: tshark -i igb0 -a files:2 -b filesize:1024 -b files:2 -w echo.cap -f "mpls and (udp port 2123 or upd port 3386) and (ip[29]>=1 and ip[29]<=2)"

echo v0: tshark -i igb0 -a files:2 -b filesize:1024 -b files:2 -w echov0.cap -f "mpls and upd port 3386 and (ip[29]>=1 and ip[29]<=2)"

echo v1: tshark -i igb0 -a files:2 -b filesize:1024 -b files:2 -w echov1.cap -f "mpls and udp port 2123 and (ip[28]&0x30>0) and (ip[29]>=1 and ip[29]<=2)"

echo v2: tshark -i igb0 -a files:2 -b filesize:1024 -b files:2 -w echov2.cap -f "mpls and udp port 2123 and (ip[28]&0x40>0) and (ip[29]>=1 and ip[29]<=2)"
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值