当前位置:网站首页>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
边栏推荐
- 恶意软件反向关闭EDR的原理、测试和反制思考
- 每日刷题记录 (十)
- 台积电全球员工薪酬中位数约46万,CEO约899万;苹果上调日本的 iPhone 售价 ;Vim 9.0 发布|极客头条
- Turn -- go deep into Lua scripting language, so that you can thoroughly understand the debugging principle
- Appium automation test foundation - appium installation (I)
- Fiori 应用通过 Adaptation Project 的增强方式分享
- 下班前几分钟,我弄清了v-model与.sync的区别
- Réimpression de l'article csdn
- nn. Parameter] pytoch feature fusion adaptive weight setting (learnable weight use)
- Awoo's favorite problem (priority queue)
猜你喜欢

El input text field word limit, beyond which the display turns red and input is prohibited

使用 EMQX Cloud 实现物联网设备一机一密验证

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

Kubernetes创建Service访问Pod

【无标题】

每日刷题记录 (十)

104. SAP ui5 table control supports multi select and how to select multiple table row items at a time with code

搜狗微信APP逆向(二)so层

Rust language - Introduction to Xiaobai 05

Kubernetes create service access pod
随机推荐
SAP 智能机器人流程自动化(iRPA)解决方案分享
447 Bili Bili noodles warp 1
Resttemplate remote call tool class
vSphere+、vSAN+来了!VMware 混合云聚焦:原生、快速迁移、混合负载
LC501. Mode in binary search tree
General use of qstringlist
Compensation des créneaux horaires
Deep learning -- data operation
Reprint CSDN article operation
Friendly serial assistant tutorial_ How to configure friendly serial port debugging assistant - tutorial on using friendly serial port debugging assistant
【QT小作】封装一个简单的线程管理类
Cutefishos system~
Today's sleep quality record 71 points
转--原来gdb的底层调试原理这么简单
redis配置文件中常用配置详解[通俗易懂]
轉載csdn文章操作
H5 model trained by keras to tflite
Appium自动化测试基础 — APPium安装(一)
El input text field word limit, beyond which the display turns red and input is prohibited
阿洛迷茫后的思考