磁盘/内存取证 学习

OneZ3r0 Lv4

磁盘取证

CISCN半决赛

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
sudo mkdir -p /mnt/er/img

# 挂载方式1
fdisk -l cha.raw

# 2048*512=1048576
sudo mount -o ro,loop,offset=1048576 cha.raw /mnt/er/img
"""
mount: /mnt/er/img: 无法以只读方式挂载 /dev/loop0p1.
dmesg(1) may have more information after failed mount system call.
"""

# 挂载方式2
# 扫描
sudo losetup -Pf --show -r cha.raw
# 查看分区
lsblk -f /dev/loop0

# 以只读方式挂载
sudo mount -o ro /dev/loop0p1 /mnt/er/img
"""
mount: /mnt/er/img: 无法以只读方式挂载 /dev/loop0p1.
dmesg(1) may have more information after failed mount system call.
"""

# ext4只读但不加载日志
sudo mount -t ext4 -o ro,noload /dev/loop0p1 /mnt/er/img


sudo umount /mnt/er/img

sudo losetup -d /dev/loop0

lsblk /dev/loop0 2>/dev/null; or echo "loop0 released"



# 查看被删除文件
fls -rdp /dev/loop0p1
sudo debugfs -R "lsdel" /dev/loop0p1

屈服了,还是R-Studio好用

内存取证

[!Note]
Volatility 官方在 2025-05-16 宣布 Volatility 3 已达到对 Volatility 2 的“官方功能对等(parity)”,并明确说明 Volatility 2 已弃用(deprecated),其 GitHub 仓库也已归档。官方同时表示 Volatility 3 会继续长期活跃维护

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# volatility3 使用

# vol3 支持自动识别内存镜像
vol -f Challenge.raw windows.info/linux.info

# 查看进程
vol -f xxx.raw windows.pslist
vol -f xxx.raw windows.psscan
vol -f xxx.raw windows.pstree

# 查看指定pid的进程
vol -f xxx.raw windows.pslist --pid 1076

# 进程转储
vol.exe -o ./outputdir/ -f xxx.raw windows.pslist --pid 1234 --dump

# 内存转储
vol.exe -o ./outputdir/ -f xxx.raw windows.memmap --pid 1234 --dump

# 查看句柄
vol.exe -f xxx.raw windows.handles
vol.exe -f xxx.raw windows.handles --pid 1234

# 查看dll
vol.exe -f xxx.raw windows.dlllist
vol.exe -f xxx.raw windows.dlllist --pid 1234

# dll转储
vol.exe -o ./outputdir/ -f xxx.raw windows.dlllist --pid 1234 --dump

# 查看命令行
vol.exe -f xxx.raw windows.cmdline
vol.exe -f xxx.raw windows.cmdline --pid 1234

# 查看网络端口
vol.exe -f xxx.raw windows.netscan
vol.exe -f xxx.raw windows.netscan --include-corrupt # 完整结果,可能有错误信息

# 查看注册表信息
vol.exe -f xxx.raw windows.registry.hivescan
vol.exe -f xxx.raw windows.registry.hivelist


# 导出注册表文件
vol -f Challenge.raw -o ./tmp windows.registry.hivelist --filter "TroubleMaker\ntuser.dat" --dump
# --offset 也可以导出
# ntuser.dat可以查看用户的活动历史,尤其是操作文件的痕迹


# 查看注册表键值对
vol.exe -f xxx.raw windows.registry.printkey

# 使用offet查看特定文件夹下的注册表信息
vol.exe -f xxx.raw windows.registry.printkey --offset OFFSET

# 特定键值
vol.exe -f xxx.raw windows.registry.printkey --key KEY


# 查找文件
# powershell Select-String 相当于 grep
vol.exe -f xxx.raw windows.filescan | Select-String "flag"

# 文件转储
vol.exe -o ./outputdir/ -f xxx.raw windows.dumpfiles --pid 1234 # pid方式

# 推荐使用filescan找到的offset 一般使用physaddr
vol.exe -o ./outputdir/ -f xxx.raw windows.dumpfiles --virtaddr 0xee1122
vol.exe -o ./outputdir/ -f xxx.raw windows.dumpfiles --physaddr 0xee1122


# 查找恶意注入代码
vol.exe -f xxx.raw windows.malfind
vol.exe -f xxx.raw windows.malfind --pid 1234

# 恶意代码转储
vol.exe -o ./outputdir/ -f xxx.raw windows.malfind --pid 1234 --dump

[!Note]
有时候暴力搜字符是可能有用的

1
2
windows.strings.Strings
Reads output from the strings command and indicates which process(es) each string belongs to.

有时候还是vol2好用,比如clipboard这些vol3还没实现

1
python2 vol.py -f ~/Downloads/Challenge.raw --profile=Win7SP1x64 clipboard

然后cmdscan也是,vol3不支持一些老旧的题目

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# 读cmd历史
python2 vol.py -f ~/Downloads/Challenge.raw --profile=Win7SP1x64 cmdscan


# 读ie浏览器历史
python2 vol.py -f ~/Downloads/Challenge.raw --profile=Win7SP1x64 iehistory

# 导出文件
python2 vol.py -f Challenge.raw --profile=Win7SP1x64 procdump -p 2728 -D ./
# p:pid进程号
# D:提取程序后保存的地址,./指的是当前shell正在运行的文件夹地址,输入pwd命令可以查看shell当前的地址,简单来说就是保存到当前文件夹


# 导出内存文件
python2 vol.py -f Challenge.raw --profile=Win7SP1x64 dumpfiles -Q 0x000000011fd0ca70 -D ./
# Q:内存位置
# D:提取程序后保存的地址,./指的是当前shell正在运行的文件夹地址,输入pwd命令可以查看shell当前的地址,简单来说就是保存到当前文件夹


# mimikatz 提取密码
python2 vol.py -f Challenge.raw --profile=Win7SP1x64 mimikatz

下载ftk imager

https://go.exterro.com/l/43312/2022-08-23/f7rytx

  • 标题: 磁盘/内存取证 学习
  • 作者: OneZ3r0
  • 创建于 : 2026-03-02 14:06:26
  • 更新于 : 2026-05-05 18:31:44
  • 链接: https://blog.onez3r0.top/2026/03/02/memory-and-disk-forensics/
  • 版权声明: 本文章采用 CC BY-NC-SA 4.0 进行许可。
目录
磁盘/内存取证 学习