树莓派上使用网络抓包工具Wireshark on your Raspberry Pi 4B

本文介绍Wireshark——一款强大的网络封包分析软件的安装与使用方法。Wireshark支持多种协议分析、多平台运行及多种文件格式读写。文章详细讲解了在树莓派上安装Wireshark的过程,并提供了基本的使用指导。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

0、序

  Wireshark is the world’s foremost and widely-used network protocol analyzer. Wireshark(前称Ethereal)是一个网络封包分析软件。网络封包分析软件的功能是撷取网络封包,并尽可能显示出最为详细的网络封包资料。Wireshark使用WinPCAP作为接口,直接与网卡进行数据报文交换,不单只能抓取网卡数据,还能抓取蓝牙广播包,BLE Mesh数据包(这个之后会有个专题讲讲)。
  Wireshark具有丰富的功能,其中包括以下所列:
●-深入检查数百种协议,并一直在增加;
●-实时捕获和离线分析;
●-多平台运行:在Windows,Linux,macOS,Solaris,FreeBSD,NetBSD和许多其他操作系统上运行;
●-读取/写入许多不同的捕获文件格式:tcpdump(libpcap),Pcap NG,Catapult DCT2000,Cisco Secure IDS iplog,Microsoft Network Monitor,Network GeneralSniffer®(压缩和未压缩),Sniffer®Pro和NetXray®,Network Instruments Observer ,NetScreen监听,Novell LANalyzer,RADCOM WAN / LAN分析器,Shomiti / Finisar Surveyor,Tektronix K12xx,Visual Networks Visual UpTime,WildPackets EtherPeek / TokenPeek / AiroPeek等;
●-可以从以太网,IEEE 802.11,PPP / HDLC,ATM,Bluetooth,USB,Token Ring,Frame Relay,FDDI等读取实时数据(取决于您的平台);
●-可解密多种协议,包括IPsec,ISAKMP,Kerberos,SNMPv3,SSL / TLS,WEP和WPA / WPA2;
●-数据包列表属性着色规则,以进行快速,直观的分析;
●-输出可以导出为XML,PostScript®,CSV或纯文本;

1、安装Wireshark

  本篇文章将讲述如何在树莓派上安装和使用这一强大的工具。
1)更新资源库

sudo apt-get update

2)安装Wireshark

sudo apt-get install wireshark

注:可参考-http://recipes.item.ntnu.no/wireshark-on-the-raspberry-pi/
在这里插入图片描述

2、使用

  点击图标的wireshark但是发现打开时候并没有本地的一些端口。
在这里插入图片描述
  目测是因为运行的权限不够,使用sudo获取root权限来运行的话,相关端口就能够正常读取了,

sudo wireshark &

在这里插入图片描述
  OK,那让我们来监听一下eth0网卡的数据:
在这里插入图片描述

Ethereal is a GUI network protocol analyzer. It lets you interactively browse packet data from a live network or from a previously saved capture file. See: http://www.ethereal.com for new versions, documentation, ... Ethereal's native capture file format is libpcap format, which is also the format used by tcpdump and various other tools. So Ethereal can read capture files from: -libpcap/WinPcap, tcpdump and various other tools using tcpdump's capture format -snoop and atmsnoop -Shomiti/Finisar Surveyor captures -Novell LANalyzer captures -Microsoft Network Monitor captures -AIX's iptrace captures -Cinco Networks NetXRay captures -Network Associates Windows-based Sniffer captures -Network General/Network Associates DOS-based Sniffer (compressed or uncompressed) captures -AG Group/WildPackets EtherPeek/TokenPeek/AiroPeek/EtherHelp/PacketGrabber captures -RADCOM's WAN/LAN analyzer captures -Network Instruments Observer version 9 captures -Lucent/Ascend router debug output -files from HP-UX's nettl -Toshiba's ISDN routers dump output -the output from i4btrace from the ISDN4BSD project -traces from the EyeSDN USB S0. -the output in IPLog format from the Cisco Secure Intrusion Detection System -pppd logs (pppdump format) -the output from VMS's TCPIPtrace/TCPtrace/UCX$TRACE utilities -the text output from the DBS Etherwatch VMS utility -Visual Networks' Visual UpTime traffic capture -the output from CoSine L2 debug -the output from Accellent's 5Views LAN agents -Endace Measurement Systems' ERF format captures -Linux Bluez Bluetooth stack hcidump -w traces There is no need to tell Ethereal what type of file you are reading; it will determine the file type by itself. Ethereal is also capable of reading any of these file formats if they are compressed using gzip. Ethereal recognizes this directly from the file; the '.gz' extension is not required for this purpose.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

@菠萝菠萝哒

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值