CrewCTF - Attaaaaack 1-13
:::spoiler TOC [TOC] :::
One of our employees at the company complained about suspicious behavior on the machine, our IR team took a memory dump from the machine and we need to investigate it.
==Attaaaaack 1==
Q1. What is the best profile for the the machine?
Exploit
1 |
|
Flag: crew{Win7SP1x86_23418}
==Attaaaaack 2==
Q2. How many processes were running ? (number)
Exploit
:::spoiler Command Result
1 |
|
:::
Flag: 47
==Attaaaaack 3==
Q3. i think the user left note on the machine. can you find it ?
Recon
這一題真的要通靈,看到note第一直覺應該是想到要看有沒有類似notepad這樣的文字編輯器,果不其然pslist有這個process,所以可以把該process的memory dump出來,然後strings search再grep特定的regular expression,不過這邊有一個需要通靈的地方,就是通靈regular expression的形式,還必須要注意strings的形式是16 bits和little endian的形式才找的到,上述方法是參考1,另外一個方法是可以通靈到作者有可能會把字串暫存在clipboard上,這樣就可以搭配clipboard這個plugin,可以直接print出clipboard中的內容
Exploit
- 方法一
1
2
3
4
5
6
7
8
9
10$ volatility_2.6_win64_standalone.exe -f memdump.raw --profile Win7SP1x86_23418 clipboard Volatility Foundation Volatility Framework 2.6 Session WindowStation Format Handle Object Data ---------- ------------- ------------------ ---------- ---------- -------------------------------------------------- 1 WinSta0 CF_UNICODETEXT 0xa00d9 0xfe897838 1_l0v3_M3m0ry_F0r3ns1cs_S0_muchhhhhhhhh 1 WinSta0 0x0L 0x10 ---------- 1 WinSta0 0x2000L 0x0 ---------- 1 WinSta0 0x0L 0x3000 ---------- 1 ------------- ------------------ 0x1a02a9 0xfe670a68 1 ------------- ------------------ 0x100067 0xffbab448
- 方法二
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16$ volatility_2.6_win64_standalone.exe -f memdump.raw --profile Win7SP1x86_23418 pslist | findstr notepad Volatility Foundation Volatility Framework 2.6 0x84390030 notepad.exe 2556 300 2 58 1 0 2023-02-20 19:03:41 UTC+0000 $ volatility_2.6_win64_standalone.exe -f memdump.raw --profile Win7SP1x86_23418 memdump --pid 2556 -D .\output $ strings -el 2556.dmp | grep -E "(.*?)_(.*?)_" ... _040515AD&REV_00 PCI\VEN_15AD&DEV_0405&SUBSYS_040515AD&REV_TERMINAL CI\VEN_15AD&DEV_0405&CC_0300 DEV_0405&CC_030000 PCI\VEN_15AD&DEV_0405&CC_0300 1_l0v3_M3m0ry_F0r3ns1cs_S0_muchhhhhhhhh EN_15AD&DEV_0405&CC_0300 \??\HID#VID_0E0F&PID_0003&MI_00#8&167f267&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd} \??\IDE#CdRomNECVMWar_VMware_SATA_CD01_______________1.00____#6&22d3c06&0&1.0.0#{53f56308-b6bf-11d0-94f2-00a0c91efb8b} \??\HID#VID_0E0F&PID_0003&MI_01#8&226f4b5b&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd}
Flag: crew{1_l0v3_M3m0ry_F0r3ns1cs_S0_muchhhhhhhhh}
==Attaaaaack 4==
Q4. What is the name and PID of the suspicious process ? example : crew{abcd.exe_111}
Recon
因為是賽後解,所以其實…如果是線上解的話可以try&error,反正這一題也是頗單純,如果觀察pslist的process,會發現有一個runddl32.exe他就是在模仿rundll32,所以這就是一個怪可疑的process
Exploit
Flag: crew{runddl32.exe_300}
==Attaaaaack 5==
Q5. What is the another process that is related to this process and it’s strange ? example : crew{spotify.exe}
Exploit
1 |
|
Flag: crew{notepad.exe}
==Attaaaaack 6==
Q6. What is the full path (including executable name) of the hidden executable? example : crew{C:\Windows\System32\abc.exe}
Recon
這一題指的是runddl32.exe在哪邊,就直接filescan然後string search就找到了
Exploit
1 |
|
Flag: crew{C:\Users\0XSH3R~1\AppData\Local\Temp\MSDCSC\runddl32.exe}
==Attaaaaack 7==
Q7. What is the API used by the malware to retrieve the status of a specified virtual key on the keyboard ? flag format: crew{AbcDef}
Recon
仔細分析題目的話,會知道他要我們找出malware使用哪個API(method/function)取得keyboard上的虛擬按鍵,所以直覺的做法是直接把該執行檔dump出來,然後string search這隻檔案有哪些和key相關的東西
Exploit
如果把該支malware丟到virustotal後,結果可以看這邊
1 |
|
一個一個try就可以了
Flag: crew{GetKeyState}
==Attaaaaack 8==
Q8. What is the Attacker’s C2 domain name and port number ? (domain name:port number) example : crew{abcd.com:8080}
Background
CyberDefender - MrRobot - POS - Q21
Recon
這一題直覺會想用netscan,畢竟從前面的題目以及找到的資訊,還有virustotal上的資訊,幾乎確定他就是一個keylogger,然後會把得到的資訊傳回去C&C server中,但奇怪的是察看netscan沒有相關的connection,不確定到底是怎麼樣,找了很久,最後是參考siunam321的writeup,他也是找了很久,結果其實virustotal都已經寫好了,
Exploit
在Behavior的地方
Flag: crew{test213.no-ip.info:1604}
==Attaaaaack 9==
Q9. Seems that there is Keylogger, can you find it’s path ? example : crew{C:\Windows\System32\abc.def}
Background
Recon
這一題完全不會,所以看了siunam321的writeup,他的做法是到網路上找有沒有test213.no-ip.info keylogger
的相關文章,結果TekDefense就有提到這隻malware
The OFFLINEK option had me confused for a bit. So to explain it a bit better, when OFFLINEK is enabled “{1}” the malware will continue to log keystroke to a local file that can then be picked up by the attacker as they want. When disabled, the attacker only has access to keystrokes when the attacker has a live session open with the victim.
簡單來說就是他有一個參數(OFFLINEK),如果被設定為1,則在離線的時候還是會繼續記錄,然後把結果存在local file,這也回應了前面位甚麼用netscan找不到的原因,因為作者沒有連線,所以當然不會有相關的process,而該bloger也找到了他存在local端的地方就在
C:\Users\{Username}\AppData\Roaming\dclogs\{timestamp}.dc
Exploit
1 |
|
Flag: crew{C:\Users\0xSh3rl0ck\AppData\Roaming\dclogs\2023-02-20-2.dc}
==Attaaaaack 10==
Q10. we think that the malware uses persistence technique can you detect it ? example : crew{Scheduled_tasks} (first letter of the first word is uppercase and the first letter of other is lowercase)
Background
NTUSTISC - CyberDefender - MrRobot - Target 1 - Q5
Recon
這題background可以看前面寫的文章,然後基本上都差不多,只是要特別注意-K後面帶的參數,一定要是從Software開始,他和原本cyberdefender的版本有點不太一樣,下-k參數之前先看printkey印出甚麼東西,然後再從他的subkey往後推看是要接Software還是Mircosoft,基本上都會寫在\REGISTRY\USER\
的部分
Exploit
1 |
|
Flag: crew{Registry_keys}
==Attaaaaack 11==
Q11. can you find the key name and it’s value ? example : crew{CurrentVersion_ProductName}
Exploit
從上一題的輸出就知道key name是run,然後value是MicroUpdate
Flag: crew{Run_MicroUpdate}
==Attaaaaack 12==
Q12. What is the strange handle used by the malware ? example : crew{the name of the handle}
Background
NTUSTISC - CyberDefender - MrRobot - Target 1 - Q6
Recon
基本上就和之前寫的文章一樣,
Exploit
1 |
|
Flag: crew{DC_MUTEX-KHNEW06}
==Attaaaaack 13==
Q13. Now can you help us to know the Family of this malware ? example : crew{Malware}
Recon
這一題在第7題就找到了
Exploit
Flag: crew{DarkKomet}