当前位置:网站首页>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
边栏推荐
- [C language] detailed explanation of malloc function [easy to understand]
- Origin2018安装教程「建议收藏」
- Intelligent computing architecture design of Internet
- cvpr2022 human pose estiamtion
- Map container
- Fiori 应用通过 Adaptation Project 的增强方式分享
- Two schemes of transforming the heat map of human posture estimation into coordinate points
- 447-哔哩哔哩面经1
- Metauniverse may become a new direction of Internet development
- 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
猜你喜欢
![[target tracking] | single target tracking indicator](/img/07/033d5c07b07e3443330840e98940b3.png)
[target tracking] | single target tracking indicator

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

Hide the creation and use of users

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

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

map容器

Appium automation test foundation - appium installation (I)

447-哔哩哔哩面经1

Appium automated testing foundation - Supplement: introduction to desired capabilities parameters

Learn MySQL from scratch - database and data table operations
随机推荐
447 Bili Bili noodles warp 1
# CutefishOS系统~
Talk about what parameters ZABBIX monitors
Mysql database detailed learning tutorial
Use three JS realize the 'ice cream' earth, and let the earth cool for a summer
There is no signal in HDMI in computer games caused by memory, so it crashes
正则系列之量词(Quantifiers)
隐藏用户的创建和使用
Efficiency improvement - encourage personalized container development environment
轉載csdn文章操作
激发新动能 多地发力数字经济
Deadlock handling strategies - prevent deadlock, avoid deadlock, detect and remove deadlock
Mysql5.7 set password policy (etc. three-level password transformation)
下班前几分钟,我弄清了v-model与.sync的区别
Cloud Vulnerability Global Database
[daily training] 326 Power of 3
104. SAP UI5 表格控件的支持复选(Multi-Select)以及如何用代码一次选中多个表格行项目
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
ECMAScript 2022 was officially released. Have you heard about it?
Flynk SQL client uses comparison and is familiar with official documents