tcpdump及wireshark组合使用

[ tcpdump ]

不查询某个端口的报文
tcpdump -i eth0 port not 22

#携带主机和端口
tcpdump -i eth0 -vvv port 28807 and host 10.43.36.91 

对本机的udp 123 端口进行监视 123 为ntp的服务端口
tcpdump udp port 123

截获主机hostname发送的所有数据
tcpdump -i eth0 src host hostname

监视所有送到主机hostname的数据包
tcpdump -i eth0 dst host hostname

在em1网卡上捕获所有与10.43.35.175相关的数据包
tcpdump -i em1 host 10.43.35.175

#显示mac地址
tcpdump -e -i eth0 

# tcpdump 抓包 ipv6 icmp6
tcpdump -i eth2 icmp6

# TCP报文 标志位 为 reset 
tcpdump 'tcp[13] & 4!=0'
tcpdump 'tcp[tcpflags] == tcp-rst'

# tcpdump 参数
-n 不解析主机 直接显示地址
-nn 不解析端口

[ wireshark ]

# 修改 https 默认端口 协议呈现 https tls ssl
编辑-首选项-协议-http tls/ssl端口添加自定义端口

# http 报文 url 包含 subscribe
http.request.full_uri contains "subscribe"

# 报文 包含 xxxx 字符串
frame contains "xxxx"

#Wireshark 按照 状态码 过滤
http.response.code == 500

# 应答包的重传 
'[TCP Dup ACK ?#?]' 

sequence 的差值表示本端发送的数据包的长度
acknowledgment 的差值表示本端接收的数据包的长度
ipv6的报文头长度是74?

原文地址:https://www.cnblogs.com/kingcs/p/14456483.html