tcpdump抓取指定ip和端口的tcp包
时间: 2023-11-22 08:51:11 浏览: 180
linux系统下使用tcpdump进行抓包方法
5星 · 资源好评率100%
要使用tcpdump抓取指定IP和端口的TCP包,你可以使用以下命令:
```
tcpdump -i eth0 -vnn '(src host 192.168.1.100 and dst port 22) or (src host 192.168.1.102 and dst port 80) and tcp'
```
这个命令将抓取源IP为192.168.1.100且目标端口为22的TCP包,以及源IP为192.168.1.102且目标端口为80的TCP包。选项`-i eth0`指定了要监听的网络接口,`-vnn`用于显示详细信息并禁用名称解析,`tcp`过滤器用于仅捕获TCP包。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* *3* [Linux系统 tcpdump 抓包命令](https://blog.csdn.net/qq_28807077/article/details/114544053)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 100%"]
[ .reference_list ]
阅读全文