Deep technical malware analysis reports, reverse engineering tools, unpacked stages, and recreated TTPs with detections for infamous malware families.
MedusaLocker is a human-operated ransomware family that has been hitting healthcare,
education and enterprise targets since 2019. This variant is notable for how thoroughly it
prepares the ground before encrypting: it escalates through a CMSTPLUA COM UAC bypass,
disables UAC entirely, stops and deletes interfering services, kills processes holding
file locks, and destroys recovery options through three separate mechanisms rather than the
usual single vssadmin call. Only then does the AES-256/RSA encryptor run — and a networking
module hunts SMB shares so the damage does not stop at the local host.
This post walks through the full reverse engineering of the MedusaLocker payload, technique by technique, with the disassembly screenshots taken during the analysis.
Scope: stages 1 and 2 — initial access via maldoc and execution through a batch script that invokes PowerShell — are not covered here. This analysis targets the stage 3 ransomware executable itself.
⚠️ Note: This is a re-write by AI, but have been vetted by Author.
📄 The original report is also available as a PDF. Samples (password
infected), recreated TTP code and detection rules are in the GitHub repository.
| # | Finding |
|---|---|
| 1 | CMSTPLUA COM UAC bypass — privileges are escalated through the well-known CMSTPLUA COM interface before any critical operation. |
| 2 | Defacement marker — a registry key at HKCU\SOFTWARE\MDSLK\Self is planted to mark the host as infected; an unusual and highly specific artefact. |
| 3 | Programmatic scheduled task — persistence avoids at.exe and schtasks.exe entirely, scheduling the task in C++ via the MSDN Task Scheduler API, repeating every 15 minutes indefinitely. |
| 4 | UAC disabled two ways — both EnableLUA and ConsentPromptBehaviorAdmin are set to 0, so a failure of the first is covered by the second. |
| 5 | Services stopped and deleted — it does not merely stop interfering services, it removes them via the Service Control Manager. |
| 6 | Triple recovery destruction — vssadmin and wbadmin for shadow copies, bcdedit to block recovery mode, plus emptying the recycle bin. |
| 7 | AES-256 + RSA — every file gets a random AES key, itself encrypted with an embedded base64 RSA public key and stored in the ransom note. |
| 8 | Mutex-gated single instance — a unique mutex stops multiple instances, which matters because the scheduled task re-launches it every 15 minutes. |
| 9 | SMB share discovery — ICMP sweeps the local network, then enumerates non-hidden SMB shares and queues them for encryption. |
The MedusaLocker executable touches an unusually wide span of the ATT&CK matrix. The sandbox mapping from a public report gives a sense of the breadth before diving in:

MedusaLocker opens with the most common ransomware housekeeping step: a unique mutex so only one instance runs at a time. This matters more than usual here — the scheduled task re-executes the binary every 15 minutes, and worm-like families risk re-infecting themselves.

The disassembly (from a stripped binary) shows three functions:
[Locker] Is running — disabled in this build.Before any critical operation, MedusaLocker escalates locally by abusing COM objects to bypass UAC — specifically the well-documented CMSTPLUA COM interface bypass.

The CLSIDs reference the WScript shell exec object, used to run the attacker’s command with elevation. In the stripped binary the functions are meaningless; after renaming the functions and parameters, the intent becomes obvious:

ATT&CK mapping
A genuinely unusual behaviour: MedusaLocker plants a marker registry key recording that the system has been infected.

HKEY_CURRENT_USER\SOFTWARE\MDSLK\Self
MDSLK is almost certainly shorthand for Medusa Locker. The operational purpose is not
clear — it may be a defacement gesture, or simply a flag the operators use to identify their own
victims. Either way it is a high-fidelity host artefact, precisely because it is so specific
and has no benign equivalent.
ATT&CK mapping
Most malware reaches for at.exe or schtasks.exe — both heavily monitored. MedusaLocker
instead schedules its task programmatically in C++, using the official Microsoft Task
Scheduler API straight from the MSDN sample code.

The sequence:
%APPDATA% as svhost.exe — a deliberate near-miss for the legitimate
svchost.exe.This is why the mutex exists at all — persistence and single-instancing are two halves of the same design.
ATT&CK mapping
Having escalated via CMSTPLUA, MedusaLocker can now make system-wide changes — and the first one is to switch UAC off entirely through the registry:

| Value | Set to | Effect |
|---|---|---|
EnableLUA |
0 |
The administrator prompt is never shown; everything runs elevated |
ConsentPromptBehaviorAdmin |
0 |
Backup measure — suppresses the consent prompt, but only takes effect after a restart |
The author deliberately set both: if the first fails, the second guarantees UAC is disabled once the machine reboots.
ATT&CK mapping
To ensure nothing holds a file lock or interrupts encryption, MedusaLocker enumerates a predefined set of services and processes and shuts them down. The list is recoverable through simple static string analysis:

Two mechanisms are used:
CreateToolhelp32Snapshot, Process32First,
Process32Next.ATT&CK mapping
Where most ransomware settles for deleting shadow copies, MedusaLocker attacks recovery from multiple angles:

vssadmin — delete shadow copieswbadmin — delete Windows Backup catalogs, a second and independent pathbcdedit.exe — disable boot into recovery mode, preventing repair optionsEvery one of these is launched through CreateProcessW, which treats the first whitespace
as the boundary between process name and arguments. The subroutine sub_41E9A0 is the one
spawning them:

ATT&CK mapping
MedusaLocker uses symmetric encryption for speed, wrapped in asymmetric encryption for control — the standard hybrid ransomware design:

The scheme:
CryptStringToBinaryA for use by the crypto APIs.CryptGenKey.ATT&CK mapping
MedusaLocker carries a networking module that extends the blast radius beyond the local machine:

$ in the name).ATT&CK mapping
Every technique below has been recreated as buildable C++ and paired with a detection rule or query. Links point to the write-up first, then the detection notes, then the raw source.
| Technique | ID | Write-up · Detection · Code |
|---|---|---|
| Scheduled Task/Job: Scheduled Task | T1053.005 | Write-up · Detection · Code |
| Impair Defenses: Disable UAC | T1562.001 | Write-up · Detection · Code |
| Impair Defenses: Disable UAC Prompt | T1562.001 | Write-up · Detection · Code |
| Data Encrypted for Impact | T1486 | Write-up · Detection · Code |
| Impair Defenses: Terminate Processes | T1562.001 | Write-up · Detection · Code |
| Service Stop | T1489 | Write-up · Detection · Code |
| Inhibit System Recovery | T1490 | Write-up · Detection · Code |
| Network Share Discovery | T1135 | Write-up · Detection · Code |
| Abuse Elevation Control: Bypass UAC (CMSTPLUA) | T1548.002 | Code coming soon |
| Defacement: Internal Defacement | T1491.001 | Covered in this write-up |
See the full project matrix on the ATT&CK coverage page.
HKCU\SOFTWARE\MDSLK\Self created — the single most specific indicator in this entire
chain. There is no legitimate reason for this key to exist; alert on it outright.EnableLUA or ConsentPromptBehaviorAdmin set to 0 — rare, high-impact, and almost
always malicious outside of deliberate admin action.%APPDATA%\svhost.exe — note the missing c; svchost.exe
should only ever live in System32.schtasks.exe, particularly one
repeating every 15 minutes and pointing into %APPDATA%. Watch for the Task Scheduler
operational log rather than process creation, since no schtasks.exe will appear.vssadmin Delete Shadows, wbadmin delete catalog, bcdedit /set {default} recoveryenabled No
— any one of these deserves an alert; all three in sequence is a confirmed ransomware
detonation.Per-technique detection rules and queries — with Sysmon, Defender and audit log screenshots — are published alongside each recreated TTP in the table above.
Hash (SHA-256)
26af2222204fca27c0fdabf9eefbfdb638a8a9322b297119f85cce3c708090f0
Host artefacts
HKCU\SOFTWARE\MDSLK\Self infection marker (defacement)
%APPDATA%\svhost.exe persistence copy
Scheduled task repeating every 15 minutes persistence, created via COM API
HKLM\...\Policies\System\EnableLUA = 0 UAC disabled
HKLM\...\Policies\System\ConsentPromptBehaviorAdmin = 0
HTML ransom note contains the RSA-encrypted AES key
⚠️ The sample in this repository is live ransomware, stored in an archive with the password
infected. Detonate only inside an isolated, network-controlled VM with no access to production data or network shares — this family actively looks for SMB shares. See SECURITY.md.
The artifacts, code and analysis in this repository are provided strictly for educational and research purposes. I do not condone or support any malicious use of this material.