如何使用 regedit 从 SAM 文件中获取密码哈希

How to get password hash from SAM file using regedit

一段时间以来,我一直在尝试从 SAM 文件中获取密码哈希值。我不想下载一个可以为我获取它的程序;首先,因为我想自己做,其次,因为我下载的都是恶意软件。

很快我意识到我无法在登录我的帐户(管理员)时访问注册表上的 SAM,所以我决定用 "cmd.exe" 的副本交换 "utilman.exe"因此,当我注销我的帐户时,我可以作为 'system' 访问 SAM。

我已经成功地将整个 SAM 以“.reg”文件和“.txt”文件的形式导出到我的桌面。问题是......我不知道从哪里开始寻找密码哈希。有趣的是,当打开“.txt”版本时,我意识到它与将“.reg”版本更改为“.txt”文件时不同。此处显示了一个示例:

00000000 07 00 01 00 00 00 00 00 - 98 00 00 00 02 00 01 00 .................. 默认文本版本

[HKEY_LOCAL_MACHINE\SAM\SAM] "C"=hex:07,00,01,00,00,00,00,00,98,00,00,00,02,00,01,00,01,00,14,80,78, 00,00,\ reg 文件已更改为 txt

如有任何帮助,我们将不胜感激。至于意图,我只是想尝试 windows。 :)...

这帮了我很多忙。在这里,您可以看到 LM (Lan Manager) 密码哈希和 NT 哈希。我在我的注册表中找到了这些并准确地找到了。

编辑

如何从第一个块中找到第二个块中的值的位置(对于自动化程序)。因为,第一个盒子看起来总是那样(例如,工作站位于 0078),但第二个盒子将具有不同的值并位于不同的位置,因此它的工作方式如下:

Select first 4 bytes eg: 90 01 00 00

Reverse them eg: 00 00 01 90 NOTE: I did not change around the values, just the byte order so 90 is still 90 and not 09)

Decimal convert 00000190 to hex to get BE

Hex convert BE to get 190

Hex convert (again) 190 to get 400 ( which is now our decimal value)

Add CC (Decimal of CC is 204) in decimal form which is 204 and 400 to make 604 (NOTE: CC has to be added to every equation you do otherwise it wont work)

Hex to decimal 604 to get 25C. Then if you look at the second block it 0258, 0259, 025A, 025B, 025C. Then 025C (25C) is your value.