大网数据广告活动
服务器运维问答

How do I dump raw data from a TCP port in Windows using the netsh command?

· 52CE 我爱测

I have an apparently simple issue which is proving very difficult to find an answer for. The site has a highly-secured Windows Server 2019 installation and an appliance connected to it running on a certain TCP port. I need a samp…

问题原文

原帖链接 · Ruslan · CC BY-SA 4.0

I have an apparently simple issue which is proving very difficult to find an answer for.

The site has a highly-secured Windows Server 2019 installation and an appliance connected to it running on a certain TCP port.

I need a sample of the raw data coming out of that port, taken for a few minutes, dumped into a binary file. It needs to be as raw as possible (i.e. it needs to resemble what we would read from the TCP stream when we would connect to that same port from a local .NET application).

It is highly preferable to use only built-in Windows tools for this (i.e. netsh), but worst-case windump or telnet are also fine.

已采纳解答

原帖链接 · Swisstone · CC BY-SA 4.0

Yes, you can do that with netsh:

Run this command as admin:

netsh trace start capture=yes tracefile=c:\temp\trace.etl

then, stop the capture with netsh trace stop and grab the .etl file.

Download etl2pcapng on your computer, and use it to convert the .etl file in the pcapng format: etl2pcapng.exe in.etl out.pcapng

Finally, open the pcapng file with Wireshark or similar.

Note that if the server runs at least Windows Server 2019 Update 2004, you can use pktmon too.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2020-09-08)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。