加入收藏 | 设为首页 | 会员中心 | 我要投稿 武汉站长网 (https://www.027zz.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 服务器 > 搭建环境 > Windows > 正文

windows – 通过cmd捕获数据包

发布时间:2021-02-20 06:30:37 所属栏目:Windows 来源:网络整理
导读:我想知道是否有一个工具,我可以用来编写数据包捕获(命令行)脚本,而无需安装任何东西(最好不是pcap).这适用于 Windows机器;该工具将使用管理凭据运行. 我只想收集发送和发送的数据包的源/目标IP和端口对. Netstat不起作用,因为会话可以在几毫秒内打开和关闭

我想知道是否有一个工具,我可以用来编写数据包捕获(命令行)脚本,而无需安装任何东西(最好不是pcap).这适用于 Windows机器;该工具将使用管理凭据运行.

我只想收集发送和发送的数据包的源/目标IP和端口对. Netstat不起作用,因为会话可以在几毫秒内打开和关闭,并且会被遗漏.

快速的谷歌搜索显示,我将不得不支付昂贵的工具或坚持使用基于GUI的工具.

Windows 7及更高版本内置了此功能.
http://blogs.msdn.com/b/canberrapfe/archive/2012/03/31/capture-a-network-trace-without-installing-anything-works-for-shutdown-and-restart-too.aspx

The short version:

  1. Open an elevated command prompt and run: netsh trace start persistent=yes capture=yes tracefile=c:tempnettrace-boot.etl (make sure you have a temp directory or choose another location).

  2. Reproduce the issue or do a reboot if you are tracing a slow boot scenario.

  3. Open an elevated command prompt and run: netsh trace stop

Your trace will be stored in c:tempnettrace-boot.etl** or where ever you saved it. You can view the trace on another machine using netmon.

(编辑:武汉站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    热点阅读