一、安装
sudo apt-add-repository ppa:wireshark-dev/stable
sudo apt-get update
sudo apt-get install wireshark
sudo groupadd wireshark
# 将dumpcap更改为wireshark用户组
sudo chgrp wireshark /usr/bin/dumpcap
# 让wireshark用户组有root权限使用dumpcap
sudo chmod 4755 /usr/bin/dumpcap
#将需要使用的普通用户名加入wireshark用户组
sudo gpasswd -a username wireshark
特别注意:弹出的设定选(是)
二、效果
三、具体应用
选择Resize All Collumns显示所有包的信息,可以看到所有获取的信息
在Filter输入想要抓取的协议类型:
#协议过滤,直接在Filter输入协议名称即可.
#常见的协议有tcp,udp,arp,http,ssl等
#过滤源ip、目的ip,如ip地址为127.0.0.1
ip.src==127.0.0.1
ip.dst==127.0.0.1
#端口过滤,如过滤80端口
tcp.port==80 #这条规则是把源端口和目的端口为80的都过滤出来
tcp.srcport==80 #只过滤源端口为80的包
tcp.dstport==80 #只过滤目的端口为80的包
#http协议过滤
http.request.method=="GET" #过滤post包
http.request.method=="POST"
#过滤两种条件时,使用and连接,如:过滤ip为192.168.0.190并且为http协议的ip.src==192.168.0.190 and http
四、参考资料
https://www.cnblogs.com/bonelee/p/7975887.html
https://blog.youkuaiyun.com/chenjh213/article/details/50382665