最近,斗哥在刷CTF题目。突然刷到了内存取证类,了解到了一款牛逼的工具——Volatility,在kali linux也默认安装好了这个工具,正好可以好好学习一波。
Volatility 简介:
Volatility是一款开源的,基于Python开发的内存取证工具集,可以分析内存中的各种数据。Volatility支持对32位或64位Wnidows、Linux、Mac、Android操作系统的RAM数据进行提取与分析。

题目来源:
还记得取证那题吗?既然有了取证神器,这里有一个可疑文件以及存储该文件电脑的一个内存快照,那么接下来我们实战一下吧。
由于文件比较大,请大家至百度云盘下载:
链接: http://pan.baidu.com/s/1c2BIGLE
密码: 9v2z
打开是2个文件:

volatility 使用:
volatility -f <文件名> --profile=<配置文件> <插件> [插件参数]
获取--profile的参数 。
使用imageinfo插件来猜测dump文件的profile值:WinXPSP2x86
root@kali:~/quzhen# volatility -f mem.vmem imageinfo

root@kali:~/quzhen# volatility -f mem.vmem --profile=WinXPSP2x86

shell的命令:
dt("内核关键数据结构名称")
如:
dt("_PEB")

列举进程:
root@kali:~/quzhen# volatility -f mem.vmem --profile=WinXPSP2x86 pslist

列举缓存在内存的注册表 :
olatility -f mem.vmem --profile=WinXPSP2x86 hivelist

hivedump 打印出注册表中的数据 :
volatility -f mem.vmem --profile=WinXPSP2x86 hivedump -o 注册表的 virtual 地址

获取SAM表中的用户:
volatility -f mem.vmem --profile=WinXPSP2x86 printkey -K "SAM\Domains\Account\Users\Names"
可以看到有4个用户。

获取最后登录系统的账户 :
volatility -f mem.vmem --profile=WinXPSP2x86 printkey -K "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon"
提取出内存中记录的 当时正在运行的程序有哪些,运行过多少次,最后一次运行的时间等信息 。
volatility -f mem.vmem --profile=WinXPSP2x86 userassist

将内存中的某个进程数据以 dmp 的格式保存出来 。
volatility -f mem.vmem --profile=WinXPSP2x86 -p [PID] -D [dump 出的文件保存的目录]

二进制编辑器 hexeditor 将以上保存的 dmp 文件打开,并进行调查取证的工作。
hexeditor 1736.dmp

你还可以使用 strings 这个工具将它的字符串打印出来。
例:
strings 1736.dmp > 1736.txt
strings 1608.dmp > 1736.txt | grep shellcode
提取内存中保留的 cmd 命令使用情况
volatility -f mem.vmem --profile=WinXPSP2x86 cmdscan

获取到当时的网络连接情况。
volatility -f mem.vmem --profile=WinXPSP2x86 netscan

获取 IE 浏览器的使用情况 :
volatility -f mem.vmem --profile=WinXPSP2x86 iehistory
获取内存中的系统密码,我们可以使用 hashdump 将它提取出来。
volatility -f mem.vmem --profile=WinXPSP2x86 hashdump -y (注册表 system 的 virtual 地址 )-s (SAM 的 virtual 地址)

volatility -f mem.vmem --profile=WinXPSP2x86 hashdump -y 0xe1035b60 -s 0xe16aab60
最大程度上将内存中的信息提取出来,那么你可以使用 timeliner 这个插件。它会从多个位置来收集系统的活动信息 。
volatility -f mem.vmem --profile=WinXPSP2x86 timeliner
解题步骤:
首先解压获得的两个文件,一个是内存文件,另一个是加密文件。

打开kali,使用volatility 查看进程,可以发现一个TrueCrypy.exe的进程。
root@kali:~/quzhen# volatility -f mem.vmem --profile=WinXPSP2x86 pslist

TrueCrypy.exe是一款加密程序,而我们可以推出,suspicion为加密的结果。
我们需要从内存dump出key来。
volatility -f mem.vmem --profile=WinXPSP2x86 memdump -p 1464 -D ctf/

dump出来的文件为1464.dmp
Elcomsoft Forensic Disk Decryptor 的使用
我们需要借助Elcomsoft Forensic Disk Decryptor(Elcomsoft硬盘取证解密器,简称为EFDD)软件来获取key和破解文件 。










网友评论