从 Windows 用户模式转储文件中识别主机
有没有一种简单的方法可以找出通过 WinDbg 生成用户模式转储文件的计算机的主机名?
或者至少尝试确认两个转储文件来自同一系统的任何识别信息。
Is there an easy way of finding out the host name of a machine that generated a user mode dump file via WinDbg?
Or at least any piece of identifying information to try and confirm that two dump files came from the same system.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
在内核和用户模式下,
检索目标 PC 的计算机名称(又名主机名)。
它需要加载
EXTS.dll
扩展,以及 Windows XP+(撰写本文时为 W10 RS3)。在内核模式下,这不能直接工作,
!envvar
将返回空您当前的上下文是一个空闲线程。
WinDbg(Windows 10 RS3 16299.15 SDK)针对
!process
的帮助仅列出了位 0-4,但是我发现位 5 在与 0 和 4 一起使用时会转储整个环境。Flags =0b110001
。 所以我在 WinDbg 启动脚本期间使用它来自动记录计算机名称。将转储所有环境变量:
您可以单击 PEB dml 链接,或通过
.process /p
切换上下文,然后!envvar COMPUTERNAME
也会工作。In both kernel and user mode,
Retrieves the computer name aka hostname of the target PC.
It requires
EXTS.dll
extension to be loaded, and Windows XP+ (W10 RS3 at the time of writing).In kernel mode, this does not work directly,
!envvar
will return emptyYour current context is an idle thread.
WinDbg (Windows 10 RS3 16299.15 SDK) help for
!process
only lists bits 0-4, however I found bit 5 dumps whole environment when used with 0 and 4. Flags =0b110001
. So I use this during WinDbg startup script to automatically log the computer name.Will dump the all the environment variables:
You could click on a PEB dml link, or switch context via
.process /p <PROCESS_ADDRESS>
, then!envvar COMPUTERNAME
would also work.对于 IP 地址列表:
3:kd> 杜 poi(poi(srvnet!SrvAdminIpAddressList))
ffffe001<代码>d3d58450“127.0.0.1”
3:kd> 杜
ffffe001d3d58464“::1”
3:kd>
ffffe001<代码>d3d5846c“169.254.66.248”
3:kd>
ffffe001d3d5848a“”
3:kd>
ffffe001
d3d5848c "fe80::f0cb:5439:f12f:42f8"
d3d584c0“”3:kd>
ffffe001
3:kd>
ffffe001<代码>d3d584c2“192.168.104.249”
3:kd>
ffffe001d3d584e2“”
3:kd>
ffffe001`d3d584e4“fe80::fc6f:ae16:b336:83dc”
3:kd>
For IP Address list:
3: kd> du poi(poi(srvnet!SrvAdminIpAddressList))
ffffe001
d3d58450 "127.0.0.1"
d3d58464 "::1"3: kd> du
ffffe001
3: kd>
ffffe001
d3d5846c "169.254.66.248"
d3d5848a ""3: kd>
ffffe001
3: kd>
ffffe001
d3d5848c "fe80::f0cb:5439:f12f:42f8"
d3d584c0 ""3: kd>
ffffe001
3: kd>
ffffe001
d3d584c2 "192.168.104.249"
d3d584e2 ""3: kd>
ffffe001
3: kd>
ffffe001`d3d584e4 "fe80::fc6f:ae16:b336:83dc"
3: kd>
您可以通过使用 WinDbg 分析用户转储文件来完成此操作。 运行
!peb
命令并在其输出中查找COMPUTERNAME
的值。You can do so by analyzing the user dump file with WinDbg. Run the
!peb
command and look for the value ofCOMPUTERNAME
in its output.来自 debugger.chm:
在内核模式转储文件中查找计算机名称
如果需要确定进行故障转储的计算机的名称,可以使用 !peb 扩展名并查看对于 COMPUTERNAME 的值,它是其输出。
或者您可以使用以下命令:
在内核模式转储文件中查找 IP 地址
要确定进行故障转储的计算机的 IP 地址,请查找显示某些发送信息的线程堆栈/接收网络活动。 打开发送数据包或接收数据包之一。 IP 地址将在该数据包中可见。
编辑:我会注意到,根据转储文件的创建方式,PEB 信息可能不可用,因此您总是无法找到计算机名称。 特别是如果某些内容来自 Microsoft Winqual 网站,则它已被清理。
在 PEB 中使用环境变量的快捷方式:!envvar COMPUTERNAME
From debugger.chm:
Finding the Computer Name in a Kernel-Mode Dump File
If you need to determine the name of the computer on which the crash dump was made, you can use the !peb extension and look for the value of COMPUTERNAME it its output.
Or you can use the following command:
Finding the IP Address in a Kernel-Mode Dump File
To determine the IP address of the computer on which the crash dump was made, find a thread stack that shows some send/receive network activity. Open one of the send packets or receive packets. The IP address will be visible in that packet.
EDIT: I will note that depending on how the dump file was created, the PEB information may not be available and so you won't always be able to find the computer name. Particularly if something came through the Microsoft Winqual site, it has been sanitized.
Using the shortcut for environment variables in the PEB: !envvar COMPUTERNAME