https://tryhackme.com/room/adventofcyber4

Task 15 [Day 10] Hack a game You’re a mean one, Mr. Yeti

Frage 1:
What is the Guard’s flag?

Wir folgen der Anleitung im Task und nachdem sich die Tür geöffnet hat sprechen wir mit der Wache.

Antwort 1:
THM{5_star_Fl4gzzz}

Frage 2:
What is the Yeti’s flag?

Wenn wir über die Brücke laufen werden wir von Schneebällen abgeschossen, diese setzen auch unsere Lebenspunkte herunter. Das ist genau der Wert, den wir finden wollen. Wir laufen also in die Schneebälle und lassen uns ein wenig Schaden erleiden, bevor wir wieder herauslaufen.

Jetzt machen wir eine erste „Blindsuche“ in Cetus. Wir geben keinen Wert ein, wählen „LT“ und lassen uns die Ergebnisse anzeigen. Jetzt laufen wir wieder in die Schneebälle und lassen uns komplett ausschalten und respawnen. Nun können wir in Cetus „GT“ (also Greater Than) auswählen, da wir ja wieder volle Lebenspunkte haben. Als erster Wert wird uns ein Dezimalwert mit 100 angezeigt:

Diesen Bookmarken wir uns und wechseln in den Bookmarks Tab.

Hier setzen wir einen Haken bei „Freeze“, das verhindert die Änderung des Wertes und macht uns unverwundbar. Nun können wir unbeschadet über die Brücke laufen und überstehen auch den letzten „Angriff“ des Bandit Yetis.

Antwort 2:
THM{yetiyetiyetiflagflagflag}

Task 16 [Day 11] Memory Forensics Not all gifts are nice

Frage 1:
What is the Windows version number that the memory image captured?

Hier müssen wir Volatility starten und die Datei analysieren:

elfmcblue@aoc2022-day-11:~$ cd volatility3
elfmcblue@aoc2022-day-11:~/volatility3$ python3 vol.py -f workstation.vmem windows.info
Volatility 3 Framework 2.4.1
Progress:  100.00PDB scanning finished                        
VariableValue

Kernel Base0xf803218a8000
DTB0x1ad000
Symbolsfile:///home/elfmcblue/volatility3/volatility3/symbols/windows/ntkrnlmp.pdb/E0093F3AEF
15D58168B753C9488A4043-1.json.xz
Is64BitTrue
IsPAEFalse
layer_name0 WindowsIntel32e
memory_layer1 FileLayer
KdVersionBlock0xf80321cd23c8
Major/Minor15.18362
MachineType34404
KeNumberProcessors4
SystemTime2022-11-23 10:15:56
NtSystemRootC:\Windows
NtProductTypeNtProductWinNt
NtMajorVersion10
NtMinorVersion0
PE MajorOperatingSystemVersion10
PE MinorOperatingSystemVersion0
PE Machine34404
PE TimeDateStampMon Apr 14 21:36:50 2104

Antwort 1:
10

Frage 2:
What is the name of the binary/gift that secret Santa left?

WIr lassen uns mit einem psscan die Prozesse anzeigen und was sie so getrieben haben:

elfmcblue@aoc2022-day-11:~/volatility3$ python3 vol.py -f workstation.vmem windows.psscan
Volatility 3 Framework 2.4.1
Progress:  100.00PDB scanning finished                        
PIDPPIDImageFileNameOffset(V)ThreadsHandlesSessionIdWow64Create
TimeExitTimeFile output

40System0xc0090b286040141-N/AFalse2022-11-23 09:43:13.00
0000 N/ADisabled
1044Registry0xc0090b2dd0804-N/AFalse2022-11-23 09:
43:04.000000 N/ADisabled
25282108vm3dservice.ex0xc0090b3030802-1False2022-11-23 09:
43:38.000000 N/ADisabled
2440656svchost.exe0xc0090b33608011-0False2022-11-23 09:
43:37.000000 N/ADisabled
6584792ApplicationFra0xc0090b3750802-1False2022-11-23 09:
58:58.000000 N/ADisabled
1048656SecurityHealth0xc0090b39e0809-0False2022-11-23 09:
44:46.000000 N/ADisabled
19284064cmd.exe0xc0090b3a84c01-1False2022-11-23 09:59:09.00
0000 N/ADisabled
20405888mysterygift.ex0xc0090b52e4c03-1False2022-11-23 10:
15:19.000000 N/ADisabled
--snip--

Antwort 2:
mysterygift.exe

Frage 3:
What is the Process ID (PID) of this binary?

Die Antwort erhalten wir aus Frage 2.

Antwort 3:
2040

Frage 4:
Dump the contents of this binary. How many files are dumped?

Hier müssen wir darauf achten, dass wir auch die ProcessID mit angeben:

