当前位置:网站首页>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
边栏推荐
- Turn -- use setjmp and longjmp in C language to realize exception capture and collaboration
- 好友新书发布,祝贺(送福利)
- "Trust machine" empowers development
- “信任机器”为发展赋能
- QStringList 的常规使用
- MySQL stored procedure
- Cut noodles C language
- Today's sleep quality record 71 points
- 陈天奇的机器学习编译课(免费)
- Intelligent computing architecture design of Internet
猜你喜欢
隐藏用户的创建和使用
Stimulate new kinetic energy and promote digital economy in multiple places
447 Bili Bili noodles warp 1
Digital currency: far-reaching innovation
Favorite transaction code management tool in SAP GUI
Intelligent computing architecture design of Internet
Mysql5.7 set password policy (etc. three-level password transformation)
Using emqx cloud to realize one machine one secret verification of IOT devices
The median salary of TSMC's global employees is about 460000, and the CEO is about 8.99 million; Apple raised the price of iPhone in Japan; VIM 9.0 release | geek headlines
Fiori 应用通过 Adaptation Project 的增强方式分享
随机推荐
MySQL中对于索引的理解
SAP intelligent robot process automation (IRPA) solution sharing
Arlo's thinking after confusion
好友新书发布,祝贺(送福利)
转载csdn文章操作
C#/VB. Net to add text / image watermarks to PDF documents
Quantifiers of regular series
【c语言】malloc函数详解[通俗易懂]
阿洛迷茫后的思考
Pytorch's code for visualizing feature maps after training its own network
H5 model trained by keras to tflite
转--原来gdb的底层调试原理这么简单
Tourism Management System
Appium automated testing foundation - Supplement: introduction to desired capabilities parameters
Mysql5.7 set password policy (etc. three-level password transformation)
Deep learning -- data operation
MySQL view exercise
Appium自动化测试基础 — 补充:Desired Capabilities参数介绍
死锁的处理策略—预防死锁、避免死锁、检测和解除死锁
Talk about what parameters ZABBIX monitors