当前位置:网站首页>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
边栏推荐
猜你喜欢

Fiori applications are shared through the enhancement of adaptation project

Mysql5.7 set password policy (etc. three-level password transformation)

MySQL5.7 设置密码策略(等保三级密码改造)

死锁的处理策略—预防死锁、避免死锁、检测和解除死锁

rxjs Observable of 操作符的单步调试分析

Configure filter

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

Redis configuration and optimization

"Trust machine" empowers development

Easyexcel complex data export
随机推荐
Daily question brushing record (10)
Multi picture alert ~ comparison of Huawei ECs and Alibaba cloud ECS
[C language] detailed explanation of malloc function [easy to understand]
Chen Tianqi's machine learning compilation course (free)
Kubernetes create service access pod
MySQL MHA high availability configuration and failover
Hide the creation and use of users
效率提升 - 鼓捣个性化容器开发环境
Understanding of indexes in MySQL
Talk about what parameters ZABBIX monitors
[daily training] 66 add one-tenth
Réimpression de l'article csdn
Flink SQL command line connection yarn
Efficiency improvement - encourage personalized container development environment
nn. Parameter] pytoch feature fusion adaptive weight setting (learnable weight use)
Mysql database detailed learning tutorial
Cut noodles C language
Use three JS realize the 'ice cream' earth, and let the earth cool for a summer
Intelligent computing architecture design of Internet
友善串口助手使用教程_友善串口调试助手怎么进行配置-友善串口调试助手使用教程…