Back to reports
criticalAPT

Lazarus Group Caught Running Medusa Ransomware: XOR-Decoded Config Exposes Tor C2, IME-Based Loader, and a 7-Month Intrusion Timeline

PublishedMarch 12, 2026
Threat Actors:APT38APT45ProfileAssessmentTimeline
aptdll-sideloadingc2ransomwaresupply-chain

TL;DR: Two malware samples from the same Hungarian incident responder link the Lazarus Group (DPRK) to the Medusa ransomware operation. Sample 1 (gaze.exe) is a fully functional Medusa ransomware binary whose XOR-encoded config (key 0x2E) yields four Tor .onion C2 addresses, a victim-specific negotiation endpoint, and a kill list targeting 50+ enterprise security and backup services. Sample 2 (TSMSISrv.dll) is a DLL sideloading loader built on the Windows 8 IME SDK with custom AES S-box tables, dual TLS anti-analysis callbacks, and COM hijacking persistence via the SessionEnv service. The 7-month gap between loader compilation (March 2025) and ransomware compilation (October 2025) maps a patient intrusion chain -- persistent access first, extortion second -- and confirms DPRK operators are now working as Medusa RaaS affiliates.


Why This Matters

Lazarus Group has historically deployed its own ransomware families -- Maui, H0lyGh0st, and WannaCry. This investigation provides the first concrete evidence of Lazarus operating as an affiliate of the Medusa ransomware-as-a-service program, a commercially operated extortion platform attributed to the cybercrime group "Spearwing." The PDB path G:\Medusa\Release\gaze.pdb embedded in the ransomware binary confirms it was compiled from a Medusa builder toolkit, not developed in-house. North Korea's cyber operations have officially entered the affiliate economy.

The two samples were submitted to MalwareBazaar within two weeks of each other by the same researcher (smica83, Hungary), strongly indicating they were recovered from the same compromised network. Together they reveal a complete intrusion chain: initial access and persistence via DLL sideloading, followed by ransomware deployment months later for financial extortion.

The Attack Chain

INITIAL ACCESS           PERSISTENCE              EXECUTION                 IMPACT
     |                       |                        |                       |
  Spearphish/           TSMSISrv.dll            TLS Callbacks           gaze.exe
  Supply Chain ---->  DLL Sideloading ---->    AES Decrypt C2 ---->   Medusa Ransomware
     |              (SessionEnv svc)         Beacon/Download          |
     |                   |                        |               Kill 50+ services
     |              COM Hijack               Payload staging      Delete shadow copies
     |              (DllGetClassObject)           |               Encrypt 10,000+ files
     |                   |                        |               Drop !!!READ_ME_MEDUSA
     |              Registry keys            Download gaze.exe    Tor negotiation

The compilation timestamps tell the story. The loader was built in March 2025; the ransomware was built in October 2025. That is a 7-month dwell time between establishing persistent access and pulling the trigger on encryption -- a tempo consistent with Lazarus's documented patience in high-value intrusions.

Sample 1: gaze.exe -- Medusa Ransomware

PropertyValue
SHA-25615208030eda48b3786f7d85d756d2bd6596ef0f465d9c8509a8f02c53fad9a10
MD560aaafce354ae5e0b8115729464a8b24
Size638,976 bytes
Architecturex86 (32-bit)
CompilerMSVC (VS2019 v16.7+, linker 14.27)
Compiled2025-10-17 13:48:31 UTC
PDB PathG:\Medusa\Release\gaze.pdb
Entropy6.6986
Imphash82a8292007e682f1a127ba8dcebfae96
DetectionClamAV Win.Ransomware.Medusa-10025438-0, Kaspersky Trojan-Ransom.Win64.Agent.sb

XOR-Encoded Configuration (Key: 0x2E)

The entire operational configuration lives at file offset 0x87600-0x89C00, XOR-encoded with the single-byte key 0x2E. Decoding reveals:

  1. Ransom note text -- the full Medusa extortion message threatening publication on Telegram, Facebook, Twitter, and "top news websites"
  2. Four Tor .onion addresses -- three blog mirrors and one victim-specific negotiation endpoint
  3. Tox Chat ID -- alternative communication channel for the victim
  4. RSA-2048 public key -- embedded in PEM format, used to wrap per-file AES keys
  5. Service kill list -- 50+ Windows services to stop before encryption
  6. Shadow copy commands -- vssadmin Delete Shadows /all /quiet
  7. Network drive flag -- :use networkdrive (encrypts mapped shares)
  8. PowerShell execution -- powershell -executionpolicy bypass -File %s

Encryption Scheme

The ransomware uses a standard hybrid encryption model implemented through the Windows BCrypt API:

  • BCryptImportKeyPair -- imports the embedded RSA-2048 public key
  • BCryptGenerateSymmetricKey -- generates a unique AES key per file
  • BCryptEncrypt -- encrypts file contents with AES
  • The AES key is then RSA-wrapped and appended to the encrypted file

Without the operator's RSA private key, decryption is mathematically infeasible.

Service and Process Kill Lists

Before encrypting a single file, the ransomware systematically dismantles the victim's defenses and backup infrastructure:

# Security products killed
Sophos MCS Client       Sophos File Scanner      Sophos AutoUpdate
Sophos Safestore        Sophos Health             Sophos Web Control
McAfeeFramework         McAfeeEngineService       EPSecurityService
SepMasterService        Symantec System           TrueKeyService

# Backup services killed
VeeamCatalogSvc         VeeamHvIntegration        VeeamTransportSvc
VeeamEnterprise         Veeam Backup Catalog      BackupExecVSSPro
BackupExecJobEngine     BackupExecManage          BackupExecDevice
BackupExecRPCService    BackupExecAgent           Acronis VSS Provider

# Database services killed
SQLAgent$ECWDB2         MSSQLFDLauncher           MSSQL$VEEAMSQL20
MSSQL$SHAREPOINT        MSSQL$SQLEXPRESS          MSSQL$PRACTTICEBG
MSSQLServerADHelper     MSSQLServerOLAPS          OracleClientCache

Sandbox analysis (Triage, CAPE, ANY.RUN) confirmed:

  • 10,129+ files renamed with the Medusa extension
  • Active Setup persistence via Boot/Logon Autostart registry keys
  • Browser credential store access (Chrome, Firefox)
  • Windows Credential Manager access
  • Network share enumeration and encryption
  • ping localhost used as a timing/anti-sandbox technique

Decoded Tor Infrastructure

AddressPurpose
hxxp://xfv4jzckytb4g3ckwemcny3ihv4i5p4lqzdpi624cxisu35my5fwi5qd[.]onion/Medusa leak blog
hxxp://7aqabivkwmpvjkyefonf3gpy5gsubopqni7kcirsrq3pflckxq5zz4id[.]onion/Leak blog mirror
hxxp://s7lmmhlt3iwnwirxvgjidl6omcblvw2rg75txjfduy73kx5brlmiulad[.]onion/Leak blog mirror
hxxp://uyku4o2yg34ekvjtszg6gu7cvjzm6hyszhtu7c55iyuzhpr4k5knewyd[.]onion/00b4f860f1798b62b3531f1b4e8bb6e0Victim negotiation chat

The victim-specific endpoint embeds the unique identifier 00b4f860f1798b62b3531f1b4e8bb6e0, confirming this build was compiled for a specific target. The Tox Chat ID (AEA72DFCF492037A6D15755A74645C7D8E674E342BACA9F9070A3FB74117EC3143FD6E29BEAC) provides an alternative negotiation channel.

Sample 2: TSMSISrv.dll -- Lazarus IME-Based Loader

PropertyValue
SHA-256aeebcd8c8b15645d7e71b68ac05e21e9a4c94f832c64044725d870b87b9573c7
MD5447557d5236f1b97be0314b317ca9fff
Size828,416 bytes
Architecturex64 (64-bit)
CompilerMSVC (VS2022 v17.3+, linker 14.33)
Compiled2025-03-20 18:42:02 UTC
PDB PathNone (stripped)
Entropy5.8867
Imphash655221b6bcad7b5b0b9766142cbc257a
DetectionKaspersky Trojan.Win64.Lazarus.ey, ReversingLabs Win64.Trojan.Lazarus

The Sideloading Vector

