当前位置:网站首页>Usage of tcpdump
Usage of tcpdump
2022-04-22 06:01:00 【Take a break and come on】
tcpdump yes Linux One of the powerful network data acquisition and analysis tools in .tcpdump It can completely intercept the data packets transmitted in the network and provide analysis . It supports for network layer 、 agreement 、 host 、 Network or port filtering , And provide and、or、not Wait for logical statements to help you get rid of useless information .
1. Common parameters
$ tcpdump # By default , Direct start tcpdump The first network interface is monitored ( Not lo mouth ) On all packets in circulation .
$ tcpdump -i eth1 # 【 Parameters 】-i, Specify network card , Such as eth0、eth1.
$ tcpdump -Q out # 【 Parameters 】-Q, Specify whether to output or output , Such as in、out、inout
$ tcpdump -c 10 # 【 Parameters 】-c, Specify the number of grab packets
$ tcpdump -X # 【 Parameters 】-X, Print out the contents of the captured data , Will 16 Into the system and ASCII Output in both ways .-XX, More details
$ tcpdump -v # 【 Parameters 】-v, Display detailed header information .-vv,-vvv More detailed
$ tcpdump -s 1024 # 【 Parameters 】-s, Specify the length of the intercepted package . Default 65535. If the length of the packet exceeds the intercepted length ,
# When interception occurs , Output guild output [|proto] The logo of . But the longer you set the length , The processing time of packages will also be longer
$ tcpdump -w test # 【 Parameters 】-w, Save the captured data to a file test in
$ tcpdump -r test # 【 Parameters 】-r , from test Read data from , Show it
Be careful : The above parameters can be used together . It can also be used with the following keywords
2. Common keywords
$ tcpdump dst 192.216.20.66 # 【 keyword 】dir Grab Designated receiver ID My bag
$ tcpdump src 192.216.20.144 # 【 keyword 】src Grab Specify the sender IP My bag
$ tcpdump host 192.216.20.66 # 【 keyword 】host Grab Specifies the packets sent and received by the host
$ tcpdump port 22 # 【 keyword 】port Grab Of the specified port IP My bag
$ tcpdump udp # 【 keyword 】 udp tcp Specify the capture protocol type .
$ tcpdump tcp
Be careful : Keywords need to be connected with logical operators or logical operation statements in the process of use , This is different from the usage of the parameters mentioned above .
The commonly used logical operation statements are :and、or &&、 ||
Take the non operator : not 、 ! ( When using the take non operator , You also need to use the and or operator to connect , Otherwise, report grammatical errors )
Example :
$ tcpdump -i eth0 dst 192.216.20.141 and not port 22 and udp -X -c 10
# -i eth0 Specify network card etho
# dir Specify to crawl to 192.216.20.141 My bag
# not port Exclude ports 22 Do not accept port 22 My bag
# udp Specify the agreement as udp
# -X Print out the content 12 Into the system and ASCII The way
# -c Just grab 10 A package
Besides :tcpdump It can be done with grep Specify to use with , To filter the data .
版权声明
本文为[Take a break and come on]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220541213606.html
边栏推荐
- Blue Bridge Cup 31 day sprint Day8
- Converts a nonnegative decimal integer n to a binary
- Introduction to machine learning -- Arg operation in numpy
- C/S架构
- RTL8367学习笔记1——基础知识
- redis定时写入,直播流视频拉取
- Torch uses stepping on the pit diary and matrix to speed up the operation
- layer关闭弹窗,刷新父页面
- stm32学习笔记5——RGB屏相对位置计算
- Deep understanding of callback functions
猜你喜欢
随机推荐
js数组取值的两种方式
06 - data type
15 - 容器 - 字典
Blue Bridge Cup 31 day sprint day18
Blue Bridge Cup Sprint - DFS
wgs84坐标转换,地图拾取wgs84坐标工具推荐
Blue Bridge Cup 31 day sprint Day7
第88篇 LeetCode剑指Offer动态规划(五)礼物的最大值
stm32学习笔记5——RGB屏相对位置计算
redis定时写入,直播流视频拉取
ocilib库连接oracle
Reading package list Finished analyzing dependency tree of package. Reading status information Some packages cannot be installed after completion. If you are using an unstable distribution, this may b
抓包工具mitmproxy和Anyproxy
Leetcode 486 Predicting Winners -- dynamic programming + game theory
机器学习入门——Numpy中的arg运算
LeetCode 589. Preorder traversal of n-ary tree
Pytorch deep learning practice_ 10 basis of convolutional neural network CNN
Subsets and problems (backtracking & branch and bound)
Blue Bridge Cup Sprint - and check the collection
11 - 流程控制-for循环









