Chinaunix首页 | 论坛 | 博客
  • 博客访问: 330475
  • 博文数量: 53
  • 博客积分: 1132
  • 博客等级: 少尉
  • 技术积分: 451
  • 用 户 组: 普通用户
  • 注册时间: 2010-03-18 14:22
文章分类

全部博文(53)

文章存档

2014年(1)

2013年(11)

2012年(17)

2011年(16)

2010年(8)

分类:

2012-04-17 10:13:15

tshark是wireshark的命令行版本


下载:
选择Source Code

安装
yum install libpcap libpcap-devel
./configure&&make&&make install

使用:
文档:

例如:
监听http流量,并打印出host 和request url
./tshark -f "dst port 80" -l -p -a duration:10  -T fields -e http.host -e http.request.uri  -i 1

其中-i 1 为使用的网卡,可以根据下面的命令获得:
./tshark  -D

其他参数
-l is normally used when piping a live capture to a program or script, so that output for a packet shows up as soon as the packet is seen and dissected, it should work just as well as true line-buffering

-a ...  duration:NUM - stop after NUM seconds
                           filesize:NUM - stop this file after NUM KB
                              files:NUM - stop after NUM files

Don't put the interface into promiscuous mode. Note that the interface might be in promiscuous mode for some other reason; hence, -p cannot be used to ensure that the only traffic that is captured is traffic sent to or from the machine on which TShark is running, broadcast traffic, and multicast traffic to addresses received by that machine.


关于fields,可以通过-G来查看:
 ./tshark -G |grep http

阅读(7928) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~