The DLL replaces TSMSISrv.dll (Terminal Services MSI Server), a legitimate Windows system component loaded by svchost.exe via the SessionEnv service (Terminal Services Session Configuration). Since SessionEnv starts automatically at boot and loads the DLL as SYSTEM, replacing it provides persistent, privileged code execution that survives reboots without touching the registry run keys that EDR products monitor.

IME SDK Camouflage

The binary is built on top of the Windows 8 IME SDK sample ("SampleIME -- Simplified Chinese QuanPin Input Method"). The version info is a direct copy:

CompanyName:      MSFT
FileDescription:  The Sample code of Windows 8 IME
FileVersion:      1.0.0.1
InternalName:     SampleIM.dll
OriginalFilename: SampleIM.dll
ProductName:      SampleIME

RTTI class names confirm the IME codebase: CSampleIME, CBaseDictionaryEngine, CCompositionProcessorEngine, CKeyStateComposing, CTipCandidateList. The operator embedded their malicious payload inside a fully functional input method editor, which serves dual purposes: it provides a large volume of benign code to dilute static analysis signatures, and the IME's COM registration mechanism provides a natural vehicle for persistence.

Export Table: Real Code vs. Stub Decoys

ExportOrdinalAnalysis
DllCanUnloadNow1Real -- checks COM reference count
DllGetClassObject2Payload entry -- COM class factory
DllRegisterServer3Payload trigger -- calls 3 internal functions
DllUnregisterServer4Cleanup chain
OnSessionChange5Stub -- returns immediately (ret)
Refresh6Stub -- returns immediately
StartComponent7Stub -- returns immediately
StopComponent8Initialization code

The stub exports exist solely to satisfy the export table expected by the legitimate DLL loading mechanism. The real malicious functionality lives in the COM lifecycle exports -- DllGetClassObject (executed when any COM client requests the hijacked CLSID) and DllRegisterServer (executed during installation to establish persistence).

Dual TLS Anti-Analysis Callbacks

Two TLS callbacks execute before DllMain, a technique that defeats debuggers whose entry-point breakpoints fire too late:

  • Callback 0 (RVA 0x20a70): Checks flags in the TEB/PEB, likely detecting debugger attachment or sandbox indicators
  • Callback 1 (RVA 0x208e0): Complex initialization that accesses PEB structures and performs conditional operations based on process state

TLS callbacks are a documented Lazarus evasion technique observed across multiple tool families including SIGNBT and LightlessCan.

Custom AES Implementation

AES forward S-box lookup tables are located at file offset 0x72000-0x74000 (8,192 bytes), comprising a complete custom AES implementation that bypasses Windows CryptoAPI and BCrypt entirely. This is consistent with Lazarus Group's well-documented preference for rolling their own cryptography in C2 communication rather than relying on OS APIs that can be hooked for inspection.

The tables include forward S-box, inverse S-box, round constants, and pre-computed MixColumns lookup tables -- everything needed for standalone AES encrypt/decrypt operations against embedded C2 configuration and runtime communications.

COM Hijacking Persistence

The DLL registers itself as a COM in-process server using CLSID\%s\InProcServer32 registry paths with ThreadingModel set to Apartment. Once registered via DllRegisterServer, any COM client requesting the hijacked CLSID will load the malicious DLL -- providing persistence that blends with normal Windows COM operations.

Two Build Environments, One Campaign

The two samples were compiled with different toolchains on different architectures:

Attributegaze.exe (Ransomware)TSMSISrv.dll (Loader)
Architecturex86 (32-bit)x64 (64-bit)
CompilerVS2019 v16.7+VS2022 v17.3+
Compiled2025-10-172025-03-20
PDBRetained (G:\Medusa\Release\gaze.pdb)Stripped
Entropy6.70 (higher)5.89 (lower)
CryptoBCrypt API (Windows native)Custom AES (S-box tables)

The differences suggest either separate developer teams within the Lazarus organization or, more likely, the ransomware was produced by the Medusa builder toolkit (explaining the VS2019/x86 profile and retained PDB path) while the loader was developed in-house by Lazarus operators (VS2022/x64, stripped PDB, custom crypto). This is exactly the pattern you would expect from a RaaS affiliate model: the operator brings their own access tools, the ransomware comes from the service provider.

