OtterCTF 2018 Forensics

OtterCTF 2018 Forensics

题单来自NSSCTF

  • [OtterCTF 2018]What the password?
  • [OtterCTF 2018]General Info
  • [OtterCTF 2018]Play Time
  • [OtterCTF 2018]Name Game
  • [OtterCTF 2018]Name Game 2
  • [OtterCTF 2018]Silly Rick
  • [OtterCTF 2018]Hide And Seek
  • [OtterCTF 2018]Path To Glory
  • [OtterCTF 2018]Path To Glory 2
  • [OtterCTF 2018]Bit 4 Bit
  • [OtterCTF 2018]Graphic’s For The Weak
  • [OtterCTF 2018]Recovery
  • [OtterCTF 2018]Closure

[1].What the password?

you got a sample of rick's PC's memory. can you get his user password?

获取内存镜像信息

python2 vol.py -f /root/桌面/OtterCTF.vmem imageinfo

得到版本:Win7SP1x64

python2 vol.py -f /root/桌面/OtterCTF.vmem --profile=Win7SP1x64 lsadump

得到 password:MortyIsReallyAnOtter

[2].General Info

Let's start easy - whats the PC's name and IP address?

查看注册表信息

python2 vol.py -f /root/桌面/OtterCTF.vmem --profile=Win7SP1x64 hivelist

主机名会出储存在\REGISTRY\MACHINE\SYSTEM中的ControlSet001\Control\ComputerName\ComputerName条目中,直接读取

python2 vol.py -f /root/桌面/OtterCTF.vmem --profile=Win7SP1x64 printkey -o 0xfffff8a000024010 -K 'ControlSet001\Control\ComputerName\ComputerName'

PC's name:WIN-LO6FAF3DTFE

查看IP

python2 vol.py -f /root/桌面/OtterCTF.vmem --profile=Win7SP1x64 netscan

IP address:192.168.202.131

答案:WIN-LO6FAF3DTFE-192.168.202.131

[3].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?

查看进程列表信息

python2 vol.py -f /root/桌面/OtterCTF.vmem --profile=Win7SP1x64 pstree

可疑的进程 LunarMS.exe,google一下得知是一款古老的电子游戏

查看IP

python2 vol.py -f /root/桌面/OtterCTF.vmem --profile=Win7SP1x64 netscan | grep 'LunarMS.exe'

IP:77.102.199.102

答案:LunarMS-77.102.199.102

[4].Name Game

We know that the account was logged in to a channel called Lunar-3. what is the account name?

提取出包含LunarMS的进程

python2 vol.py -f /root/桌面/OtterCTF.vmem --profile=Win7SP1x64 memdump -p 708 -D /root/桌面

查看dmp中的字符串

strings /root/桌面/708.dmp | grep -C 5 'Lunar-3'

grep -C 5 匹配行和它前后各5行

account name:0tt3r8r33z3

[5].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?

查看dmp文件的hexdump信息

xxd /root/桌面/708.dmp | grep '5a0c 0000'

xxd 将一个给定文件或标准输入转换为十六进制形式

答案:M0rtyL0L

[6].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?

查看剪切板

python2 vol.py -f /root/桌面/OtterCTF.vmem --profile=Win7SP1x64 clipboard

答案:M@il_Pr0vid0rs

[7].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)

pstree 列出所有进程的父子关系

python2 vol.py -f /root/桌面/OtterCTF.vmem --profile=Win7SP1x64 pstree

cmdline 追踪程序的调用指令,获取两个异常进程关联的完整命令行

google一下,得知这是一个卸载后会重新安装自己的小玩意,Rick And Morty season 1 download.exe 也预示着此进程为我们要找的恶意进程

答案:vmware-tray.exe

[8].Path To Glory

How did the malware got to rick's PC? It must be one of rick old illegal habits...

既然恶意进程的父进程为 Rick And Morty,那么扫描一下文件列表

python2 vol.py -f /root/桌面/OtterCTF.vmem --profile=Win7SP1x64 filescan | grep -i 'Rick And Morty'

发现\Downloads下的种子文件,将种子文件提取出来,重命名为bad.dat

python2 vol.py -f /root/桌面/OtterCTF.vmem --profile=Win7SP1x64 dumpfiles -Q 0x000000007d8813c0 -D /root/桌面

查看文件的内容

我们看到它是区域标识符而不是 torrent 本身。ZoneId=3这一行表示该 torrent 是从互联网上下载的

尝试下一个

python2 vol.py -f /root/桌面/OtterCTF.vmem --profile=Win7SP1x64 dumpfiles -Q 0x000000007dae9350 -D /root/桌面

重命名为bad2.dat,这次提取正确

BitTorrent file:BT下载类型的种子文件

答案:M3an_T0rren7_4_R!ck

[9].Path To Glory 2

Continue the search after the way that malware got in.

已知该种子是从互联网上下载下来的,memdump 所有包含chrome.exe的进程

python2 vol.py -f /root/桌面/OtterCTF.vmem --profile=Win7SP1x64 memdump -n chrome.exe -D /root/桌面/chrome

/chrome查看所有包含'Rick And Morty' 的前后10行

strings *.dmp | grep -i 'Rick And Morty' -C 10

19

答案:Hum@n_I5_Th3_Weak3s7_Link_In_Th3_Ch@in

以上方法过于肉眼......在这篇文章中有更逻辑性的解法,及以下演示的解法

更优解:

