Investigating Windows 3 - mattit4o/TryHackMeWriteUps GitHub Wiki

THM Investigating Windows 3.0

https://tryhackme.com/room/investigatingwindows3

Try Hack Me Investigating Windows 3.0

This is the 3rd room out of the investigating windows series, and I found it most challenging. I learned more about Yara and MITRE. It took me the longest out of the rooms in the series and had to ask for a little help from the forums/discord. Initial Recon When I first connected to the desktop of the machine it initially, you can see a couple of items on the desktop – a process monitor logfile and autoruns logfile.

Try Hack Me Investigating Windows 3.0

I initially thought these were from another device but checking the system information shows it is the same pc.

Try Hack Me Investigating Windows 3.0

Some standard icons on the task bar (windows explorer, cmd, powershell and eventviewer)

Try Hack Me Investigating Windows 3.0

THM leave a few clues on the tools they think you will need.

In the c:\tools folder I could see a sysint (SysInternals) and Sysmon-modular folder.
There is a sysmonconfig.xml which is used for the monitoring of the machine. Lots of technique ids from MITRE to think about.

Try Hack Me Investigating Windows 3.0

I initially launched Autoruns from the Log file and could see a few interesting items highlighted in yellow advising not found (meaning they have been removed)

Try Hack Me Investigating Windows 3.0

Try Hack Me Investigating Windows 3.0

Try Hack Me Investigating Windows 3.0

I also opened the process monitor log and found a few thousand events!

Try Hack Me Investigating Windows 3.0

Try Hack Me Investigating Windows 3.0

Tasks

#1 What is the registry key with the encoded payload? (full path)

Looking at the autoruns logs highlighted earlier I looked at the HKLM\Software\Microsoft\Windows\CurrentVersion\Run entry.

Try Hack Me Investigating Windows 3.0

This looked odd and I had not seen a .debug entry before. I opened RegEdit and found the last view was:

Try Hack Me Investigating Windows 3.0

I tried a few variations of the key in THM to see if I could get these to match. Finally, one did. Normally registry keys are full: [HKEY_CURRENT_USER*******] THM use: HKCU******************* So the answer format…. (not giving too much away?) HKCU**********

#2 What is the rule name for this run key generated by Sysmon?

This question took me a little while to locate I looked in Process Monitor saw lots of Sysmon entries and then looked in Event Viewer and checked the application and services logs and found Sysmon entries You can then searched for “powershell” but there were quite a few entries. Search for the registry entry ***** and you should find the Technique_id=Txxxx.xxx, Technique_name=Registery Run keys / Start Folder

#3 What tactics is classified with this MITRE ATT&CK ID?

If you google the last answer you will get the Mitre.org website technique – the tactics are listed:

Try Hack Me Investigating Windows 3.0

#4 What was UTC time for the Sysmon event?

Once you find the entry for #2 in the Event Log this has the UTC time

#5 What was the Sysmon Event ID? Event Type? (answer, answer)

The Event Id and Type are also listed in the Event Log you found from #2

#6 Decode the payload. What service will the payload attempt start?

This was a little tricky initially - I did not do the questions in order and came back to this section. I spent some time looking through the logs again and also found the powershell transcripts in the documents folders. Some of these helped and I could see information was base64 encoded

Try Hack Me Investigating Windows 3.0

I decoded via cyberchef and https://www.base64decode.org/

Try Hack Me Investigating Windows 3.0

This did not give me what I was looking for. Until I found the entry in the Registry

Try Hack Me Investigating Windows 3.0

Try Hack Me Investigating Windows 3.0

The service was the listed with the port number for #7

#7 The payload attempts to open a local port. What is the port number?

Port listed from decode text #6 #8 What process does the payload attempt to terminate? This need a decode of the code found in #6.

Try Hack Me Investigating Windows 3.0

#9 What DLL file does the payload attempt to remove? (full path)

This was also listed in the decode but can be found in the event logs.

#10 What is the Windows Event ID associated with this service?

This can be found in the event logs under

Try Hack Me Investigating Windows 3.0

Try Hack Me Investigating Windows 3.0

There is only one log entry.

#11 What is listed as the New Default Printer?

This is found in Printers and scanners

Try Hack Me Investigating Windows 3.0

#12 What process is associated with this event?

The Printers are controlled by a service in Windows – a little google if you don’t know.

Try Hack Me Investigating Windows 3.0

#13 What is the parent PID for the above process?

The answer can be found via process monitor – find the process and then click goto event. The log file entry will change behind and the event properties (ctrl+p) will be shown. Click the Process Tab and the Parent PID is shown.

#14 Examine the other processes. What is the PID of the suspicious process with an encoded payload?

The answer to this question took a little trial and error. What is the PID of the process running the encoded payload maybe a better question.

Try Hack Me Investigating Windows 3.0

You can see in process monitor the processes and clicking each shows the commands. (its not mmc)

#15 Decode the payload. What is the a visible partial path?

This was in the 2nd decode text

Try Hack Me Investigating Windows 3.0

#16 This is the default communication profile the agent used to connect to the attack machine. What attack framework was used? What is the name of the variable? (answer, answer)

The question is a bit ambiguous. Getting the order right is half the battle.

The Default communication profile is the variable used - Check the Listeners 101 section on the Quickstart page of the github for the C2 Attack framework.
The Attack framework name found on the Github.

#17 What other file paths are you likely to find in the logs? (answer, answer)

A google of the information you found in #15 (#16) should show some examples of other paths. These are also in the Application and Services log files.

Try Hack Me Investigating Windows 3.0

Try search for the #15 answer in the PowerShell logs.

#18 What is the MITRE ATT&CK URI for the attack framework?

The can be found if you search google for the answer to #15 + mitre Or on Mitre.org

#19 What was the FQDN of the attacker machine that the suspicious process connected to?

I filtered the processed and looked for “powershell”

Try Hack Me Investigating Windows 3.0

There are some TCP Send entries which show the FQDN

#20 What other process connected to the attacker machine?

Try filtering by TCP Send to see other processes that connect to the same destination as #19

Try Hack Me Investigating Windows 3.0

#21 What is the PID for this process?

You can see the PID once you see them in the list from #20

#22 What was the path for the first image loaded for the process identified in Q's 19 & 20?

Filter by the PID found in #21 and Operation “Load Image”

#23 What Symon event were generated between these 2 processes? What is its associated Event ID #? (answer, answer)

This took a while – checking through sysmon event logs, I search for the process ID found above

Try Hack Me Investigating Windows 3.0
Found a few entries for Powershell and Explorer where they.

#24 What is the UTC time for the first event between these 2 processes?

Look for the first occurrence.

#25 What is the value under Date and Time? (MM/DD/YYYY H:MM:SS [AM/PM])

Look for the first occurrence.

#26 What is the first operation listed by the 2nd process starting with the Date and Time from Q25?

If you look in process monitor around the same time the Event type is listed

#27 What is the full registry path that was queried by the attacker to get information about the victim?

Open the Process Monitor Log and look at processes after 5:07 with operation is RegQueryValue

Try Hack Me Investigating Windows 3.0

#28 What is the name of the last module within this event which had a successful result?

Right click the attack process for powershell and view the process tab, in stack section - the last in the list <*******>

Try Hack Me Investigating Windows 3.0

#29 Most likely what module within the attack framework was used between the 2 processes?

Look on the Mitre page for the Modules and Techniques used.

#30 What is the MITRE ID for this technique?

See #29 and match the ID on Mitre page.

Credits - Blue Teaming is about sharing knowledge. I had help from several members of the forum and discord so am not taking all the credit.

⚠️ **GitHub.com Fallback** ⚠️