The backdoor that bites, the commands that catch

ESET Research’s continuous monitoring of FamousSparrow has resulted in new findings. In our previous public report on FamousSparrow, we revealed that this APT group aligned with China had developed two new versions of its custom backdoor named SparrowDoor. However, we have now discovered that FamousSparrow has shifted to a new backdoor called SparroWocky, which has been deployed in several countries in Latin America since at least August 2025.

In response to increased US interest in Latin America, FamousSparrow intensified its targeting of the region in July 2025. Subsequently, the group began utilizing the SparroWocky backdoor a month later, replacing SparrowDoor as its primary implant.

SparroWocky is a modular, C++ backdoor known for its advanced anti-analysis techniques and deep understanding of Windows internals. The backdoor was named SparroWocky due to its initial samples containing the first stanza of Jabberwocky, a poem by Lewis Carroll. Despite its complexity, SparroWocky’s inner workings are comprehensible, allowing us to conduct a detailed analysis of the backdoor.

Key points from the blogpost:

  • FamousSparrow is primarily targeting governmental organizations in Latin America.
  • Since August 2025, the group has been transitioning from SparrowDoor to the new custom C++ backdoor, SparroWocky.
  • With the adoption of SparroWocky, FamousSparrow has started integrating code from open-source projects directly into its malware.
  • SparroWocky is a sophisticated backdoor that manipulates low-level memory structures and dynamically patches code to evade detection.
  • SparroWocky can load and execute Beacon Object Files, which are supported by various red-teaming and penetration-testing tools.

FamousSparrow, a China-aligned cyberespionage group, has been active since at least 2019. Initially known for targeting hotels worldwide, the group has also focused on governments, international organizations, trade groups, engineering companies, and law firms. FamousSparrow exclusively utilizes the SparrowDoor backdoor.

Our analysis of SparrowDoor versions in a 2025 blogpost also discussed the group’s attribution claims. According to Trend Micro, FamousSparrow is associated with Earth Estries, although the exact nature of this connection remains unclear. Additionally, FamousSparrow has been linked to Salt Typhoon, albeit as distinct entities due to the absence of specific technical indicators.

Based on our investigation, we confidently attribute the latest campaign and the SparroWocky backdoor to FamousSparrow. The deployment of SparroWocky by FamousSparrow-exclusive SparrowDoor in initial attacks, coupled with matching victimology, reinforces our attribution.

Latin America Targeted

FamousSparrow’s current focus on high-profile targets in Latin America began in July 2025 and has continued with the introduction of SparroWocky. From mid-2025 to 2026, 90% of the group’s targets in our telemetry have been located in the region. Figure 1 illustrates the deployment of the new backdoor against governmental entities in various Latin American countries.

SparroWocky_Victimology-map
Figure 1. Victimology of SparroWocky

This strategic shift likely stems from China’s response to heightened US initiatives in Latin America. FamousSparrow’s operations in the region may serve to monitor and anticipate local governments’ reactions to US pressures, especially amid commercial disputes and geopolitical tensions.

While the group’s emphasis on Latin America may be temporary, driven by current circumstances, it remains unclear if this geographical focus represents a long-term mandate.

Analysis of SparroWocky

SparroWocky, a comprehensive C++ backdoor, prioritizes modularity and stealth. Its emergence coincided with FamousSparrow’s shift towards Latin America, supplanting SparrowDoor as the group’s primary implant. Notably, SparroWocky is a distinct malware family, not a variant of SparrowDoor.

The integration of open-source tools directly into SparroWocky marks a significant evolution in FamousSparrow’s tactics. The backdoor’s functionalities include executing files, acting as a TCP proxy, running commands, gathering system information, exfiltrating files, and capturing screenshots.

The exfiltrated data undergoes encryption using RC4 and is transmitted through the TLS protocol.

SparroWocky can establish persistence by either creating a dedicated service or an entry in a registry Run key, depending on its configuration.

Loader

SparroWocky utilizes the common trident loader scheme, which involves a legitimate executable, a malicious DLL posing as a required DLL for the executable, and a file containing an encrypted payload (refer to Figure 2). The loader is housed within the malicious DLL and is activated through DLL side-loading. FamousSparrow has been observed using various side-loading targets, typically a modified version of the legitimate DLL that the executable is meant to load. This modified DLL retains most of the original file content, with only a part of the .text section replaced by malicious code, and the entry point header adjusted to point within this altered region.

SparroWocky_Trident-loader-scheme
Figure 2. Trident loader scheme

This technique aids in defense evasion as the metadata and exported function list of the malicious DLL match those of the legitimate version, allowing it to blend in seamlessly. The mismatch between the patched code and the original functions in the untouched portion can hinder automated analysis tools in identifying function boundaries.