elfmcblue@aoc2022-day-11:~/volatility3$ python3 vol.py -f workstation.vmem windows.dumpfiles --pid 2040
Volatility 3 Framework 2.4.1
Progress:  100.00PDB scanning finished                        
CacheFileObjectFileNameResult

ImageSectionObject0xc00912e1f1f0mysterygift.exefile.0xc00912e1f1f0.0xc009119ab9b0.Ima
geSectionObject.mysterygift.exe.img
ImageSectionObject0xc0090e8b9b50kernel32.dllfile.0xc0090e8b9b50.0xc0090bb58d70.Ima
geSectionObject.kernel32.dll.img
ImageSectionObject0xc0090f3b7a50dnsapi.dllfile.0xc0090f3b7a50.0xc0090f3a4c40.Ima
geSectionObject.dnsapi.dll.img
ImageSectionObject0xc0090fe50630FWPUCLNT.DLLfile.0xc0090fe50630.0xc0090fdb7c80.Ima
geSectionObject.FWPUCLNT.DLL.img
ImageSectionObject0xc0090fe56bc0rasadhlp.dllfile.0xc0090fe56bc0.0xc0090ff8ed30.Ima
geSectionObject.rasadhlp.dll.img
ImageSectionObject0xc0090f3b8d10IPHLPAPI.DLLfile.0xc0090f3b8d10.0xc0090f3d6010.Ima
geSectionObject.IPHLPAPI.DLL.img
ImageSectionObject0xc0090e8b8250KernelBase.dllfile.0xc0090e8b8250.0xc0090e579620.Ima
geSectionObject.KernelBase.dll.img
ImageSectionObject0xc0090f3b78c0mswsock.dllfile.0xc0090f3b78c0.0xc0090f3d0c40.Ima
geSectionObject.mswsock.dll.img
ImageSectionObject0xc0090e8b9ce0bcrypt.dllfile.0xc0090e8b9ce0.0xc0090e5786d0.Ima
geSectionObject.bcrypt.dll.img
ImageSectionObject0xc0090ba9c6a0msvcrt.dllfile.0xc0090ba9c6a0.0xc0090bb54d70.Ima
geSectionObject.msvcrt.dll.img
ImageSectionObject0xc0090e8dcb50advapi32.dllfile.0xc0090e8dcb50.0xc0090e7b4ce0.Ima
geSectionObject.advapi32.dll.img
ImageSectionObject0xc0090e8dc6a0rpcrt4.dllfile.0xc0090e8dc6a0.0xc0090e511c50.Ima
geSectionObject.rpcrt4.dll.img
ImageSectionObject0xc0090e774510ws2_32.dllfile.0xc0090e774510.0xc0090bb3e8a0.Ima
geSectionObject.ws2_32.dll.img
ImageSectionObject0xc0090e774830nsi.dllfile.0xc0090e774830.0xc0090bb55d70.ImageSectio
nObject.nsi.dll.img
ImageSectionObject0xc0090e6611f0ntdll.dllfile.0xc0090e6611f0.0xc0090bb84bb0.Ima
geSectionObject.ntdll.dll.img
ImageSectionObject0xc0090ba9cce0sechost.dllfile.0xc0090ba9cce0.0xc0090e4d4bb0.Ima
geSectionObject.sechost.dll.img
elfmcblue@aoc2022-day-11:~/volatility3$ 

Antwort 4:
16

Task 17 [Day 12] Malware Analysis Forensic McBlue to the REVscue!

Frage 1:
What is the architecture of the malware sample? (32-bit/64-bit)

In Detect it Easy neben dem Dateinamen.

Antwort 1:
64-bit

Frage 2:
What is the packer used in the malware sample? (format: lowercase)

In Detect it Easy vor dem Dateinamen.

Antwort 2:
upx

Frage 3:
What is the compiler used to build the malware sample? (format: lowercase)

Nachdem wir die Datei mit upx entpackt haben, startern wir capa erneut:

C:\Users\Administrator\Desktop\Malware Sample>capa mysterygift
loading : 100%|███████████████████████████████████████████████████████| 485/485 [00:00<00:00, 1702.46     rules/s]
matching: 100%|█████████████████████████████████████████████████████████| 573/573 [00:16<00:00, 34.69 functions/s]
+------------------------+------------------------------------------------------------------------------------+
| md5                    | 4e0321d7347cc872a5ac8ca7220b0631                                                   |
| sha1                   | 2dfcba8c182e4ea7665c44054d46549cc7b4430a                                           |
| sha256                 | 647458e71aea13d92e944bc7b7f305c6da808c71c3d19dc255a96dd60c8800a7                   |
| path                   | mysterygift                                                                        |
+------------------------+------------------------------------------------------------------------------------+

