Mafalda
- Type
- Backdoor
- Capabilities
- Credential theftExfiltrationPost exploitationDefense evasionReconnaissance
- Platforms
- Windows
Mafalda is a feature-rich Windows backdoor used by Metador in espionage operations targeting telecommunications providers, internet service providers, and universities, primarily in the Middle East and Africa. It is an interactive implant supporting more than 60 commands for remote execution, host reconnaissance, data collection, and exfiltration. Observed deployment chains use metaMain to decrypt and load Mafalda into memory, with the Microsoft Console Debugger involved in the broader execution chain. Metador has no established country attribution.
Mafalda can execute Windows shell and PowerShell commands, enumerate and modify the Windows Registry, identify users, and discover files, processes, storage, network configuration, connections, and installed software. It searches for security products, EDR systems, and malware-analysis tools. Collection capabilities include screenshots, input capture, local files, browser information, credentials from LSASS memory, and cryptographic keys, including Chrome key material used to protect cookies. It supports access-token creation and impersonation, local data staging, file transfer, and exfiltration over command-and-control channels. Communications use HTTP and raw TCP, with symmetric encryption and Base64 encoding. Mafalda also supports internal proxying and port-knocking mechanisms and can receive data collected from Linux systems by a separate implant.
Observed versions show continued development, with the command set expanding from 54 to 67 commands. Newer variants employ extensive obfuscation and anti-analysis protections. Mafalda can also clear Windows Event Logs to remove operational traces.
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.
(Citation: SentinelLabs Metador Sept 2022)(Citation: SentinelLabs Metador Technical Appendix Sept 2022)
Techniques & procedures
54 distinct techniques documented for this family, organized by ATT&CK tactic.
Resource Development
1 technique
Resource Development
Adversaries may buy, steal, or download malware that can be used during targeting.
Initial Access
1 technique
Initial Access
[Mafalda](https://attack.mitre.org/software/S1060) can establish an SSH connection from a compromised host to a server.(Citation: SentinelLabs Metador Technical Appendix Sept 2022)
Execution
5 techniques
Execution
metaMain... provides operators with extensive functionality... and the ability to execute arbitrary shellcode. ... The functionalities of the backdoor commands have a very broad scope and include credential theft, data and information theft, command execution...
[Mafalda](https://attack.mitre.org/software/S1060) can execute PowerShell commands on a compromised machine.(Citation: SentinelLabs Metador Technical Appendix Sept 2022)
[Mafalda](https://attack.mitre.org/software/S1060) can execute shell commands using `cmd.exe`.(Citation: SentinelLabs Metador Technical Appendix Sept 2022)
[Mafalda](https://attack.mitre.org/software/S1060) can use a variety of API calls.(Citation: SentinelLabs Metador Sept 2022)
[Mafalda](https://attack.mitre.org/software/S1060) can create a remote service, let it run once, and then delete it.(Citation: SentinelLabs Metador Technical Appendix Sept 2022)
Persistence
4 techniques
Persistence
[Mafalda](https://attack.mitre.org/software/S1060) can manipulate the system registry on a compromised host.(Citation: SentinelLabs Metador Technical Appendix Sept 2022)
[Mafalda](https://attack.mitre.org/software/S1060) can establish an SSH connection from a compromised host to a server.(Citation: SentinelLabs Metador Technical Appendix Sept 2022)
[Mafalda](https://attack.mitre.org/software/S1060) can use port-knocking to authenticate itself to another implant called Cryshell to establish an indirect connection to the C2 server.(Citation: SentinelLabs Metador Sept 2022)(Citation: SentinelLabs Metador Technical Appendix Sept 2022)
In this case, metaMain’s persistence relies on the abuse of WMI Event Subscriptions. The operators register an event consumer named hard_disk_stat. Five to six minutes after booting up, the event triggers the execution of a LOLbin, cdb.exe.
Privilege Escalation
4 techniques
Privilege Escalation
[Mafalda](https://attack.mitre.org/software/S1060) can use `AdjustTokenPrivileges()` to elevate privileges.(Citation: SentinelLabs Metador Technical Appendix Sept 2022)
Mafalda ... Access Token Manipulation: Make and Impersonate Token, Access Token Manipulation
[Mafalda](https://attack.mitre.org/software/S1060) can create a token for a different user.(Citation: SentinelLabs Metador Technical Appendix Sept 2022)
In this case, metaMain’s persistence relies on the abuse of WMI Event Subscriptions. The operators register an event consumer named hard_disk_stat. Five to six minutes after booting up, the event triggers the execution of a LOLbin, cdb.exe.
Stealth
9 techniques
Stealth
The content repeatedly describes payloads, strings, configuration files, scripts, URLs, and binaries being obfuscated or encoded using Base64, XOR, RC4, AES, RSA, hex encoding, custom algorithms, and other methods across many malware families and threat actors.
[Mafalda](https://attack.mitre.org/software/S1060) has been obfuscated and contains encrypted functions.(Citation: SentinelLabs Metador Sept 2022)
[Mafalda](https://attack.mitre.org/software/S1060) can use `AdjustTokenPrivileges()` to elevate privileges.(Citation: SentinelLabs Metador Technical Appendix Sept 2022)
Mafalda ... Access Token Manipulation: Make and Impersonate Token, Access Token Manipulation
[Mafalda](https://attack.mitre.org/software/S1060) can create a token for a different user.(Citation: SentinelLabs Metador Technical Appendix Sept 2022)
[Mafalda](https://attack.mitre.org/software/S1060) can decrypt files and data.(Citation: SentinelLabs Metador Sept 2022)
[Mafalda](https://attack.mitre.org/software/S1060) can use port-knocking to authenticate itself to another implant called Cryshell to establish an indirect connection to the C2 server.(Citation: SentinelLabs Metador Sept 2022)(Citation: SentinelLabs Metador Technical Appendix Sept 2022)
Among them, we noticed the use of an unusual LOLbin, the Microsoft Console Debugger cdb.exe. CDB was the root of an intricate infection chain that would yield two in-memory malware platforms... The attackers used the following command line: cdb.exe -cf c:\windows\system32\cdb.ini c:\windows\system32\defrag.exe -module fcache13.db
[Mafalda](https://attack.mitre.org/software/S1060) can search for debugging tools on a compromised host.(Citation: SentinelLabs Metador Technical Appendix Sept 2022)
Defense Impairment
3 techniques
Defense Impairment
[Mafalda](https://attack.mitre.org/software/S1060) can manipulate the system registry on a compromised host.(Citation: SentinelLabs Metador Technical Appendix Sept 2022)
The functionalities of the backdoor commands have a very broad scope and include credential theft, data and information theft, command execution, system registry and file system manipulation, and Mafalda reconfiguration.
[Mafalda](https://attack.mitre.org/software/S1060) can delete Windows Event logs by invoking the `OpenEventLogW` and `ClearEventLogW` functions.(Citation: SentinelLabs Metador Sept 2022)
Credential Access
5 techniques
Credential Access
Some of the more interesting commands only available in the newer Mafalda variant include: The functionalities of the backdoor commands have a very broad scope and include credential theft...
[Mafalda](https://attack.mitre.org/software/S1060) can dump password hashes from `LSASS.exe`.(Citation: SentinelLabs Metador Technical Appendix Sept 2022)
[Mafalda](https://attack.mitre.org/software/S1060) can conduct mouse event logging.(Citation: SentinelLabs Metador Technical Appendix Sept 2022)
[Mafalda](https://attack.mitre.org/software/S1060) can collect a Chrome encryption key used to protect browser cookies.(Citation: SentinelLabs Metador Sept 2022)
Mafalda can collect a Chrome encryption key used to protect browser cookies. Volt Typhoon has accessed a Local State file that contains the AES key used to encrypt passwords stored in the Chrome browser.
Discovery
13 techniques
Discovery
[Mafalda](https://attack.mitre.org/software/S1060) can enumerate Registry keys with all subkeys and values.(Citation: SentinelLabs Metador Technical Appendix Sept 2022)
[Mafalda](https://attack.mitre.org/software/S1060) can use the `GetAdaptersInfo` function to retrieve information about network adapters and the `GetIpNetTable` function to retrieve the IPv4 to physical network address mapping table.(Citation: SentinelLabs Metador Sept 2022)
[Mafalda](https://attack.mitre.org/software/S1060) can collect the username from a compromised host.(Citation: SentinelLabs Metador Technical Appendix Sept 2022)
[Mafalda](https://attack.mitre.org/software/S1060) can use the <code>GetExtendedTcpTable</code> function to retrieve information about established TCP connections.(Citation: SentinelLabs Metador Sept 2022)
[Mafalda](https://attack.mitre.org/software/S1060) can enumerate running processes on a machine.(Citation: SentinelLabs Metador Sept 2022)
[Mafalda](https://attack.mitre.org/software/S1060) can collect the computer name of a compromised host.(Citation: SentinelLabs Metador Sept 2022)(Citation: SentinelLabs Metador Technical Appendix Sept 2022)
[Mafalda](https://attack.mitre.org/software/S1060) can search for files and directories.(Citation: SentinelLabs Metador Sept 2022)
"Babuk can enumerate disk volumes, get disk information"; "Ryuk has called GetLogicalDrives ... and GetDriveTypeW"; "Cuba can enumerate local drives, disk type, and disk free space"; "Chimera ... fsutil fsinfo drives"
[Mafalda](https://attack.mitre.org/software/S1060) can collect the contents of the `%USERPROFILE%\AppData\Local\Google\Chrome\User Data\LocalState` file.(Citation: SentinelLabs Metador Sept 2022)
[Mafalda](https://attack.mitre.org/software/S1060) can search for a variety of security software programs, EDR systems, and malware analysis tools.(Citation: SentinelLabs Metador Sept 2022)(Citation: SentinelLabs Metador Technical Appendix Sept 2022)
Mafalda ... Local Storage Discovery
[Mafalda](https://attack.mitre.org/software/S1060) can search for debugging tools on a compromised host.(Citation: SentinelLabs Metador Technical Appendix Sept 2022)
[Mafalda](https://attack.mitre.org/software/S1060) can enumerate all drives on a compromised host.(Citation: SentinelLabs Metador Sept 2022)(Citation: SentinelLabs Metador Technical Appendix Sept 2022)
Lateral Movement
1 technique
Lateral Movement
Sandworm Team installed a modified Dropbear SSH client as a backdoor; Sandworm used Dropbear SSH with a hardcoded backdoor password to maintain persistence; Linux Rabbit attempts to gain access via SSH; Mafalda can establish an SSH connection from a compromised host to a server; Sea Turtle used external-facing SSH for initial access.
Collection
7 techniques
Collection
[Mafalda](https://attack.mitre.org/software/S1060) can collect files and information from a compromised host.(Citation: SentinelLabs Metador Sept 2022)
Mafalda also supports retrieval of data from Linux machines with another implant that sends data to the C2 as part of a packet with a name prefixed with loot_linux\.
[Mafalda](https://attack.mitre.org/software/S1060) can conduct mouse event logging.(Citation: SentinelLabs Metador Technical Appendix Sept 2022)
The content repeatedly describes adversaries and malware storing collected data, command output, credentials, archives, or files in local temporary folders, working directories, hidden directories, registry locations, recycle bins, or specific files prior to exfiltration.
[Mafalda](https://attack.mitre.org/software/S1060) can place retrieved files into a destination directory.(Citation: SentinelLabs Metador Sept 2022)
[Mafalda](https://attack.mitre.org/software/S1060) can take a screenshot of the target machine and save it to a file.(Citation: SentinelLabs Metador Sept 2022)
BabyShark has encoded data using certutil before exfiltration... KONNI has used a custom base64 key to encode stolen data before exfiltration... Mafalda can encode data using Base64 prior to exfiltration.
Command and Control
10 techniques
Command and Control
That IP is utilized for command-and-control over either HTTP (metaMain, Mafalda) or raw TCP (Mafalda).
[Mafalda](https://attack.mitre.org/software/S1060) can use HTTP for C2.(Citation: SentinelLabs Metador Sept 2022)
‘Cryshell’– a custom implant used for bouncing connections in an internal network to external command-and-control servers... When the TCP KNOCK communication method is enabled, the metaMain and Mafalda implants can establish an indirect connection to the C2 server through another implant.
[Mafalda](https://attack.mitre.org/software/S1060) can create a named pipe to listen for and send data to a named pipe-based C2 server.(Citation: SentinelLabs Metador Technical Appendix Sept 2022)
[Mafalda](https://attack.mitre.org/software/S1060) can use raw TCP for C2.(Citation: SentinelLabs Metador Sept 2022)
[Mafalda](https://attack.mitre.org/software/S1060) can download additional files onto the compromised host.(Citation: SentinelLabs Metador Technical Appendix Sept 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.
[Mafalda](https://attack.mitre.org/software/S1060) can encode data using Base64 prior to exfiltration.(Citation: SentinelLabs Metador Technical Appendix Sept 2022)
[Mafalda](https://attack.mitre.org/software/S1060) can use port-knocking to authenticate itself to another implant called Cryshell to establish an indirect connection to the C2 server.(Citation: SentinelLabs Metador Sept 2022)(Citation: SentinelLabs Metador Technical Appendix Sept 2022)
[Mafalda](https://attack.mitre.org/software/S1060) can encrypt its C2 traffic with RC4.(Citation: SentinelLabs Metador Sept 2022)
Exfiltration
1 technique
Exfiltration
[Mafalda](https://attack.mitre.org/software/S1060) can send network system data and files to its C2 server.(Citation: SentinelLabs Metador Sept 2022)
Observables
2 indicators attributed across vendor reports, sandbox runs, and researcher write-ups. Values are masked here and available in full in Mallory.
Recent activity
51 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.