Matryoshka
- Type
- Backdoor
- Capabilities
- Credential theftExfiltrationPersistencePost exploitationDefense evasionReconnaissanceDLL sideloadingProcess injection
- Delivery
- SpearphishingLure
- Platforms
- Windows
Matryoshka is a name used for Windows remote-access malware, including a Rust-based backdoor family deployed alongside the Go-based HollowFrame loader. The Rust family has two documented variants: an HTTP-based implant supporting remote command execution and additional tooling delivery, and a GitHub-based implant using a private repository for victim-specific beaconing, tasking, command results, file transfer, and secondary payload retrieval. Its reconnaissance functionality includes identifying domain controllers, enumerating domain computers and privileged groups, and collecting network configuration, token privileges, and installed software information.
The Rust backdoors were deployed in a spear-phishing intrusion affecting two endpoints at a law firm. A legal-document lure led recipients to an encrypted archive containing a malicious Windows shortcut, which initiated staged PowerShell execution and payload retrieval. HollowFrame subsequently deployed Matryoshka through DLL sideloading involving a legitimate Microsoft OneDrive updater. The HTTP implant executed operator commands inside the trusted process, while the GitHub implant used a proxy DLL exposing Windows Terminal Services functions. The campaign's operators have not been identified.
The Matryoshka name also identifies the Windows remote-access trojan tracked as S0167. Its documented capabilities include stealing Microsoft Outlook passwords, capturing screenshots, providing Meterpreter shell access, and using reflective DLL injection to execute its malicious library. It can maintain persistence through scheduled tasks and Registry-based logon autostart entries. These older capabilities are distinct from the documented functionality of the Rust backdoor variants.
Associated threat actors
1 distinct threat actor Mallory has associated with this family across public reporting. Open in Mallory to see the full evidence chain and overlapping campaigns.
Techniques & procedures
45 distinct techniques documented for this family, organized by ATT&CK tactic.
Resource Development
1 technique
Resource Development
"The campaign leverages typosquatting domains... observing typosquatted domains like comparisions[.]org, which mimics the legitimate comparisons.org website by adding an extra letter."
Initial Access
1 technique
Initial Access
The chain began with a spear phishing email sent to several staff. A link routed recipients through an attacker-controlled redirector to an encrypted archive hosted on Mega, containing a shortcut file named Case Documents.lnk.
Execution
8 techniques
Execution
Persistence is achieved through scheduled tasks.
[Matryoshka](https://attack.mitre.org/software/S0167) can establish persistence by adding a Scheduled Task named "Microsoft Boost Kernel Optimization".(Citation: ClearSky Wilted Tulip July 2017)(Citation: CopyKittens Nov 2015)
[Matryoshka](https://attack.mitre.org/software/S0167) is capable of providing Meterpreter shell access.(Citation: ClearSky Wilted Tulip July 2017)
Executing it wrote Base64 content to a temporary file, rebuilt a script using the built-in certutil utility, then launched an obfuscated PowerShell chain that prompted the user for administrator rights.
"After successful execution, the loader retrieves an AppleScript payload specifically designed to harvest browser credentials..."
Running it launched a command chain that wrote Base64 content into %TEMP%\sgrfm.b64 , created %TEMP%\sgrfm.cmd...
"When victims paste the malicious Terminal command, it retrieves a shell script..."
The LNK file mimicked to be Case Documents to lure the victim into opening and triggering a command sequence
Persistence
5 techniques
Persistence
Persistence is achieved through scheduled tasks.
[Matryoshka](https://attack.mitre.org/software/S0167) can establish persistence by adding a Scheduled Task named "Microsoft Boost Kernel Optimization".(Citation: ClearSky Wilted Tulip July 2017)(Citation: CopyKittens Nov 2015)
Across the content, malware repeatedly 'adds Registry Run keys', 'creates Registry entries', 'modifies the Windows Registry', or 'overwrites registry keys' to maintain persistence.
[Matryoshka](https://attack.mitre.org/software/S0167) can establish persistence by adding Registry Run keys.(Citation: ClearSky Wilted Tulip July 2017)(Citation: CopyKittens Nov 2015)
A link routed recipients through an attacker-controlled redirector to an encrypted archive hosted on Mega, containing a shortcut file named Case Documents.lnk. Executing it wrote Base64 content to a temporary file, rebuilt a script using the built-in certutil utility, then launched an obfuscated PowerShell chain
Privilege Escalation
8 techniques
Privilege Escalation
Persistence is achieved through scheduled tasks.
[Matryoshka](https://attack.mitre.org/software/S0167) can establish persistence by adding a Scheduled Task named "Microsoft Boost Kernel Optimization".(Citation: ClearSky Wilted Tulip July 2017)(Citation: CopyKittens Nov 2015)
Aria-body has the ability to inject itself into another process such as rundll32.exe and dllhost.exe... BlackEnergy injects its DLL component into svchost.exe... ComRAT has injected its orchestrator DLL into explorer.exe... Stuxnet injects an entire DLL into an existing, newly created, or preselected trusted process.
[Matryoshka](https://attack.mitre.org/software/S0167) uses reflective DLL injection to inject the malicious library and execute the RAT.(Citation: CopyKittens Nov 2015)
Matryoshka ... After downloading the first-stage payload, it runs the second-stage malware via its dropper and installs the real payload. It uses the process hollowing technique to evade defenses.
[Matryoshka](https://attack.mitre.org/software/S0167) can establish persistence by adding Registry Run keys.(Citation: ClearSky Wilted Tulip July 2017)(Citation: CopyKittens Nov 2015)
A link routed recipients through an attacker-controlled redirector to an encrypted archive hosted on Mega, containing a shortcut file named Case Documents.lnk. Executing it wrote Base64 content to a temporary file, rebuilt a script using the built-in certutil utility, then launched an obfuscated PowerShell chain
then launched an obfuscated PowerShell chain that prompted the user for administrator rights. Once elevated, that stage created Defender exclusions
Stealth
10 techniques
Stealth
[Matryoshka](https://attack.mitre.org/software/S0167) obfuscates API function names using a substitute cipher combined with Base64 encoding.(Citation: CopyKittens Nov 2015)
The archive it retrieved was named to resemble an official Python embedded distribution, though the filename read amd96 rather than amd64.
Aria-body has the ability to inject itself into another process such as rundll32.exe and dllhost.exe... BlackEnergy injects its DLL component into svchost.exe... ComRAT has injected its orchestrator DLL into explorer.exe... Stuxnet injects an entire DLL into an existing, newly created, or preselected trusted process.
[Matryoshka](https://attack.mitre.org/software/S0167) uses reflective DLL injection to inject the malicious library and execute the RAT.(Citation: CopyKittens Nov 2015)
Matryoshka ... After downloading the first-stage payload, it runs the second-stage malware via its dropper and installs the real payload. It uses the process hollowing technique to evade defenses.
The campaign distributed malicious activity across scripts, signed binaries, proxy DLLs, and trusted cloud services.
Running it launched a command chain that wrote Base64 content into %TEMP%\sgrfm.b64 , created %TEMP%\sgrfm.cmd , used certutil.exe -decode...
[Matryoshka](https://attack.mitre.org/software/S0167) uses rundll32.exe in a Registry Run key value for execution as part of its persistence mechanism.(Citation: CopyKittens Nov 2015)
"It detaches its main routine to the background and exits quickly... redirects standard input, output, and error streams to suppress visible artifacts in the terminal session."
Cobalt Strike has the ability to load DLLs via reflective injection... Lazarus Group malware sample performs reflective DLL injection... Matryoshka uses reflective DLL injection... Netwalker DLL has been injected reflectively into the memory of a legitimate running process.
Defense Impairment
3 techniques
Defense Impairment
Across the content, malware repeatedly 'adds Registry Run keys', 'creates Registry entries', 'modifies the Windows Registry', or 'overwrites registry keys' to maintain persistence.
Once elevated, that stage created Defender exclusions covering both a staging directory and the process name python.exe
Once elevated, that stage created Defender exclusions covering both a staging directory and the process name python.exe, and only then began downloading executable content.
Credential Access
4 techniques
Credential Access
"then falls back to displaying fake system dialogs that repeatedly request passwords until victims comply."
[Matryoshka](https://attack.mitre.org/software/S0167) is capable of keylogging.(Citation: ClearSky Wilted Tulip July 2017)(Citation: CopyKittens Nov 2015)
[Matryoshka](https://attack.mitre.org/software/S0167) is capable of stealing Outlook passwords.(Citation: ClearSky Wilted Tulip July 2017)(Citation: CopyKittens Nov 2015)
Evilnum can collect email credentials from victims... Malteiro has obtained credentials from mail clients via NirSoft MailPassView... MgBot includes modules for stealing stored credentials from Outlook and Foxmail email client software... PLEAD has the ability to steal saved passwords from Microsoft Outlook.
Discovery
8 techniques
Discovery
and inventory network configuration, local privileges and installed software.
Beyond shell access, the variant could identify domain controllers, enumerate domain computers and privileged group membership
and inventory network configuration, local privileges and installed software.
Beyond shell access, the variant could identify domain controllers, enumerate domain computers and privileged group membership
another leveraging a private GitHub repository for C2 communication, tasking, reconnaissance, and file transfer.
These capabilities could support credential theft, lateral movement, and broader domain compromise
Beyond shell access, the variant could identify domain controllers, enumerate domain computers and privileged group membership
and inventory network configuration, local privileges and installed software.
Collection
4 techniques
Collection
"then falls back to displaying fake system dialogs that repeatedly request passwords until victims comply."
[Matryoshka](https://attack.mitre.org/software/S0167) is capable of keylogging.(Citation: ClearSky Wilted Tulip July 2017)(Citation: CopyKittens Nov 2015)
[Matryoshka](https://attack.mitre.org/software/S0167) is capable of performing screen captures.(Citation: ClearSky Wilted Tulip July 2017)(Citation: CopyKittens Nov 2015)
The intrusion began with a spear phishing chain that delivered an encrypted archive containing a malicious Windows shortcut.
Command and Control
4 techniques
Command and Control
another that uses GitHub for command-and-control (C2), including beaconing, tasking, reconnaissance, file transfer, and secondary payload delivery
Each victim was assigned a directory in a private repository holding beacon, command and result files, giving the operator tasking and file transfer without a custom C2 server.
[Matryoshka](https://attack.mitre.org/software/S0167) uses DNS for C2.(Citation: ClearSky Wilted Tulip July 2017)(Citation: CopyKittens Nov 2015)
Each victim was assigned a directory in a private repository holding beacon, command and result files, giving the operator tasking and file transfer without a custom C2 server.
Exfiltration
1 technique
Exfiltration
uses a private GitHub repository for polling target-specific commands, submitting results, and fetching payloads
Observables
7 indicators attributed across vendor reports, sandbox runs, and researcher write-ups. Values are masked here and available in full in Mallory.
Recent activity
33 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.