2018_Otterctf

What the password?

取电脑的密码

先看缓存在内存中的注册表的偏移量

1
volatility_2.6_win64_standalone -f 1.vmem --profile=Win7SP1x64 hivelist

image-20230110204319040

关注到SAM(账户密码表)和system

1
volatility_2.6_win64_standalone -f 1.vmem --profile=Win7SP1x64 hashdump -y 0xfffff8a000024010 -s 0xfffff8a0016d4010

image-20230110205008754

解不开md5…

image-20230110205129938

1
volatility_2.6_win64_standalone -f 1.vmem --profile=Win7SP1x64 lsadump

image-20230110205735792

算了算了passware一把梭

image-20230111115450555

General Info

win版的好像没办法装插件,用插件会更简单

1
volatility_2.6_win64_standalone -f 1.vmem --profile=Win7SP1x64 netscan

image-20230110211935091

1
volatility_2.6_win64_standalone -f 1.vmem --profile="Win7SP1x64" printkey -o 0xfffff8a000024010 -K "ControlSet001\Control\ComputerName\ComputerName"

image-20230110212109665

法二:

主机网络地址:

1
python vol.py -f OtterCTF.vmem --profile=Win7SP1x64 netscan

img

img

电脑名:

1
python vol.py  --plugins=./volatility/plugins/ -f OtterCTF.vmem --profile=Win7SP1x64  mimikatz

img

Play Time

进程运行过会在内存中留下痕迹,查一下内存中的进程

1
volatility_2.6_win64_standalone -f 1.vmem --profile=Win7SP1x64 psscan

image-20230110212710545

image-20230110212740879

再查网络

image-20230110213021513

直接看还是有点费劲,要是有grep就好了qwq

Name Game

将游戏进程dump下来

