对Ubuntu进行远程抓包&Wireshark的简单筛选
标题
- 被远程的机器需要安装tcpdump
apt-get -y install tcpdump
- 在Windows本地将Wireshark添加到PATH中或者在安装目录下打开CMD
- 输入以下命令进行连接[1]
ssh [-p port] root@192.168.0.1 "tcpdump -i eth0 -l -w -" | wireshark -k -i -
- 注意登录用户需要有 root 权限(sudo提权未尝试)
- eth0为范例,请修改为实际接口
- 抓包完毕后筛选时如有较多本端和远端之间的数据,可通过下面的筛选格式筛选
(ip.src != x.x.x.x/xx or ip.dst = y.y.y.y) and (ip.dst != x.x.x.x/xx or ip.src != y.y.y.y) and tcp.flags.push == 1
- 本端和远端在同一个网段时才需要如此
tcp.flags.push == 1
旨在将带data的的 PUSH 包筛选出来
😄 😆 ❤️