一,抓包

1.抓包命令

  • 开始你的网络请求
    tcpdump -i any -s 0 port 4018 -w 文件名

    注意:文件名后缀必须为.cap

  • Ctrl+C退出

  • wireshark打开该文件分析

示例

tcpdump -i any -s 0 -w mytest.cap

2.包分析过滤命令

http and ip.dst == 192.168.135.201 and ip.src == 192.168.128.48 and ip.proto == TCP 
and tcp.port == 8080

命令详解

  • http 查找协议为http的包【协议过滤可选择值 udp,http,dns】
  • ip.dst 请求接受的host【查找目标ip为192.168.135.201】
  • ip.src 请求发送方的host 【查找源ip为192.168.128.48】
  • ip.proto 【tcp,udp】
  • tcp.port 请求的端口号【tcp.dstport,tcp.srcport】
  • and 连接符【同 && 前后空格】

二,http抓包分析

1.查看http请求,参数内容

wireshark基本使用

2.查看http请求返回内容

wireshark基本使用

三,常用技巧

1.设置时间格式为人类可读格式

wireshark基本使用

2.创建抓包规则

wireshark基本使用

wireshark基本使用

3.保存一个抓包规则到文件

wireshark基本使用
wireshark基本使用

相关文章: