Samurai is a Windows backdoor associated with the ToddyCat espionage cluster. It has been used alongside tools such as China Chopper to establish and maintain access on compromised enterprise systems, including intrusions involving Microsoft Exchange exploitation. The malware supports modular post-compromise operations, including compiling and executing downloaded modules at runtime, which helps it adapt functionality on victim hosts and reduce static exposure of payloads. Its loader establishes persistence by creating and modifying Windows service and Registry configuration so that the final backdoor is loaded through svchost.exe, and it has also been observed storing staged components in directories chosen to blend with legitimate system software.
Samurai performs host discovery by checking for the presence and version of the .NET Framework and querying Registry data relevant to the runtime environment. For command and control, it uses web-protocol communications and can Base64-encode data before encryption. It also employs defense-evasion measures such as XOR-based obfuscation of API name strings and other obfuscation techniques noted in ATT&CK mappings. A proxy module allows the malware to forward TCP connections to remote hosts, enabling pivoting or concealed communications through the compromised machine.
Available reporting supports classifying Samurai primarily as a backdoor used in targeted espionage operations. It is notable for persistence through Windows services and Registry modification, modular runtime extension, and proxying capability rather than for commodity crimeware-style mass distribution.
1 CVE Mallory has correlated with this family across public research and vendor advisories. Each card links to the full Mallory page for that vulnerability.
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.
23 distinct techniques documented for this family, organized by ATT&CK tactic.
[Samurai](https://attack.mitre.org/software/S1099) can use a remote command module for execution via the Windows command line.(Citation: Kaspersky ToddyCat June 2022)
[Samurai](https://attack.mitre.org/software/S1099) has the ability to call Windows APIs.(Citation: Kaspersky ToddyCat June 2022)
BlackCat has the ability to add the following registry key on compromised networks to maintain persistence: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Paramenters
The [Samurai](https://attack.mitre.org/software/S1099) loader component can create multiple Registry keys to force the svchost.exe process to load the final backdoor.(Citation: Kaspersky ToddyCat June 2022)
[Samurai](https://attack.mitre.org/software/S1099) can create a service at `HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SvcHost` to trigger execution and maintain persistence.(Citation: Kaspersky ToddyCat June 2022)
[Samurai](https://attack.mitre.org/software/S1099) can create a service at `HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SvcHost` to trigger execution and maintain persistence.(Citation: Kaspersky ToddyCat June 2022)
[Samurai](https://attack.mitre.org/software/S1099) can encrypt the names of requested APIs.(Citation: Kaspersky ToddyCat June 2022)
[Samurai](https://attack.mitre.org/software/S1099) can compile and execute downloaded modules at runtime.(Citation: Kaspersky ToddyCat June 2022)
[Samurai](https://attack.mitre.org/software/S1099) can encrypt API name strings with an XOR-based algorithm.(Citation: Kaspersky ToddyCat June 2022)
Ninja ... Obfuscated Files or Information: Compression; ... Samurai ... Obfuscated Files or Information: Compression
[Samurai](https://attack.mitre.org/software/S1099) can deliver its final payload as a compressed, encrypted and base64-encoded blob.(Citation: Kaspersky ToddyCat June 2022)
During the 2016 Ukraine Electric Power Attack, DLLs and EXEs with filenames associated with common electric power sector protocols were used to masquerade files.
[Samurai](https://attack.mitre.org/software/S1099) has created the directory `%COMMONPROGRAMFILES%\Microsoft Shared\wmi\` to contain DLLs for loading successive stages.(Citation: Kaspersky ToddyCat June 2022)
BlackCat has the ability to add the following registry key on compromised networks to maintain persistence: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Paramenters
The [Samurai](https://attack.mitre.org/software/S1099) loader component can create multiple Registry keys to force the svchost.exe process to load the final backdoor.(Citation: Kaspersky ToddyCat June 2022)
[Samurai](https://attack.mitre.org/software/S1099) can query `SOFTWARE\Microsoft\.NETFramework\policy\v2.0` for discovery.(Citation: Kaspersky ToddyCat June 2022)
[Samurai](https://attack.mitre.org/software/S1099) can use a specific module for file enumeration.(Citation: Kaspersky ToddyCat June 2022)
[Samurai](https://attack.mitre.org/software/S1099) can check for the presence and version of the .NET framework.(Citation: Kaspersky ToddyCat June 2022)
[Samurai](https://attack.mitre.org/software/S1099) can leverage an exfiltration module to download arbitrary files from compromised machines.(Citation: Kaspersky ToddyCat June 2022)
[Samurai](https://attack.mitre.org/software/S1099) can use a .NET HTTPListener class to receive and handle HTTP POST requests.(Citation: Kaspersky ToddyCat June 2022)
[Samurai](https://attack.mitre.org/software/S1099) has the ability to proxy connections to specified remote IPs and ports through a a proxy module.(Citation: Kaspersky ToddyCat June 2022)
[Samurai](https://attack.mitre.org/software/S1099) can use a proxy module to forward TCP packets to external hosts.(Citation: Kaspersky ToddyCat June 2022)
[Samurai](https://attack.mitre.org/software/S1099) has been used to deploy other malware including [Ninja](https://attack.mitre.org/software/S1100).(Citation: Kaspersky ToddyCat June 2022)
C2 traffic from ADVSTORESHELL is encrypted, then encoded with Base64 encoding... APT19 HTTP malware variant used Base64 to encode communications to the C2 server... APT33 has used base64 to encode command and control traffic.
[Samurai](https://attack.mitre.org/software/S1099) can base64 encode data sent in C2 communications prior to its encryption.(Citation: Kaspersky ToddyCat June 2022)
[Samurai](https://attack.mitre.org/software/S1099) can encrypt C2 communications with AES.(Citation: Kaspersky ToddyCat June 2022)
23 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.