You are a SOC Analyst for an MSSP (Managed Security Service Provider) company called TryNotHackMe .
A customer sent an email asking for an analyst to investigate the events that occurred on Keegan’s machine on Monday, May 16th, 2022 . The client noted that the machine is operational, but some files have a weird file extension. The client is worried that there was a ransomware attempt on Keegan’s device.
Your manager has tasked you to check the events in Splunk to determine what occurred in Keegan’s device.
Happy Hunting!
PowerShell-Based Ransomware Deployment on Keegan’s Workstation
Ransomware, Privilege Escalation, C2 Communication
Sysmon, Splunk, PowerShell Logs
Ransomware deployment (BlackSun) resulting in encrypted files
Malicious PowerShell script downloaded and executed
PowerShell decoded and ran additional payloads
Scheduled task created using schtasks.exe, triggered by event ID 777
Scheduled task configured to run as SYSTEM
Windows Defender real-time monitoring disabled via PowerShell
Not explicitly observed
Not explicitly observed
Not explicitly observed
Communication with attacker via ngrok.io HTTP/HTTPS tunnels
Ransomware deployed (blacksun.ps1), ransom note dropped, wallpaper replaced
T1204.002
User Execution
User manually ran a malicious PowerShell command
T1059.001
PowerShell
Used to run payloads, disable Defender, and launch scheduled tasks
T1053.005
Scheduled Task
Task created to execute binary with SYSTEM privileges
T1105
Ingress Tool Transfer
Remote file downloaded (OUTSTANDING_GUTTER.exe, script.ps1)
T1027
Obfuscated Files or Information
PowerShell commands were base64-encoded and obfuscated
T1053.005
Scheduled Task
Scheduled task triggered on Event ID 777
T1053.005
Scheduled Task
Task ran as SYSTEM, giving elevated privileges
T1562.001
Disable or Modify System Protection
Windows Defender real-time monitoring was disabled
T1071.001
Application Layer Protocol: Web Protocols
C2 communications occurred over HTTP/HTTPS via ngrok
T1486
Data Encrypted for Impact
blacksun.ps1 ransomware encrypted user files and dropped ransom notes
Reference: [MITRE ATT&CK Navigator] ( https://attack.mitre.org/ )
I started by checking available log sources in Splunk — Sysmon was active, so I focused on EventCode 3 (network connections). That gave a solid view of outbound activity.
I set the date date range to 05.16.2022 from 00:00 to 24:00 and ran this query:
Splunk Query:
EventCode=3 | stats count as call by Image, DestinationIp, DestinationPort | table Image, DestinationIp, DestinationPort, call
From the results:
– I found a suspicious executable in C:\Windows\Temp\
– OUTSTANDING_GUTTER.exe made multiple outbound connections over port 443
– I also saw PowerShell making connections to the same destination IP over port 80
That combination was enough to dig deeper.
lets check what Powershell was doing on port 80 and looking on the CommandLine filter we can see a red flag, encoded PS execution
From the results:
– I found a suspicious executable in C:\Windows\Temp\
– OUTSTANDING_GUTTER.exe made multiple outbound connections over port 443
– I also saw PowerShell making connections to the same destination IP over port 80
That combination was enough to dig deeper.
lets check what Powershell was doing on port 80 and looking on the CommandLine filter we can see a red flag, encoded PS execution
Decode it with Cyberchef
– from base64
– then decode text to remove the sort of obfuscation with symbol between every letter
It revealed the command that downloaded the EXE into the Temp folder.
OUTSTANDING_GUTTER.exe
We already decoded the base64-encoded PowerShell command earlier, and it clearly showed the URL used to download OUTSTANDING_GUTTER.exe.
For safety, we defang the URL by replacing dots and slashes in standard format.
hxxp[://]886e-181-215-214-32[.]ngrok[.]io/
We already know the download was done via PowerShell, and the full path was visible in the initial network event logs and command line output.
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
The decoded PowerShell command told us everything. After disabling Defender, it used wget to download the binary into C:\Windows\Temp, then configured a scheduled task to run it as SYSTEM.
Here’s what the attacker did:
This confirms how the attacker ensured the payload would run with elevated privileges.
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
From the decoded PowerShell, we already know the scheduled task was created to run **as SYSTEM**.
Later in the chain, the attacker used schtasks.exe /Run to manually trigger that task, which executes the binary under the SYSTEM context.
So, we combine the user (NT AUTHORITY\\SYSTEM) and the exact command line used to run the task:
NT AUTHORITY\SYSTEM;”C:\Windows\system32\schtasks.exe” /Run /TN OUTSTANDING_GUTTER.exe
To trace the network activity of OUTSTANDING_GUTTER.exe, I filtered for related events and checked the QueryName field. This showed the domain the binary reached out to after execution.
The pattern is similar to the first ngrok domain — just a different subdomain.
ofc defang the URL and we have our answer
hxxp[://]9030-181-215-214-32[.]ngrok[.]io
Since OUTSTANDING_GUTTER.exe was dropped in C:\Windows\Temp, I searched for .ps1 files created in that same folder using:
Splunk Query:
TargetFilename="C:\\Windows\\Temp\\*.ps1" | table TargetFilename | dedup TargetFilename
Only one result came up — script.ps1.
To be sure this was part of the ransomware chain, I checked its hash on VirusTotal:
SHA256: E5429F2E44990B3D4E249C566FBF19741E671C0E40B809F87248D9EC9114BEF9
It was flagged as ransomware, confirming this was our next-stage payload.
script.ps1
powercat.ps1 used to establish reverse shell
The result identified the script as part of the BlackSun ransomware family. So even though the filename was script.ps1, the actual malware name is known.
blacksun.ps1
Knowing the ransomware was BlackSun, I looked for ransom notes — these are typically .txt files and often include “README” in the name.
I filtered for filenames matching BlackSun*.txt and found exactly what we were looking for:
The ransom note was saved in the victim’s Downloads folder under a random subdirectory.
C:\Users\keegan\Downloads\vasg6b0wmw029hd\BlackSun_README.txt
Most ransomware families modify the desktop wallpaper, and BlackSun is no different.
So, we can just look for `*.jpeg OR *.jpg OR *.png`
(if we take a look online about Blacksun we can find that the wallpaper is replaced with blacksun.jpg )
C:\Users\Public\Pictures\blacksun.jpg
One innocent-looking PowerShell command later, and we’ve got a scheduled task running as SYSTEM, Defender taking a nap, and ransomware dropping in like it owns the place.
The attacker didn’t waste time: base64 obfuscation, ngrok C2, and a second-stage payload (hello, blacksun.ps1) that encrypted everything but the wallpaper — which they helpfully replaced for us. All the usual red flags were waving: shady URLs, encoded scripts, and a blatant disregard for endpoint safety.
If nothing else, it’s a textbook reminder that PowerShell visibility isn’t optional — unless, of course, you enjoy surprise encryption.
Apparently we have to tell you this: yes, cookies are used. They're not edible, and no, you can't escape them — but you can pick what gets tracked. Yay for EU law!