Debian系统下使用Sniffer工具(以常见工具为例)的步骤如下:
以dsniff为例:
sudo apt update
sudo apt install dsniff # 安装dsniff
或安装netsniff(需从源码编译):
sudo apt install build-essential libncurses5-dev zlib1g-dev git
git clone https://github.com/netsniff/netsniff.git
cd netsniff
make && sudo make install # 编译安装
-Y 'tcp port 80')。/etc/netsniff/netsniff.conf,设置接口、过滤表达式等。sudo dsniff -i eth0 -Y 'tcp port 80' # 实时分析
sudo dsniff -i eth0 -w output.pcap # 保存为pcap文件
sudo /usr/local/bin/sniff # 启动,默认从配置文件读取参数
sudo apt install wireshark
wireshark output.pcap # 查看数据包详情
dsniff -r output.pcap -T fields # 显示数据包字段(源IP、协议等)
sudo或root权限,因捕获数据包需访问网络接口。参考来源: