Chinaunix首页 | 论坛 | 博客
  • 博客访问: 705734
  • 博文数量: 67
  • 博客积分: 3148
  • 博客等级: 中校
  • 技术积分: 1084
  • 用 户 组: 普通用户
  • 注册时间: 2010-11-10 14:33
文章分类

全部博文(67)

文章存档

2013年(2)

2012年(11)

2011年(33)

2010年(21)

我的朋友

分类: LINUX

2010-12-02 18:04:11

个人非常喜欢tcpdump和wireshark两抓包工具,将tcpdump经常用到的列出来,方面查看。
 
tcpdump用法:
-s  截取包的长度,0表示抓整个数据包
-e  打印时列出mac address
-n  ip and port以数字方式显示
-i  应用在哪个端口
-r  从文件中读取抓包结果
-w  将抓包结果写入文件
-vv  写入文件时,可以看到抓包个数
express:
ip
arp
tcp
udp
icmp
port (src port,dst port)
portrange (src portrange,dst portrange)
ip proto \icmp
ip proto \tcp
ip proto \udp
ip broadcast
ip multicast

ether proto
ether proto \arp
ether broadcast
ether host
ether dst , ether src
eg:
tcpdump -i eth0 ether broadcast src ehost 02:01:00:00:00:00
tcpdump -i eth0 arp and ether host 00:0c:76:ff:3f:f1
gateway ???

less
greater

例子:
tcpdump dst net 192.168.1.0/24 and dst port not \( 22 or 1041\)
tcpdump dst net not 192.168.1.0/24 and dst port not \(www or 25\) and src port ! \(4011 or 4010 or 4009\)
阅读(2582) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2010-12-03 15:30:07

很好的, 收藏了 推荐一个博客,提供很多免费软件编程电子书下载: http://free-ebooks.appspot.com