Attribution Assessment

Confidence: HIGH -- Lazarus Group (DPRK), likely Andariel (APT45) or BlueNoroff sub-group.

The attribution chain:

  1. Kaspersky signature: Trojan.Win64.Lazarus.ey -- Kaspersky's Lazarus-specific detection family
  2. ReversingLabs signature: Win64.Trojan.Lazarus -- independent corroboration
  3. DLL sideloading via Windows service: consistent with SIGNBT, LightlessCan, and COPPERHEDGE
  4. Custom AES implementation: a Lazarus hallmark across multiple tool families
  5. IME SDK code base: using legitimate SDK samples as trojan shells is a documented Lazarus technique
  6. TLS callback anti-analysis: standard Lazarus evasion across their toolkit
  7. Months-long dwell time: March-to-October gap matches Lazarus patient intrusion methodology
  8. Reporter history: smica83 has a track record of APT sample submissions, including Korean-language Lazarus .scr files

OPSEC Failures

The operators left several forensic artifacts intact:

  • PDB path: G:\Medusa\Release\gaze.pdb reveals the project name, build configuration, and drive letter
  • Compilation timestamps: Both samples have plausible, unmodified timestamps
  • Rich headers: Build environment fingerprints not stripped from either sample
  • Version info: TSMSISrv.dll retains the unmodified Windows 8 IME SDK version strings
  • Same reporter: Both samples submitted by one researcher within two weeks -- confirming recovery from a single victim network

Campaign Timeline

DateEvent
2025-03-20TSMSISrv.dll compiled (VS2022, x64) -- loader deployed
2025-06-30TSMSISrv.dll first observed by ReversingLabs
2025-08-13TSMSISrv.dll first observed by Kaspersky
2025-10-17gaze.exe compiled (VS2019, x86) -- ransomware built for target
2025-10-19gaze.exe first observed by Kaspersky and ANY.RUN
2026-02-12TSMSISrv.dll submitted to MalwareBazaar by smica83
2026-02-26gaze.exe submitted to MalwareBazaar by smica83

The 14-day gap between submissions suggests the incident responder found the loader first during forensic analysis, then discovered the ransomware component during deeper investigation.

MITRE ATT&CK Mapping

TacticTechniqueIDImplementation
ExecutionShared ModulesT1129COM DLL loading via DllGetClassObject
ExecutionPowerShellT1059.001powershell -executionpolicy bypass -File %s
PersistenceDLL Side-LoadingT1574.002TSMSISrv.dll replacing Terminal Services component
PersistenceCOM HijackingT1546.015CLSID registration via DllRegisterServer
PersistenceActive SetupT1547.014Boot/Logon Autostart registry keys
Defense EvasionMasqueradingT1036.005TSMSISrv.dll masquerades as Windows system DLL
Defense EvasionObfuscated FilesT1027.002XOR encoding (key 0x2E) of config block
Defense EvasionDebugger EvasionT1622Dual TLS callbacks before DllMain
Defense EvasionImpair DefensesT1562.001Kills 50+ security services
Credential AccessCredentials from Password StoresT1555Browser and Windows Credential Manager theft
DiscoverySystem Information DiscoveryT1082GetNativeSystemInfo, GetSystemFirmwareTable
DiscoveryNetwork Share DiscoveryT1135GetLogicalDriveStringsW, mapped drive enumeration
ImpactData Encrypted for ImpactT1486RSA+AES hybrid file encryption
ImpactInhibit System RecoveryT1490vssadmin Delete Shadows /all /quiet
ImpactService StopT1489net stop, taskkill against backup/security services

Indicators of Compromise

File Indicators -- gaze.exe (Medusa Ransomware)

Hash TypeValue
SHA-25615208030eda48b3786f7d85d756d2bd6596ef0f465d9c8509a8f02c53fad9a10
MD560aaafce354ae5e0b8115729464a8b24
SHA-153948d9596ebab5c4cf2ac04e7fb70c429e0cbbf
Imphash82a8292007e682f1a127ba8dcebfae96
Rich Hashc8040dd3ff2f4afd042efd4ebe1a43c6
SSDEEP12288:hy+6mXiDDQaBC9WSLe8aHDlglIdLnEAox6Kt7p733WE+jDWFt+Y+ELc2OTWvsIUE:41h5n0SleSPF1i9gs/GS6eRMUsWWPs8l

File Indicators -- TSMSISrv.dll (Lazarus Loader)

Hash TypeValue
SHA-256aeebcd8c8b15645d7e71b68ac05e21e9a4c94f832c64044725d870b87b9573c7
MD5447557d5236f1b97be0314b317ca9fff
SHA-128978e987bc59e75ca22562924eab93355cf679e
Imphash655221b6bcad7b5b0b9766142cbc257a
Rich Hash3be2401da21dfed104c9aa52bb620344
SSDEEP12288:oWujjXB8pkTnyDjVBRxQ1UdiG/Mclbvc/Z:oWujFl2JFQ1Udi2MKc/Z

Behavioral Indicators

PDB Path:           G:\Medusa\Release\gaze.pdb
Ransom Note:        !!!READ_ME_MEDUSA
XOR Key:            0x2E
DLL Target:         TSMSISrv.dll
Service Target:     SessionEnv (Terminal Services Session Configuration)
Original Filename:  SampleIM.dll
Version String:     The Sample code of Windows 8 IME
COM Registration:   CLSID\%s\InProcServer32
Victim ID:          00b4f860f1798b62b3531f1b4e8bb6e0
Tox ID:             AEA72DFCF492037A6D15755A74645C7D8E674E342BACA9F9070A3FB74117EC3143FD6E29BEAC

Network Indicators (Defanged)

hxxp://xfv4jzckytb4g3ckwemcny3ihv4i5p4lqzdpi624cxisu35my5fwi5qd[.]onion/
hxxp://7aqabivkwmpvjkyefonf3gpy5gsubopqni7kcirsrq3pflckxq5zz4id[.]onion/
hxxp://s7lmmhlt3iwnwirxvgjidl6omcblvw2rg75txjfduy73kx5brlmiulad[.]onion/
hxxp://uyku4o2yg34ekvjtszg6gu7cvjzm6hyszhtu7c55iyuzhpr4k5knewyd[.]onion/00b4f860f1798b62b3531f1b4e8bb6e0
hxxps://utox[.]org/uTox_win64.exe

Commands

vssadmin Delete Shadows /all /quiet
vssadmin resize shadowstorage /for=%s /on=%s /maxsize=401MB
taskkill /F /IM [process]
net stop "%s" /y
powershell -executionpolicy bypass -File %s
powershell -Command "& {%s}"

Detection Opportunities

YARA Rules

rule Lazarus_Medusa_Gaze_Ransomware {
    meta:
        description = "Detects Lazarus-deployed Medusa ransomware (gaze.exe) via PDB path and XOR config"
        author = "Breakglass Intelligence"
        date = "2026-03-09"
        tlp = "TLP:CLEAR"
        severity = "CRITICAL"
        reference = "https://intel.breakglass.tech"
    strings:
        $pdb = "G:\\Medusa\\Release\\gaze.pdb" ascii
        $ransom_note = "!!!READ_ME_MEDUSA" ascii wide
        $xor_key = { 2E }
        $shadow1 = "vssadmin Delete Shadows" ascii wide nocase
        $shadow2 = "vssadmin resize shadowstorage" ascii wide nocase
        $bcrypt1 = "BCryptImportKeyPair" ascii
        $bcrypt2 = "BCryptGenerateSymmetricKey" ascii
        $bcrypt3 = "BCryptEncrypt" ascii
        $svc1 = "Sophos" ascii wide
        $svc2 = "Veeam" ascii wide
        $svc3 = "McAfee" ascii wide
        $svc4 = "BackupExec" ascii wide
    condition:
        uint16(0) == 0x5A4D and
        ($pdb or $ransom_note) and
        1 of ($shadow*) and
        2 of ($bcrypt*) and
        2 of ($svc*)
}

