tcpdump抓包 wireshark(ethereal)分析

tcpdump 的抓包保存到文件的命令參數是-w xxx.cap
抓eth1的包
tcpdump -i eth1 -w /tmp/xxx.cap
抓 192.168.1.123的包
tcpdump -i eth1 host 192.168.1.123 -w /tmp/xxx.cap
抓192.168.1.123的80端口的包
tcpdump -i eth1 host 192.168.1.123 and port 80 -w /tmp/xxx.cap
抓192.168.1.123的icmp的包
tcpdump -i eth1 host 192.168.1.123 and icmp -w /tmp/xxx.cap
抓192.168.1.123的80端口和110和25以外的其他端口的包
tcpdump -i eth1 host 192.168.1.123 and ! port 80 and ! port 25 and ! port 110 -w /tmp/xxx.cap
抓vlan 1的包
tcpdump -i eth1 port 80 and vlan 1 -w /tmp/xxx.cap
抓pppoe的密碼
tcpdump -i eth1 pppoes -w /tmp/xxx.cap
以100m大小分割保存文件, 超過100m另開一個文件 -C 100m
抓10000個包後退出 -c 10000
後臺抓包, 控制檯退出也不會影響:
nohup tcpdump -i eth1 port 110 -w /tmp/xxx.cap &
抓下來的文件可以直接用ethereal 或者wireshark打開。 wireshark就是新版的ethereal,程序換名了,哈哈。
 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章