+------------------------+------------------------------------------------------------------------------------+
| ATT&CK Tactic          | ATT&CK Technique                                                                   |
|------------------------+------------------------------------------------------------------------------------|
| DEFENSE EVASION        | Obfuscated Files or Information [T1027]                                            |
| DISCOVERY              | File and Directory Discovery [T1083]                                               |
|                        | System Information Discovery [T1082]                                               |
| EXECUTION              | Shared Modules [T1129]                                                             |
| PERSISTENCE            | Boot or Logon Autostart Execution::Registry Run Keys / Startup Folder [T1547.001]  |
+------------------------+------------------------------------------------------------------------------------+

+-----------------------------+-------------------------------------------------------------------------------+
| MBC Objective               | MBC Behavior                                                                  |
|-----------------------------+-------------------------------------------------------------------------------|
| ANTI-BEHAVIORAL ANALYSIS    | Debugger Detection::Software Breakpoints [B0001.025]                          |
| DATA                        | Check String [C0019]                                                          |
|                             | Encoding::Base64 [C0026.001]                                                  |
|                             | Non-Cryptographic Hash::MurmurHash [C0030.001]                                |
| DEFENSE EVASION             | Obfuscated Files or Information::Encoding-Standard Algorithm [E1027.m02]      |
| FILE SYSTEM                 | Read File [C0051]                                                             |
|                             | Write File [C0052]                                                            |
| MEMORY                      | Allocate Memory [C0007]                                                       |
| PROCESS                     | Terminate Process [C0018]                                                     |
+-----------------------------+-------------------------------------------------------------------------------+

+------------------------------------------------------+------------------------------------------------------+
| CAPABILITY                                           | NAMESPACE                                            |
|------------------------------------------------------+------------------------------------------------------|
| check for software breakpoints                       | anti-analysis/anti-debugging/debugger-detection      |
| compiled with Nim                                    | compiler/nim                                         |
| encode data using Base64                             | data-manipulation/encoding/base64                    |
| reference Base64 string                              | data-manipulation/encoding/base64                    |
| hash data using murmur3 (2 matches)                  | data-manipulation/hashing/murmur                     |
| contain a resource (.rsrc) section                   | executable/pe/section/rsrc                           |
| contain a thread local storage (.tls) section        | executable/pe/section/tls                            |
| query environment variable                           | host-interaction/environment-variable                |
| check if file exists                                 | host-interaction/file-system/exists                  |
| read file (3 matches)                                | host-interaction/file-system/read                    |
| write file (4 matches)                               | host-interaction/file-system/write                   |
| get thread local storage value                       | host-interaction/process                             |
| allocate RWX memory                                  | host-interaction/process/inject                      |
| terminate process                                    | host-interaction/process/terminate                   |
| parse PE header (2 matches)                          | load-code/pe                                         |
| reference startup folder                             | persistence/startup-folder                           |
+------------------------------------------------------+------------------------------------------------------+

Antwort 3:
nim

Frage 4:
How many MITRE ATT&CK techniques have been discovered attributed to the DISCOVERY tactic?

Die Antwort erhalten wir aus Frage 3, im zweiten Kasten.

Antwort 4:
2

Frage 5:
What is the registry key abused by the malware?

Hier müssen wir die RegCreateKey Operation finden, die einen alten Key erfolgreich benutzt (Set Value):

Antwort 5:
HKCU\Software\Microsoft\Windows\CurrentVersion\Run

Frage 6:
What is the value written on the registry key based on the previous question?

Hier wird der Pfad der Datei gesucht, die sich im Autostart Ordner festgesetzt hat. Das geht aus der Frage nicht ganz hervor, bezieht sich jedoch auf die Registry. Die Antwort finden wir in der Operation unter der aus Frage 5, mit dem Wert RegSetValue:

Antwort 6:
C:\Users\Administrator\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\wishes.bat

Frage 7:
What are the names of two files created by the malware under the C:\Users\Administrator\ directory? (format: file1,file2 in alphabetical order)

Wenn der Filter auf „Show FIle System Activity“ gesetzt wurde können wir die AUfgabe beantworten:

Antwort 7:
test.jpg,wishes.bat

Frage 8:
What are the two domains wherein malware has initiated a network connection? (format: domain1,domain2 in alphabetical order)

Haben wir den Network Filter aktiviert, können wir die gesuchten Webseiten finden:

Antwort 8:
bestfestivalcompany.thm,virustotal.com

Frage 9:
Going back to strings inside the malware sample, what is the complete URL used to download the file hosted in the first domain accessed by the malware?

Wir öffnen mysterygift.exe wieder mit Detect it Easy und klicken auf Strings. Unten als Filter geben wir den Anfang unserer entdeckten URL ein und haben unser Ergebnis:

Antwort 9:
http://bestfestivalcompany.thm/favicon.ico