大家可能都已经对著名的抓包工具Ethereal比较熟悉了,这里再介绍一种基于命令行的抓包工具tcpdump。

 

举例:抓本机1813端口上的数据,并将抓包结果保存在test.cap文件中

 

 

tcpdump -X -s 0 -w test.cap port 1813
-X Print each packet (minus its link level header) in hex and ASCII.
-s snaplen Setting snaplen to 0 means use the required length to catch whole packets.
-w file Write the raw packets to file rather than parsing and printing them out.

 

然后在本地可以用Ethereal图形化界面查看所抓到包的详细信息。这在通过远程登录在服务器上工作的情况下特别有用,因为终端模式无法用图形化工具抓包。

(责任编辑;A6)

本站文章仅代表作者观点,本站仅传递信息,并不表示赞同或反对.转载本站点内容时请注明来自www.linuxeden.com-Linux伊甸园。如不注明,www.linuxeden.com将根据《互联网著作权行政保护办法》追究其相应法律责任。