1

使用DumpIt从

 2 years ago
source link: https://ssooking.github.io/2020/12/%E4%BD%BF%E7%94%A8dumpit%E4%BB%8Eram%E8%BD%AC%E5%82%A8%E4%B8%AD%E6%8F%90%E5%8F%96hash/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

DumpIt

DumpIt是一个故障转储工具,该工具是免费的Comae Memory Toolkit的一部分(此工具的早期版本由MoonSols发行,已不再可用)。DumpIt可以获取主机物理内存的快照,并支持使用相关内存取证分析工具如Volatility FrameworkRekallRedline 等进行分析。

该工具不适用红队渗透过程,因为产生的转储文件非常巨大,该方法通常用于恶意软件分析。

DumpIt下载地址:

使用DumpIt

用户密码以散列格式存储在%SystemRoot%/system32/config/SAM文件中,我们用DumpIt转储内存快照,然后使用Volatility分析SAM文件,从中找到hash。

Volatility安装脚本。从2.4开始,Volatility具有适用于Windows、Linux 和OSX的二进制包,下载链接

使用Volatility进行分析,需要先根据转储文件的操作系统加载对应的配置文件进行处理。查看转储文件信息,从”Suggested Profile”中选择对应的系统:

$ python vol.py imageinfo -f TEST7-PC-20200117-042206.raw
Volatility Foundation Volatility Framework 2.6.1
INFO    : volatility.debug    : Determining profile based on KDBG search...
          Suggested Profile(s) : Win7SP1x64, Win7SP0x64, Win2008R2SP0x64, Win2008R2SP1x64_24000, Win2008R2SP1x64_23418, Win2008R2SP1x64, Win7SP1x64_24000, Win7SP1x64_2341
                     AS Layer1 : WindowsAMD64PagedMemory (Kernel AS)
                     AS Layer2 : FileAddressSpace (/Users/ssooking/Downloads/VMShare/TEST7-PC-20200117-042206.raw)
                      PAE type : No PAE
                           DTB : 0x187000L
                          KDBG : 0xf8000402b120L
          Number of Processors : 2
     Image Type (Service Pack) : 1
                KPCR for CPU 0 : 0xfffff8000402d000L
                KPCR for CPU 1 : 0xfffff88004500000L
             KUSER_SHARED_DATA : 0xfffff78000000000L
           Image date and time : 2020-01-17 04:22:17 UTC+0000
     Image local date and time : 2020-01-17 12:22:17 +0800

接下来使用hivelist参数在内存中定位注册表配置单元的虚拟地址,以及磁盘上相应配置单元的完整路径:

$ python vol.py --profile=Win7SP1x64 -f TEST7-PC-20200117-042206.raw hivelist
Volatility Foundation Volatility Framework 2.6.1
Virtual            Physical           Name
------------------ ------------------ ----
0xfffff8a0017f1010 0x000000005a79d010 \??\C:\System Volume Information\Syscache.hve
0xfffff8a00525a010 0x0000000024c6b010 \SystemRoot\System32\Config\DEFAULT
0xfffff8a006b50010 0x000000001f2aa010 \SystemRoot\System32\Config\SECURITY
0xfffff8a00000d010 0x000000002c571010 \REGISTRY\MACHINE\SYSTEM
0xfffff8a00000f010 0x000000002c1d6010 [no name]
0xfffff8a00006a010 0x000000002c027010 \REGISTRY\MACHINE\HARDWARE
0xfffff8a0009bc010 0x0000000029aaa010 \Device\HarddiskVolume1\Boot\BCD
0xfffff8a0009e0010 0x0000000029cd7010 \SystemRoot\System32\Config\SOFTWARE
0xfffff8a000c10010 0x0000000020c18010 \SystemRoot\System32\Config\SAM
0xfffff8a000da8010 0x000000001cc88010 \??\C:\Windows\ServiceProfiles\NetworkService\NTUSER.DAT
0xfffff8a000e35010 0x00000000541fe010 \??\C:\Windows\ServiceProfiles\LocalService\NTUSER.DAT
0xfffff8a0013b7010 0x00000000094b8010 \??\C:\Users\Administrator\ntuser.dat
0xfffff8a001433410 0x0000000068714410 \??\C:\Users\Administrator\AppData\Local\Microsoft\Windows\UsrClass.dat

百度百科:

注册表相当于Windows系统中所有32位硬件/驱动和32位应用程序的数据文件,是一个系统信息的数据库。注册表文件在系统设置和缺省用户配置数据的情况下,存放在\系统文件夹\SYSTEM32\CONFIG目录下的6个文件,DEFAULT、SAM、SECURITY、SOFTWARE、USERDIFF和SYSTEM中;

用户的配置信息存放在系统所在磁盘的\Documents and Setting\目录,包括ntuser.dat,ntuser.ini和ntuser.dat.log。

其中每个文件的路径都由注册表项HKLM\SYSTEM\CurrentControlSet\Control\Hivelist下的键值指出,通过读取hivelist键值内容可找到SAM密码哈希文件路径。

找到SYSTEMSAM的虚拟内存地址为:

0xfffff8a00000d010 0x000000002c571010 \REGISTRY\MACHINE\SYSTEM
0xfffff8a000c10010 0x0000000020c18010 \SystemRoot\System32\Config\SAM

从内存中获取hash:

-y:SYSTEM的虚拟地址

-s:SAM配置单元的虚拟地址

$ python vol.py --profile=Win7SP1x64 -f TEST7-PC-20200117-042206.raw hashdump -y 0xfffff8a00000d010 -s 0xfffff8a000c10010
Volatility Foundation Volatility Framework 2.6.1
Administrator:500:aad3b435b51404eeaad3b435b51404ee:afc44ee7351d61d00698796da06b1ebf:::
Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
Test7:1000:aad3b435b51404eeaad3b435b51404ee:afc44ee7351d61d00698796da06b1ebf:::

获取到了LM:NTML hash格式的数据,解密NTML hash。下面可以尝试使用john或hashcat工具解密hash。

在线解密平台Free Password Hash Cracker

afc44ee7351d61d00698796da06b1ebf	NTLM	toor

虚拟机转储分析

vmss2core是创建虚拟机的核心转储工具,如果该虚拟机已挂起 (.vmss) 或快照 (.vmsn) 检查点状态文件,可以使用Volatility工具解析这些文件以提取哈希转储。

vmsnparser工具也是一个分析虚拟机转储的工具。详情参考VMware Snapshot and Saved State Analysis

Reference


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK