-> Back to Writeups
Security Incident Report

BlackSun Ransomware: PowerShell Kill Chain to Encryption

TLP:CLEAR
Report ID INC2022-0516-PSE Classification Simulated / Training Environment
Analyst F. Nanos Platform / Tool TryHackMe ยท Splunk (Sysmon)
Severity Critical Status Closed (Investigation Complete)
Impact Confirmed file encryption (availability impact)
This report documents a simulated ransomware incident from a training environment (TryHackMe, "PS Eclipse"). User and artifact values are generalized for public publication; the analytical structure, Sysmon query logic, and findings reflect the actual investigation performed. No production, client, or employer data is included.

1. Executive Summary

A workstation was compromised and encrypted by BlackSun ransomware. The attack began with a single obfuscated PowerShell command that disabled real-time antivirus monitoring, downloaded a dropper through a public tunneling service, and scheduled it to run with SYSTEM privileges. The dropper then contacted an external command-and-control endpoint, retrieved the ransomware payload, encrypted the user's files, and replaced the desktop wallpaper with a ransom message. The full chain was reconstructed from Sysmon telemetry in Splunk. This was a successful detonation with real availability impact; recovery depends on clean offline backups.

2. Scope & Methodology

The investigation was conducted against Sysmon endpoint telemetry in Splunk. The initiating action was a Base64-encoded PowerShell command; because PowerShell encodes such commands in UTF-16LE, the decode path was Base64 followed by UTF-16LE text decoding, which revealed the full malicious sequence. Process-creation, file-creation, and DNS-query event types were then correlated to trace delivery, C2, and encryption.

3. Attack Chain

3.1   Obfuscated PowerShell & Defender Disable

The decoded command first turned off Windows Defender real-time monitoring, removing the endpoint's primary protection before any payload touched disk.

Set-MpPreference -DisableRealtimeMonitoring $true

3.2   Dropper Delivery via Tunneling Service

The command downloaded a dropper executable into a system temporary directory through a public tunneling service. Fronting the real infrastructure with a legitimate-looking tunnel domain defeats IP and domain reputation controls.

3.3   SYSTEM-Level Scheduled Task

A scheduled task was created to execute the dropper as SYSTEM. This grants the highest privilege on the host without any credential theft, and simultaneously provides execution persistence.

SCHTASKS /Create /TN [dropper] /RU SYSTEM ...

3.4   C2 & Ransomware Deployment

The dropper contacted a second tunnel endpoint and retrieved the BlackSun ransomware as a PowerShell script. The payload encrypted the user's files, dropped a ransom note into the user's Downloads directory, and set a ransom-themed image as the desktop wallpaper, the visible confirmation of a successful event.

4. Detection Queries

Each query below was used during the investigation to surface a specific stage of the chain.

# 1 - Encoded PowerShell parent command lines (exposes the -enc launcher)
index=main EventCode=1
| stats count by ParentCommandLine

# 2 - Dropped files (locates the dropper in the temp directory)
index=main EventCode=11
| stats count by TargetFilename, Image

# 3 - C2 via DNS (tunnel traffic is invisible to IP reputation; DNS is the tell)
index=main EventCode=22 [dropper]
| table QueryName, Image

# 4 - Ransomware artifacts (confirms family and encryption event)
index=main EventCode=11 TargetFilename="*BlackSun*"
| table TargetFilename, Image

5. MITRE ATT&CK Mapping

Technique ID Technique Tactic
T1059.001PowerShellExecution
T1027.010Command Obfuscation (Base64)Defense Evasion
T1562.001Impair Defenses: Disable or Modify ToolsDefense Evasion
T1105Ingress Tool TransferCommand and Control
T1071Application Layer Protocol (tunnel)Command and Control
T1053.005Scheduled Task (SYSTEM)Persistence
T1486Data Encrypted for ImpactImpact

6. Recommendations

  1. Isolate and rebuild the affected host; restore encrypted data from offline backups. Do not consider payment.
  2. Enable Windows Defender Tamper Protection so real-time monitoring cannot be disabled from a script.
  3. Enforce PowerShell Constrained Language Mode and Script Block Logging.
  4. Restrict or monitor outbound access to public tunneling services at the egress.
  5. Alert on encoded PowerShell command lines, on the Defender real-time-disable command, and on DNS queries to known tunneling domains.
  6. Alert on scheduled tasks created with SYSTEM run-level that point to binaries in temporary directories.

7. Investigator's Notes

Two points proved most instructive. First, the tunneling-based C2 was effectively invisible to IP-reputation controls, so DNS-query telemetry, not network-reputation blocking, was the dependable detection. Second, benign PowerShell policy-test artifacts appeared alongside the malicious activity and had to be recognized as legitimate noise rather than pursued as indicators. The standing lesson is that a full ransomware chain can hinge on a single decoded command, and that decoding obfuscated PowerShell early is often the fastest route to the entire kill chain.

END OF REPORT : INC2022-0516-PSE
Full technical detail, exact artifact values, and challenge-identifying information intentionally generalized for public publication. Happy to walk through the complete investigation in more depth in conversation: get in touch.