当前位置:网站首页>tcpdump命令使用详解
tcpdump命令使用详解
2022-07-01 21:55:00 【victorwjw】
tcpdump命令使用详解_疯狂的小企鹅的博客-CSDN博客_tcpdump命令详解全网最详细的 tcpdump 使用指南 - 王一白 - 博客园Tcpdump抓包工具实战教程,让你知道一个抓包走天下!_哔哩哔哩_bilibili
一般如下几种类型的关键字:
关于数据类型的关键字:
包括host、port、net,例如host 192.168.1.1表示这是一台主机,net 192.168.0.0表示这是一个网络地址,port 22指明端口号是22,如果没有指明类型,则默认的类型是host
数据传输方向的关键字:
包括src、dst、dst or src、dst and src,这些关键字指明了传输的方向,比如src 192.168.1.1说明数据包源地址是192.168.1.1,dst net 192.168.0.0指明目的网络地址是192.168.0.0,默认是监控主机对主机的src和dst,即默认监听本机和目标主机的所有数据
协议关键字:
包括ip、arp、rarp、tcp、udp等,
其他关键字:
运算类型的:or、and、not、!
辅助功能型的:gateway、less、broadcast、greater
上面有完整的使用方法,下面节选部分常用的
tcpdump -i eth0 监听指定网卡eth0的所有传输数据包 , 多张网卡时必须指定哪张
tcpdump host 192.168.56.209 and ( 192.168.56.210 or 192.168.56.211 ) #捕获主机 192.168.56.209 和主机192.168.56.210或192.168.56.211的所有通信数据包(也可以是主机名,但要求可以解析出来IP地址)
tcpdump ip host node9 and ! www.baidu.com #捕获node9与其他所有主机的通信数据包(不包括www.baidu.com)
tcpdump -i eth0 src node10 #捕获源主机node10发送的所有的经过eth0网卡的所有数据包
-nn:不把协议和端口号转化成名字,速度也会快很多。
tcpdump icmp -w icmp.pcap 使用 -w 是写入数据到文件,而使用 -r 是从文件中读取数据。
tcpdump -vvAls0 | grep 'POST' 抓取 HTTP POST 请求包
tcpdump -nn -A -s1500 -l | egrep -i 'User-Agent:|Host:' 从 HTTP 请求头中提取User-Agent 和主机名
tcpdump 'tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)' 抓取 80 端口的 HTTP 有效数据包,排除 TCP 连接建立过程的数据包(SYN / FIN / ACK)
tcp协议报文头

通常 Wireshark(或 tshark)比 tcpdump 更容易分析应用层协议。一般的做法是在远程服务器上先使用 tcpdump 抓取数据并写入文件,然后再将文件拷贝到本地工作站上用 Wireshark 分析。
【网络安全常用工具】Wireshark抓包工具使用技巧,从入门到精通!Wireshark安装|Wireshark抓包|Wireshark工具使用|_哔哩哔哩_bilibili
边栏推荐
- # CutefishOS系统~
- Efficiency improvement - encourage personalized container development environment
- I graduated from college in 14 years and changed to software testing in 3 months. My monthly salary was 13.5k. At the age of 32, I finally found the right direction
- 【日常训练】326. 3 的幂
- A few minutes before work, I found out V-model and The difference between sync
- General use of qstringlist
- “信任机器”为发展赋能
- Cloud Vulnerability Global Database
- Fiori applications are shared through the enhancement of adaptation project
- Intelligent computing architecture design of Internet
猜你喜欢

Flynk SQL client uses comparison and is familiar with official documents

447-哔哩哔哩面经1

internal field separator

Using emqx cloud to realize one machine one secret verification of IOT devices

Turn -- bring it and use it: share a gadget for checking memory leaks

447 Bili Bili noodles warp 1

Sogou wechat app reverse (II) so layer

Hide the creation and use of users

Metauniverse may become a new direction of Internet development

Kubernetes create service access pod
随机推荐
Kubernetes创建Service访问Pod
pytorch训练自己网络后可视化特征图谱的代码
内部字段分隔符
Turn -- the underlying debugging principle of GDB is so simple
搜狗微信APP逆向(二)so层
深度学习--数据操作
Lc669. Prune binary search tree
Pytorch nn.functional.unfold()的简单理解与用法
mixconv代码
使用 EMQX Cloud 实现物联网设备一机一密验证
104. SAP ui5 table control supports multi select and how to select multiple table row items at a time with code
# CutefishOS系统~
[daily training] 66 add one-tenth
Flynk SQL client uses comparison and is familiar with official documents
Appium自动化测试基础 — APPium安装(一)
I graduated from college in 14 years and changed to software testing in 3 months. My monthly salary was 13.5k. At the age of 32, I finally found the right direction
SAP GUI 里的收藏夹事务码管理工具
Réimpression de l'article csdn
447 Bili Bili noodles warp 1
Electron学习(三)之简单交互操作