waniCTFでやったメモリフォレンジックが楽しかったので、調べたらmemlabsというものがあったので、やってみる。
開閉
MemLabs Lab 0 - Never Too Late Mister
My friend John is an "environmental" activist and a humanitarian. He hated the ideology of Thanos from the Avengers: Infinity War. He sucks at programming. He used too many variables while writing any program. One day, John gave me a memory dump and asked me to find out what he was doing while he took the dump. Can you figure it out for me?
ということで、友人が行っていたことをメモリダンプから発見するというもののようだ。
まずは渡されたファイルが何なのか、友人はどんな環境を使っているのかなどの情報を知りたい。
└─# file Challenge.raw Challenge.raw: data
fileコマンドではあんまり有益な情報はない。
└─# python3 vol.py -f ../Challenge.raw windows.info.Info Volatility 3 Framework 2.7.1 Progress: 100.00 PDB scanning finished Variable Value Kernel Base 0x82604000 DTB 0x185000 Symbols file:///home/yukichi/mount/memlabs/volatility3%28memory%29/volatility3/symbols/windows/ntkrpamp.pdb/EDD3760CEE2B45D2A63BF8C26EE11FAF-2.json.xz Is64Bit False IsPAE True layer_name 0 WindowsIntelPAE memory_layer 1 FileLayer KdDebuggerDataBlock 0x8273cb78 NTBuildLab 7601.24260.x86fre.win7sp1_ldr.18 CSDVersion 1 KdVersionBlock 0x8273cb50 Major/Minor 15.7601 MachineType 332 KeNumberProcessors 1 SystemTime 2018-10-23 08:30:51 NtSystemRoot C:\Windows NtProductType NtProductWinNt NtMajorVersion 6 NtMinorVersion 1 PE MajorOperatingSystemVersion 6 PE MinorOperatingSystemVersion 1 PE Machine 332 PE TimeDateStamp Sun Sep 9 00:14:23 2018
つまり、ウィンドウズなのかな?volatility2ではimageinfoのようなものがあったが、3にはないので、よくわからい感じはある。次は何を行っていたか、pslistを見たいと思う。
└─# python3 vol.py -f ../Challenge.raw windows.pslist.PsList Volatility 3 Framework 2.7.1 Progress: 100.00 PDB scanning finished PID PPID ImageFileName Offset(V) Threads Handles SessionId Wow64 CreateTime ExitTime File output 4 0 System 0x83d09c58 85 483 N/A False 2018-10-23 08:29:16.000000 N/A Disabled 260 4 smss.exe 0x8437db18 2 29 N/A False 2018-10-23 08:29:16.000000 N/A Disabled . . . 2096 324 cmd.exe 0x851a6610 1 22 1 False 2018-10-23 08:30:18.000000 N/A Disabled . 2412 324 DumpIt.exe 0x845a8d20 2 38 1 False 2018-10-23 08:30:48.000000 N/A Disabled .
cmd.exeが実行されているのはやはり気になる。DumpIt.exeはメモリダンプをとっている実行であるようだ。
ん、volatility3で実行していましたけど、volatility2の方が解析しやすい?cmd.exe上で何が実行されたかを確認するのが難しい。
確かにvolatility2で実行するとコマンドで実行したものが見れた。
└─# python2 vol.py -f ../Challenge.raw --profile=Win7SP0x86 cmdscan Volatility Foundation Volatility Framework 2.6.1 . . Cmd #0 @ 0x2f43c0: C:\Python27\python.exe C:\Users\hello\Desktop\demon.py.txt . .