首页 > 其他 > 详细

1.8-抓包工具tcpdump和tshark

时间:2015-08-03 22:59:01      阅读:590      评论:0      收藏:0      [点我收藏+]

1:tcpdump

tcpdump -nn          当前终端下,查看网卡流量  -nn把域名和端口,显示为数字,而不是字符串

tcpdump -nn -c 100   指定抓取100个包数据

tcpdump -nn -i eth1  指定抓取数据的网卡,不指定,默认eth0

tcpdump -nn port 22  抓取指定端口的数据包

tcpdump -nn tcp and port 22       抓取tcp协议22端口的数据包

tcpdump -nn udp      抓取udp协议的数据包

tcpdump -nn tcp and port 80 and host 10.1.1.1   抓取tcp协议80端口,来源10.1.1.1的数据包

tcpdump -nn tcp and port 80 and host 10.1.1.1 -w 1.txt  抓取的数据包,保存到指定的文件。

tcpdump -nn tcp and port 80 and host 10.1.1.1 > 1.txt   抓取的数据包,保存到指定的文件。

抓取到的包是二进制格式,不能直接cat查看,可下载回来用专用工具查看,或者tcpdump -r 1.txt查看

1.txt只是数据包的流向,没有具体的操作内容。


tcpdump -nn -s0 tcp and port 80 -c 10 -w 1.txt  加上-s0才是抓取的具体数据包




2:tshark 软件包名称:wireshark  tshark功能比tcpdump强大,可查询具体的访问信息,如:图片文档等。

tshark -nn            效果和tcpdump效果基本相同

tshark -n -t a -R http.request -T fields -e "frame.time" -e "ip.src" -e "http.host" -e "http.request.method" -e "http.request.uri"  查询更详细的数据包动作,如:GET POST


1.8-抓包工具tcpdump和tshark

原文:http://llzdwyp.blog.51cto.com/6140981/1681348

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!