抓包&&分析包
tcpdump 抓包
wireshark的使用
追踪流
可以根据需要,对一条TCP/UDP流进行过滤
条件过滤
语法格式:
Protocol[.string] [Comparion operator] [value]
- Protocol:可支持的协议,如eth、ip、arp、tcp、udp等。可以通过以下截图查看可支持的协议有哪些。
- string:对应协议所支持的条件,如addr、port、flags、len等。
- Comparion operator:比较运算符,如==、!=、.=、、~、&等。
- value:要查找的值。
# 过滤所有包含地址192.168.0.180的数据
ip.addr == 192.168.0.180
# 过滤所有原地址是192.168.0.180的数据
ip.src == 192.168.0.180
# 过滤所有http协议的数据
http
# 过滤所有包含端口30080的数据
ip.dst == 192.168.0.180 && tcp.port == 30080
# 过滤所有http请求中包含“/”的数据
http.request.uri ~ "/"
# 过滤所有http的请求主机中包含"0.180"的数据
http.host matches "0.180"
参考地址:https://zhuanlan.zhihu.com/p/493256880
https://www.wireshark.org/docs/wsug_html_chunked/ChWorkBuildDisplayFilterSection.html
https://link.zhihu.com/?target=https%3A//gitlab.com/wireshark/wireshark/-/wikis/DisplayFilters
- Ethernet II : 数据帧帧头信息,数据链路层信息。
- Internet Protocal:IP头信息,网络层信息。
- Transmission Control Protocol:TCP头信息,传输层信息。
- File Transfer Protocol:数据段,应用层信息。
参考资料
wireshark包结构分析-参考地址:
https://blog.csdn.net/swpu_ocean/article/details/80030727
https://blog.csdn.net/firefile/article/details/80537053
https://www.cnblogs.com/bonelee/p/9577115.html