已知该种子是从互联网上下载下来的,用 filescan 和 dumpfiles 查看和提取 Chrome 历史数据库

python2 vol.py -f /root/桌面/OtterCTF.vmem --profile=Win7SP1x64 filescan | grep -ie 'history$'

grep -ie 'history$' :搜索文件中结尾为history的所有行,并忽略大小写

python2 vol.py -f /root/桌面/OtterCTF.vmem --profile=Win7SP1x64 dumpfiles -Q 0x000000007d45dcc0 -D /root/桌面

Chrome 将历史数据存储在 SQLite 数据库中。

用file 查看提取文件可知是 SQLite 3.x database, last written using SQLite version 3023001

将文件重命名为 chrome-history.sqlite,并使用 sqlite3 实用程序运行以下查询

这个主题好看多了 (〃'▽'〃)

sqlite3 /root/桌面/chrome-histroy.sqlite
select current_path, site_url from downloads;

得知是从 https://mail.com 下载的文件,用 strings 查找与 mail.com 相关的信息

strings /root/桌面/OtterCTF.vmem.strings | grep '@mail.com' 

strings /root/桌面/OtterCTF.vmem.strings | grep -A 20 'rickopicko@mail.com' 

grep -A 20 :显示rickopicko@mail.com及后20行

得到答案:Hum@n_I5_Th3_Weak3s7_Link_In_Th3_Ch@in

[10].Bit 4 Bit

We've found out that the malware is a ransomware. Find the attacker's bitcoin address.

什么是比特币地址?

比特币地址是一个标识符(帐号),包含27-34个字母数字拉丁字符(0,O,I除外)。地址可以以QR码形式表示,是匿名的,不包含关于所有者的信息。

地址示例:14qViLJfdGaP4EeHnDyJbEGQysnCpwn1gd

勒索文件一般会在桌面上放置勒索字条,所以让我们先寻找它

python2 vol.py -f /root/桌面/OtterCTF.vmem --profile=Win7SP1x64 filescan | grep -i 'desktop'

把 READ_IT.txt dump 下来

file 查看得知是 read_it.dat: ASCII text, with CRLF line terminators,导入010editor

只是注释...

回头去把之前的恶意进程vmware-tray.exe提取出来

 python2 vol.py -f /root/桌面/OtterCTF.vmem --profile=Win7SP1x64 memdump -p 3720 -D /root/桌面 

strings -el 3720.dmp | grep -i -A 5 'ransom'

-el 标志用于搜索U nicode字符串

答案:1MmpEmebJkqXG8nQv4cjJSmxZQFVmFo63M

(搜索 'ransom' 确实需要一些脑洞,但搜索'pay'也可以得到)

[11].Graphic’s For The Weak

There's something fishy in the malware's graphics.

procdump转储进程可执行文件,然后使用binwalk从可执行文件中识别图形

python2 vol.py -f /root/桌面/OtterCTF.vmem --profile=Win7SP1x64 procdump -p 3720 -D /root/桌面

foremost executable.3720.exe 

/output/png内得到

答案:CTF{S0_Just_M0v3_Socy}

[12].Recovery

Rick got to have his files recovered! What is the random password used to encrypt the files?

用grep搜索关键词,多次尝试

 strings -el  ../../3720.dmp | grep 'password' | wc -l
 strings -el  ../../3720.dmp | grep 'password'

wc -l :统计行数

没有所需的

strings -el  ../../3720.dmp | grep -i 'rick' | wc -l

数据过多

strings -el  ../../3720.dmp | grep -i 'WIN-LO6FAF3DTFE' | wc -l
strings -el  ../../3720.dmp | grep 'WIN-LO6FAF3DTFE' | sort | uniq 

sort:排序

uniq:去重

主机名和用户名与看似随机的字母数字字符串连接在一起,应该就是答案

得到答案:aDOBofVYUNVnmp7

[13].Closure

Now that you extracted the password from the memory, could you decrypt rick's files?

最后的挑战是使用问题 12 中的密码来解密 Rick 的文件。我们需要弄清楚的第一件事是我们正在处理的勒索软件类型。我们能够从问题 11 中的内存映像中提取可执行文件,并且可能有人已经将其上传到像 VirusTotal 这样的在线沙箱。让我们获取SHA1哈希并进行检查。

sha1sum executable.3720.exe

sha1sum命令用于计算文件或者字符串的SHA-1校验值

得到 8a728dc1efaba298159fe56d8098061d644b2396 ,在virustotal上查询

果然,在 VirusTotal 上有一个命中,引用了一个替代的可执行文件名称 (VapeHacksLoader.exe),它与我们在题目[11] 中提取的图形中引用的 $ucyLocker 勒索软件相关联。$ucyLocker 是开源 Hidden Tear 的变体 勒索软件

先dump文件

python2 vol.py -f OtterCTF.vmem --profile=Win7SP1x64 filescan | grep 'Flag.txt'
python2 vol.py -f ../../OtterCTF.vmem --profile=Win7SP1x64 dumpfiles -Q 0x000000007e410890 -D /root/桌面

用010editor 移除文件后面的 00 字节,修改文件的后缀为 .locked

用 hidden-tear-decrypt工具选择文件夹,填入密码 aDOBofVYUNVnmp7 ,点击Decrypt 解密

得到答案:CTF{Im_Th@_B3S7_RicK_0f_Th3m_4ll}

posted @   Mar10  阅读(234)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通
点击右上角即可分享
微信分享提示