一.wirshark安装
打开网址 http://www.wireshark.org,进入 Wireshark 官网,如图所示。
![](https://img-blog.csdnimg.cn/img_convert/414e594849ba1e30e0b7814ae220f906.png)
点击图标下载页面进行下载
![](https://img-blog.csdnimg.cn/img_convert/c85481718a30035bbf4fa33c2b7e7316.png)
这里下载 Windows 64 位的安装包。单击 Windows Installer(64-bit) 链接,进行下载。下载后的文件名为 Wireshark-win64-4.0.4.exe。
![](https://img-blog.csdnimg.cn/img_convert/76c41ec3a307d5094caf213793426f76.png)
直接点击Next,自定义安装目录
![](https://img-blog.csdnimg.cn/img_convert/821ee866328cdd5e853b85fb728ef982.png)
![](https://img-blog.csdnimg.cn/img_convert/85851092e6751a8d3bbd8bcf845605af.png)
![](https://img-blog.csdnimg.cn/img_convert/037e12d306588f3ff728e4dc8ee51bec.png)
![](https://img-blog.csdnimg.cn/img_convert/13f61df51aa791c634c3bd26eb82afe0.png)
![](https://img-blog.csdnimg.cn/img_convert/88c108de8001ff9bfddc057e61b78ff2.png)
![](https://img-blog.csdnimg.cn/img_convert/8f81aaa82609e9b9492d527586f5a88c.png)
![](https://img-blog.csdnimg.cn/img_convert/be13c7e215eb5b81665d9daa25969851.png)
![](https://img-blog.csdnimg.cn/img_convert/5ab32eee2a5d349839d2fce2bebe381e.png)
![](https://img-blog.csdnimg.cn/img_convert/e1ed2b2ad7f794b8a7c26f809e91c64b.png)
![](https://img-blog.csdnimg.cn/img_convert/c5c763e4812d2700e6749b67c1afda7c.png)
二.wirshark设置中文
![](https://img-blog.csdnimg.cn/img_convert/36e743b6931b41bd9de06baf143aa8eb.png)
![](https://img-blog.csdnimg.cn/img_convert/6ad156fc24b90709a277d12f8c8c2f09.png)
三.wirshark使用
wirshark开始页面
![](https://img-blog.csdnimg.cn/img_convert/c90d647de4805063a997127a4e264a76.png)
【注意】wireshark是捕获机器上的某一块网卡的网络包(网络包都是通过主机的网卡发出到对应的服务器上面,可以理解为应用层发出的请求网络包由本机网卡发向指定主机上),所以当机器上有多块网卡的时候,你需要选择一个网卡(可以上网的那一个网卡)
开始抓包,双击当前网卡或者点击蓝色图标
![](https://img-blog.csdnimg.cn/img_convert/8d8d0c49869ba40088d251af7508c44a.png)
wirshark窗口介绍
![](https://img-blog.csdnimg.cn/img_convert/29ac1c819d064f3d9f3d253deb7aafe0.png)
![](https://img-blog.csdnimg.cn/img_convert/28eace11de7c6744ee03c00851710ead.png)
![](https://img-blog.csdnimg.cn/img_convert/3dd40ac9c58555e9963e165f89617c5c.png)
过滤
抓包过滤器类型Type(host、net、port)、方向Dir(src、dst)、协议Proto(ether、ip、tcp、udp、http、icmp、ftp等)、逻辑运算符(&& 与、|| 或、!非)
4.1协议过滤:
TCP,只显示TCP协议的数据包列表
HTTP,只查看HTTP协议的数据包列表
ICMP,只显示ICMP协议的数据包列表
4.2 IP过滤
ip.src 192.168.1.104 #显示源地址为192.168.1.102网络请求封包。
ip.dst 192.168.1.104 #目标地址为192.168.1.102网络请求封包。
ip.src 192.168.1.104 or ip.dst 192.168.1.104 #源地址或者目的地址是192.168.1.104
4.3端口过滤
比如 tcp.port ==80 #显示端口为80的网络请求封包。
比如 tcp.srcport == 80 #只显示TCP协议的端口为80的网络请求封包。
HTTP模式过滤
比如 http.request.method=="GET": 只显示HTTP GET请求方法的网络请求封包。
![](https://img-blog.csdnimg.cn/img_convert/b677d04eec00a9022358e1d32690486c.png)
![](https://img-blog.csdnimg.cn/img_convert/8e2b8e30177019de6631555e3f61276a.png)