The primary function of the loader is to decrypt and extract the payload from a file. These files, typically named similarly to the executable but with a .dat extension, follow a specific structure outlined in Figure 3. The file begins with a custom header featuring a four-byte magic value (0x11328712), followed by the sizes of the configuration data and payload, and a 16-byte RC4 key. This RC4 key decrypts the remainder of the file, containing the configuration for SparroWocky (described in the Configuration section) and the backdoor itself. A decryption script for SparroWocky payload files is available in our GitHub repository.

Figure 3. Definition of the structure of SparroWocky’s payload file
Figure 3. Definition of the structure of SparroWocky’s payload file

The plaintext backdoor payload is formatted as a portable executable (PE) file with the MZ and PE magic values removed. This executable payload is directly mapped into memory without being written to disk, potentially as an evasion tactic against in-memory defense mechanisms that rely on simple pattern recognition to detect or dump suspicious memory sections.

SparroWocky

Our analysis of SparroWocky is primarily based on a sample compiled on November 17th, 2025, as indicated by its PE timestamp (SHA-1: 44F0A22B143B79FA760BF31E14C8FFF714C8A2A1). The version of this backdoor is presumed to be 1.8, deduced from the information retrieved through its fingerprint command detailed in Table 3.

The name SparroWocky was chosen due to the presence of the first stanza of Lewis Caroll’s Jabberwocky in several samples. This stanza likely originates from the test vectors in RFC 7539, defining the ChaCha20-Poly1305 encryption algorithm. While SparroWocky includes other strings used as test vectors in the RFC, it does not employ ChaCha20-Poly1305. The test vectors were present in versions of Mbed TLS preceding 4.0.0, although the specific version used in the backdoor remains unknown.

Notably, SparroWocky utilizes various public projects, including Mbed TLS for secure communication with its C&C server, MinHook for Windows API hooking to conceal thread start addresses, and COFF Loader (or a similar project) for dynamic loading and execution of in-memory plugins in COFF object format.

Our analysis also uncovered evasion techniques implemented by the developers, such as a variant of SilentMoonwalk (or StackMoonwalk) to obfuscate call stacks from MinHook routines and a custom API hashing algorithm for dynamic resolution of Windows API functions. Further details on these techniques are discussed in the Anti-analysis techniques section.

Configuration

The SparroWocky loader decrypts its configuration from the payload .dat file in the same directory, as elaborated in the Loader section. The RC4 key from the payload header decrypts the configuration, presented as a tab-separated string that is parsed and stored in a structured format. Table 1 outlines the configuration fields and their corresponding values.

Table 1. SparroWocky configuration

Field Value Additional details
C&C IP address 216.238.110[.]120  
C&C port number 443  
Connection retry delay (in seconds) 10 After the first retry, the value is randomized.
Proxy connection type 0 0: If enabled, use the system-configured proxy; else, connect directly.
1: HTTP proxy with Negotiate or Basic authentication.
2: SOCKS5 proxy with Basic authentication or no authentication.
Proxy IP address N/A  
Proxy port number N/A  
Proxy username N/A  
Proxy password N/A  
Persistence method 1 1: Service persistence.
2: Registry persistence.
Service persistence: service name ProcAuditManager The display name matches the service name in the extracted configurations. These typically correspond to the filename of the payload file.
Service persistence: display name ProcAuditManager
Service persistence: service description Tracks process creation, termination, and related system audit events.
Registry persistence: registry value SnapCart
Registry persistence: registry key SOFTWARE\Microsoft\Windows\CurrentVersion\Run Uses HKLM or HKCU depending on privileges.

Capabilities

Argument-controlled behavior

Upon analyzing its configuration, the backdoor scrutinizes the command line of the process it is currently running in and exhibits varied behavior based on the number and content of the arguments provided. If no arguments are detected, SparroWocky proceeds to establish persistence and execute the core operations of the backdoor. Conversely, if arguments are present, the first argument’s value dictates specific actions for the malware to undertake, as outlined in Table 2.

Table 2. SparroWocky command line arguments and their interpretations

Argument Behavior Description
c Load and execute a PE file in memory for a specified amount of time before termination. In conjunction with command 0x16*, SparroWocky reads a command string, an execution timeout delay, and the body of a PE file from standard input (stdin). It then loads the specified executable into memory and executes it with the given command.
p Sleep for five seconds, set up persistence, and run the core logic of the backdoor.
s Run the core logic of the backdoor without establishing persistence. In association with command 0x2F*, this argument also signifies that the backdoor was executed as a specific user (via CreateProcessAsUser), identified by a session ID obtained through command 0x2E*.
s2 Initiate a new instance of the backdoor with argument p and terminate. This argument indicates that the backdoor was launched using the service persistence.
t Set the process working directory to the backdoor location and run the core logic of the backdoor.