rule Lazarus_TSMSISrv_IME_Loader {
    meta:
        description = "Detects Lazarus IME SDK-based DLL sideloading loader (TSMSISrv.dll)"
        author = "Breakglass Intelligence"
        date = "2026-03-09"
        tlp = "TLP:CLEAR"
        severity = "HIGH"
        reference = "https://intel.breakglass.tech"
    strings:
        $ime1 = "SampleIME" ascii wide
        $ime2 = "The Sample code of Windows 8 IME" ascii wide
        $ime3 = "SampleIM.dll" ascii wide
        $exp1 = "OnSessionChange" ascii
        $exp2 = "StartComponent" ascii
        $exp3 = "StopComponent" ascii
        $exp4 = "DllRegisterServer" ascii
        $rtti1 = "CSampleIME" ascii
        $rtti2 = "CCompositionProcessorEngine" ascii
        $msft = "MSFT" ascii wide
    condition:
        uint16(0) == 0x5A4D and
        uint16(0x18) != 0x0040 and  // Not a .NET assembly
        2 of ($ime*) and
        3 of ($exp*) and
        1 of ($rtti*) and
        filesize > 500KB and filesize < 2MB
}

rule Lazarus_Medusa_Campaign_Config {
    meta:
        description = "Detects XOR-encoded Medusa configuration block with Tor onion addresses"
        author = "Breakglass Intelligence"
        date = "2026-03-09"
        tlp = "TLP:CLEAR"
        severity = "HIGH"
    strings:
        $onion1_xor = { 56 42 5A 4E 66 4A 44 5B }  // "xfv4jzck" XOR 0x2E
        $tox_marker = "AEA72DFCF492037A6D15755A74645C7D" ascii
        $victim_id = "00b4f860f1798b62b3531f1b4e8bb6e0" ascii
    condition:
        uint16(0) == 0x5A4D and
        any of them
}

Network Detection -- Suricata

# Medusa Tor negotiation endpoint (victim-specific hash in URI)
alert http any any -> any any (msg:"LAZARUS-MEDUSA Tor Negotiation Endpoint Pattern"; \
  content:".onion/"; http_uri; content:"00b4f860f1798b62b3531f1b4e8bb6e0"; http_uri; \
  sid:2026030901; rev:1;)

# Medusa ransom note drop detection (file creation)
alert smb any any -> any any (msg:"LAZARUS-MEDUSA Ransom Note Creation"; \
  content:"!!!READ_ME_MEDUSA"; sid:2026030902; rev:1;)

# Shadow copy deletion (common but high-signal in combination)
alert any any any -> any any (msg:"LAZARUS-MEDUSA Shadow Copy Deletion"; \
  content:"vssadmin"; content:"Delete Shadows"; content:"/all"; content:"/quiet"; \
  sid:2026030903; rev:1;)

Hunting Queries

SessionEnv DLL Sideloading (KQL -- Microsoft Defender / Sentinel):

DeviceFileEvents
| where FileName =~ "TSMSISrv.dll"
| where FolderPath !startswith "C:\\Windows\\System32"
| project Timestamp, DeviceName, FolderPath, SHA256, InitiatingProcessFileName

COM Registration Anomalies (KQL):

DeviceRegistryEvents
| where RegistryKey has "InProcServer32"
| where RegistryValueData !startswith "C:\\Windows\\"
| where RegistryValueData !startswith "C:\\Program Files"
| project Timestamp, DeviceName, RegistryKey, RegistryValueData

Imphash Hunting (Splunk):

index=endpoint sourcetype=sysmon EventCode=7
(Imphash="82a8292007e682f1a127ba8dcebfae96" OR Imphash="655221b6bcad7b5b0b9766142cbc257a")
| table _time, host, Image, ImageLoaded, Imphash

Medusa Service Kill Pattern (Sigma-style):

title: Medusa Ransomware Bulk Service Termination
detection:
    selection:
        EventID: 7036
        param1|contains:
            - 'Sophos'
            - 'Veeam'
            - 'BackupExec'
            - 'McAfee'
    timeframe: 5m
    condition: selection | count() > 5

Published by Breakglass Intelligence. Investigation conducted 2026-03-09. 2 MalwareBazaar samples analyzed. Dual-tool Lazarus intrusion chain mapped. Medusa RaaS affiliate model confirmed. Classification: TLP:CLEAR

Share