1. iptrafic
iptrafic -s eth0
2. tcpdump
Capture packets from a particular ethernet interface
# tcpdump -i eth0
Capture only N number of packets
# tcpdump -c N -i eth0
Display Captured Packets in ASCII
# tcpdump -i eth0 -A
Display Captured Packets in HEX and ASCII using tcpdump
# tcpdump -i eth0 -XXX
Capture the packets and write into a file
# tcpdump -i eth0 -w /tmp/a.pcap
Reading the packets from a saved file
# tcpdump -ttt -r /tmp/a.pcap
Capture packets with proper readable timestamp
# tcpdump -ttt
Receive only the packets of a specific protocol type
# tcpdump -i eth0 <prt name>
# tcpdump -i eth0 arp
Receive packets flows on a particular port (eg. ssh port)
# tcpdump -i eth0 port 22
Capture packets for particular destination IP and Port
# tcpdump -i eth0 dst 10.181.140.216 and port 22
Filter Packets
#tcpdump -i eth0 not arp and not rarp
网络包抓取与分析
本文介绍了使用tcpdump工具进行网络包抓取的各种方法,包括指定接口、限制抓包数量、显示ASCII或HEX格式数据、保存抓取的包到文件、从文件读取数据、设置可读的时间戳、过滤特定协议或端口等高级用法。
467

被折叠的 条评论
为什么被折叠?