* Further elaborated in the Backdoor commands section.

When SparroWocky is executed with the c option, it retrieves an additional comma-separated series of parameters from standard input (stdin):

  • a command string,
  • a timeout delay (in seconds), and
  • optionally, the body of a PE file.

In the absence of the last parameter, the backdoor loads the executable specified in the command string from C:\Windows\System32\ and loads the corresponding English MUI (Multilingual User Interface) file (from C:\Windows\System32\en-US\). Refer to the Host process camouflage for dynamically loaded PEs section for a detailed explanation. Alternatively, the PE file is executed by SparroWocky’s reflective loader, with the command string passed as a command line. This functionality likely facilitates the backdoor’s ability to execute system utilities effortlessly.

SparroWocky loads the specified executable into memory and executes it with the provided command. Simultaneously, the backdoor initiates a new thread that invokes ExitProcess to terminate the process when the timeout delay expires. The loading process entails setting up hooks and manipulating structures in memory to disguise the host process before running the target executable. These evasion techniques are further elucidated in the dedicated Host process camouflage for dynamically loaded PEs section.

Furthermore, when the malware is executed without arguments or with the p option, an instance synchronization mechanism is activated. This functionality prevents multiple instances of the backdoor from running concurrently by leveraging a custom interprocess communication (IPC) mechanism. Upon launching a new instance, the existing instance halts, and if the new instance originates from a different location than the current one, the files and persistence configurations established by the current instance are erased. This mechanism utilizes three global objects: a mutex, an event, and a shared memory block named MyMutexName, MyEventName, and MySharedMemName, respectively.

Backdoor commands

Upon establishing communication with its C&C server, the backdoor executes its core operations in a continuous loop, processing received commands. These commands are managed by a customized class named WinHandler (derived from a ServerHandler custom class) based on the runtime type information (RTTI) present in the malware. Basic commands are hardcoded within the command loop, while ServerHandler features a specialized virtual method for handling additional commands. This method is implemented in WinHandler, offering flexibility for developers to modify the range of commands the backdoor can process. The list of supported commands is detailed in Table 3.

Table 3.

The code then manages the routing of traffic between the remote machine and the C&C server. SparroWocky redirects calls to external libraries in the BOF to a stack-spoofing subroutine, effectively hiding and proxying calls made by the BOF object. Once the object is loaded, the BOF loader finds and executes the function_name, passing the arguments provided in function_arguments. This ability allows FamousSparrow to utilize existing modules and tools designed to work with this file type.

Self-deletion
As described in the Argument-controlled behavior section, SparroWocky can delete itself entirely from the system. This can be done from the C&C server via command 0x13. First, the persistence mechanism previously set is removed, and then the batch file shown in Figure 4 is created and executed.

@echo off
timeout /t 2
del “” /f /q
del “” /f /q
del “” /f /q
del “%0” /f /q

Figure 4. Batch file for self-deletion

This batch file deletes the files used by the backdoor: the legitimate executable, the side-loading library, and the payload file. The batch file deletes itself at the end of the script.

Anti-analysis techniques
SparroWocky employs various techniques to complicate its analysis and evade security software. One technique it uses is dynamic API resolution via API hashing, but it also utilizes more interesting methods, as described below.

SilentMoonwalk
The first notable technique utilized by SparroWocky is SilentMoonwalk, which enables the forging of fake call stacks. This technique prevents analysis tools from inspecting the true caller of specific functions, such as Windows API functions. It involves finding the offset of RtlUserThreadStart and BaseThreadInitThunk, locating JOP and ROP gadgets in kernel32.dll, and manipulating the call stack to disguise the origin of API function calls. This technique is used to obfuscate calls made by BOF-formatted plugins or by the MinHook hooking library.

Concealing the thread start address
SparroWocky leverages the MinHook library to conceal the original lpStartAddress parameter of threads it creates, making them appear as if they start from a legitimate Windows API function like AnimateWindow. The AnimateWindow API is patched to execute the original start address, creating a trampoline that masks the true origin of the thread.

Host process camouflage for dynamically loaded PEs
SparroWocky includes a custom PE loader with host process camouflage capabilities, allowing it to load and execute PE files with enhanced stealth. When executed with the c option, SparroWocky loads a PE file in memory and sets hooks to redirect calls to resource data retrieval functions. It also forges an LDR_DATA_TABLE_ENTRY structure in the PEB_LDR_DATA structure to mirror normal Windows behavior when loading PEs and reduce the risk of detection by security products. Additionally, SparroWocky registers exception handlers for the loaded executable, ensuring correct exception handling. SparroWocky engineers create an LDR_DATA_TABLE_ENTRY structure. This demonstrates their in-depth knowledge of the Windows PE loading mechanism and their willingness to use advanced techniques to disguise the host process and confuse monitoring tools. For any inquiries about this service, please refer to the ESET Threat Intelligence page.