strings提取并搜索关键字Lunar-3,下一行是用户名(不懂,猜测是虚拟内存中挨得近?

image-20230110220334466

Name Game 2

0x64 0x??{6-8} 0x40 0x06 0x??{18} 0x5a 0x0c 0x00{2}

直接爆搜吧

image-20230110221332856

Silly Rick

看粘贴板中的数据

1
volatility_2.6_win64_standalone -f 1.vmem --profile=Win7SP1x64 clipboard

image-20230110215111382

Hide And Seek

根据题目描述和进程解析以及这里,勒索软件可能伪装成vmware-tray.exe

pstree查看进程树(看看vmware-tray.exe的父子进程

image-20230110222342899

虚拟机里的进程不应该由一个动画片产生,这应该是伪装进程

image-20230110222703615

dll存放于临时目录,正常系统文件不应该在这儿吧

Path To Glory

扫一下父进程文件

1
volatility_2.6_win64_standalone -f 1.vmem --profile=Win7SP1x64 filescan | findstr="Rick And Morty"

首先了解BT种子:

一种电脑“.torrent”文件,装有BT(BitTorrent)下载必须的文件信息,作用相当于HTTP下载里的URL链接。

image-20230110223939226

提取种子文件strings即可

Path To Glory 2

导出所有chrome进程

1
volatility_2.6_win64_standalone.exe -f 1.vmem --profile=Win7SP1x64 memdump -n chrome.exe -D ./chrome/

image-20230110230506018

image-20230110231506046

这种方式按理说肯定会有结果的,但奈何虚拟机没空间了,写不全

image-20230110232006992

image-20230110231857831

image-20230110232019271

直接看download.exe.torrent前后的十个文件吧

Bit 4 Bit

这题还是说恶意软件的,直接以可执行文件格式保存

1
volatility_2.6_win64_standalone -f 1.vmem --profile=Win7SP1x64 procdump -p 3720 -D ./

image-20230110233232962

然而win版打了命令也没找到可执行文件(?

还是用linux吧

image-20230111001628843

后来明白为什么win版的会没有可执行文件了,因为这玩意被系统杀了(win11专业版真的一言难尽

查完壳逆一下

image-20230111111123260

image-20230111110045821

Graphic’s For The Weak

1
volatility_2.6_win64_standalone.exe -f 1.vmem --profile=Win7SP1x64 memdump -p 3720 -D ./

分离进程中的文件

image-20230110203725711

image-20230110203737493

Recovery

image-20230111111709522

看到这里发送密码信息的格式,去爆搜即可

这里有一点,程序的数据是16字节小端序数据,可以过滤(.NET程序用2个字节表示一个字符串)

1
strings -el 3720.dmp | grep 'WIN-LO6FAF3DTFE-Rick' -C 5

image-20230111121225941

strings用法:

1
2
3
4
5
6
7
8
9
-a --all:扫描整个文件而不是只扫描目标文件初始化和装载段
-f –print-file-name:在显示字符串前先显示文件名
-n –bytes=[number]:找到并且输出所有NUL终止符序列
- :设置显示的最少的字符数,默认是4个字符
-t --radix={o,d,x} :输出字符的位置,基于八进制,十进制或者十六进制
-o :类似--radix=o
-T --target= :指定二进制文件格式
-e --encoding={s,S,b,l,B,L} :选择字符大小和排列顺序:s = 7-bit, S = 8-bit, {b,l} = 16-bit, {B,L} = 32-bit
@ :读取中选项

Closure

解密

image-20230111121814099

grep用法:

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
-a 或 --text : 不要忽略二进制的数据。
-A<显示行数> 或 --after-context=<显示行数> : 除了显示符合范本样式的那一列之外,并显示该行之后的内容。
-b 或 --byte-offset : 在显示符合样式的那一行之前,标示出该行第一个字符的编号。
-B<显示行数> 或 --before-context=<显示行数> : 除了显示符合样式的那一行之外,并显示该行之前的内容。
-c 或 --count : 计算符合样式的列数。
-C<显示行数> 或 --context=<显示行数>或-<显示行数> : 除了显示符合样式的那一行之外,并显示该行之前后的内容。
-d <动作> 或 --directories=<动作> : 当指定要查找的是目录而非文件时,必须使用这项参数,否则grep指令将回报信息并停止动作。
-e<范本样式> 或 --regexp=<范本样式> : 指定字符串做为查找文件内容的样式。
-E 或 --extended-regexp : 将样式为延伸的正则表达式来使用。
-f<规则文件> 或 --file=<规则文件> : 指定规则文件,其内容含有一个或多个规则样式,让grep查找符合规则条件的文件内容,格式为每行一个规则样式。
-F 或 --fixed-regexp : 将样式视为固定字符串的列表。
-G 或 --basic-regexp : 将样式视为普通的表示法来使用。
-h 或 --no-filename : 在显示符合样式的那一行之前,不标示该行所属的文件名称。
-H 或 --with-filename : 在显示符合样式的那一行之前,表示该行所属的文件名称。
-i 或 --ignore-case : 忽略字符大小写的差别。
-l 或 --file-with-matches : 列出文件内容符合指定的样式的文件名称。
-L 或 --files-without-match : 列出文件内容不符合指定的样式的文件名称。
-n 或 --line-number : 在显示符合样式的那一行之前,标示出该行的列数编号。
-o 或 --only-matching : 只显示匹配PATTERN 部分。
-q 或 --quiet或--silent : 不显示任何信息。
-r 或 --recursive : 此参数的效果和指定"-d recurse"参数相同。
-s 或 --no-messages : 不显示错误信息。
-v 或 --invert-match : 显示不包含匹配文本的所有行。
-V 或 --version : 显示版本信息。
-w 或 --word-regexp : 只显示全字符合的列。
-x --line-regexp : 只显示全列符合的列。
-y : 此参数的效果和指定"-i"参数相同。

这里桌面上还有个文件

image-20230111122100939

都提取

1
volatility -f 1.vmem --profile=Win7SP1x64 dumpfiles -Q 0x000000007e410890 -D ./

image-20230111122241218

另一个文件属于提示

image-20230111122341497

之前的图片中有这样一个字符串

image-20230111122433271

可以看看这篇文章

image-20230111122638933

逆向的过程中也看到了hidden_tear

image-20230111122902847

搜索可知这是有联系的

image-20230111123126591

用hidden_tear解密软件解密

解密变种的软件看了wp(没搜到,我是fw

加密代码是采用CBC模式进行加密,会对文件进行填充,还要把多余的00删掉再解

image-20230111203437261