博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
tcpdump
阅读量:6342 次
发布时间:2019-06-22

本文共 2048 字,大约阅读时间需要 6 分钟。

tcpdump [options] 过滤条件

获取报文的条件:        
        
ip src host 172.16.100.1
tcp src or dst port 21
udp dst port 53
tcp src or dst port 21 AND src host 172.16.100.1
tcp port 21 AND host 172.16.100.1
        
        
        
tcpdump的语法:
tcpdump [options] [Protocol] [Direction] [Host(s)] [Value] [Logical Operations] [Other expression]
Protocol(协议):
Values(取值): ether, fddi, ip, arp, rarp, decnet, lat, sca, moprc, mopdl, tcp and udp.
If no protocol is specified, all the protocols are used.
Direction(流向):
Values(取值): src, dst, src and dst, src or dst
If no source or destination is specified, the "src or dst" keywords are applied. (默认是src or dst)
For example, "host 10.2.2.2" is equivalent to "src or dst host 10.2.2.2".
Host(s)(主机):
Values(替代关键字): net, port, host, portrange.
If no host(s) is specified, the "host" keyword is used. 默认如果此段没有指定关键字,默认即host。
For example, "src 10.1.1.1" is equivalent to "src host 10.1.1.1".
Logical Operations:
(1) AND
and or &&
(2) OR
or or ||
(3) EXCEPT
not or !
常用选项:
-i any : Listen on all interfaces just to see if you're seeing any traffic.
-n : Don't resolve hostnames.
-nn : Don't resolve hostnames or port names.
-X : Show the packet's contents in both hex and ASCII.
-XX : Same as -X, but also shows the ethernet header.
-v, -vv, -vvv : Increase the amount of packet information you get back.
-c # : Only get x number of packets and then stop.
-s : Define the snaplength (size) of the capture in bytes. Use -s0 to get everything, unless you are intentionally capturing less.
-S : Print absolute sequence numbers.
-e : Get the ethernet header as well.
-q : Show less protocol information.
-E : Decrypt IPSEC traffic by providing an encryption key.
-A :Display Captured Packets in ASCII
-w /path/to/some_file : Capture the packets and write into a file
-r /path/from/some_file : Reading the packets from a saved file
-tttt : Capture packets with proper readable timestamp
ip host 172.16.100.1
ip src host 172.16.100.1
ip dst host 172.16.100.1
ip src and dst host 172.16.100.1
tcp src port 110

 

协议报文分析器:

    sniffer: 商业工具
tcpdump, wireshark(GUI), tshark(CLI)

转载地址:http://zpkla.baihongyu.com/

你可能感兴趣的文章
yii2.0数据库操作
查看>>
oc底层方法调用流程
查看>>
linux中的NFS服务器配置及/etc/exports
查看>>
图解windows系统 硬盘主分区、扩展分区、逻辑分区的区别.
查看>>
Hibernate JPA @Column说明
查看>>
linux的find查找命令用法
查看>>
HTTPS-p7b证书转换
查看>>
学习资料
查看>>
别招人烦
查看>>
IPSec的网络穿越-边界
查看>>
python django 关于出错自动发送邮件
查看>>
最新网络用语解读
查看>>
P1939 【模板】矩阵加速(数列)
查看>>
Android和iOS那个好?
查看>>
闲时杂谈之系统安装
查看>>
map进程数量和reduce进程数量
查看>>
Redhat 6.1无人值守安装
查看>>
js之prototype
查看>>
ExtJS Grid中文字链接点击事件的更合理的处理办法
查看>>
我的友情链接
查看>>