Introducing SparroWocky: The Versatile Backdoor

SparroWocky is a sophisticated backdoor that can adapt to various tasks, making it a versatile threat in the cyber landscape. Let’s explore some of its key capabilities:

ID Arguments Description
0x10 N/A Gather and send system information:
· MD5 hash of the machine GUID,
· SparroWocky PID,
· hostname,
· IP addresses of all network interfaces,
· username,
· Windows product name,
· backdoor version (1.8),
· x64 (likely backdoor architecture),
· domain name,
· SparroWocky’s host file path,
· connection retry delay, and
· self-deletion enable state (0 or 1).
0x11* N/A Initiate a new interactive session.
Establish a connection to the C&C server, send an initial packet with byte sequence 44 33 22 11 (hex), and start processing commands in a separate thread.
0x12 N/A End process using ExitProcess.
0x13 N/A Remove persistence then end process using ExitProcess.
0x14 <function_name>
<BOF_object>
<function_arguments>
Load Beacon Object File in memory, call <function_name> with <function_arguments> as parameters, and send completion status.
Refer to additional details below.
0x16 <command_line>
<execution_timeout>
<PE_file>
Execute provided PE file by creating a new SparroWocky process with parameter c and redirecting standard I/O and error streams to pipe \\.\pipe\ccpipe. Write arguments to new process’s stdin, read output, and send to C&C server.
0x17 <command> Execute <command> by running cmd.exe with standard I/O and error streams redirected to two anonymous pipes.
0x1A* <IP_address>
<port>
Connect to provided IP address (via TCP/IP), create a thread to forward traffic between remote machine and C&C server, and send completion status to C&C server.
0x1B String of semicolon-separated values starting with two unknown values followed by IP address and port number for listening Internally named PortmapReverseServer, accept TCP connections and forward traffic to C&C server.
For each accepted connection, establish new connection to C&C server, send initial packet with byte sequence 13 12 11 09 (hex), then send machine GUID, received arguments, and list of connections opened so far.

Technique ID Technique Description
T1070.004 Indicator Removal: File Deletion SparroWocky can delete itself from the compromised machine.
T1070.009 Indicator Removal: Clear Persistence SparroWocky can remove its persistence mechanism from the compromised machine.
T1036.001 Masquerading: Invalid Code Signature The SparroWocky loader keeps the now invalid signature of the legitimate module it is impersonating.
T1036.004 Masquerading: Masquerade Task or Service SparroWocky uses legitimate or generic names and descriptions for its persistence service.
Discovery
T1083 File and Directory Discovery SparroWocky can list files and directories on mapped drives.
T1680 Local Storage Discovery SparroWocky can retrieve information about mapped storage devices.
T1082 System Information Discovery SparroWocky can collect information about the system it is running on, such as the Windows version, hostname, and the IP addresses of network interfaces.
T1033 System Owner/User Discovery SparroWocky can retrieve the username of the current user and of any user with an active session.
T1120 Peripheral Device Discovery SparroWocky can retrieve information about connected display devices.
Collection
T1005 Data from Local System SparroWocky can exfiltrate files from mapped storage.
T1113 Screen Capture SparroWocky can periodically capture screenshots.
Command and Control
T1573.002 Encrypted Channel: Asymmetric Cryptography SparroWocky uses TLS, which uses asymmetric cryptography in its handshake.
T1573.001 Encrypted Channel: Symmetric Cryptography SparroWocky uses RC4 to encrypt the information it exfiltrates.
T1090.001 Proxy: Internal Proxy SparroWocky can proxy connections between the C&C server and another remote machine.
T1090.002 Proxy: External Proxy SparroWocky can use an HTTP or SOCKS5 proxy to connect to its C&C server.
T1095 Non-Application Layer Protocol SparroWocky uses TLS over TCP to communicate with its C&C server.
Exfiltration
T1041 Exfiltration Over C2 Channel SparroWocky exfiltrates data through the same connection used to receive commands from the C&C server.

sentence to make it more concise:

“Jack went to the store to buy some groceries.”

“Jack went grocery shopping.” Please rewrite the sentence for me to help you. sentence: The cat sat lazily in the sunbeam on the window sill.

The lazy cat lounged in the sunlight on the windowsill.

Leave a Reply

Your email address will not be published. Required fields are marked *