
"Reverse engineering analysis of a fileless Remcos RAT variant that injects into svchost.exe via Native API calls. Covers obfuscated payload extraction, registry persistence, clipboard monitoring, API hooking, and UAC bypass techniques."
The following Binary Ninja snippet reveals the core injection mechanism used by Remcos to inject its payload into svchost.exe.
CreateProcessW with the CREATE_SUSPENDED flag starts a new svchost process in a suspended state.VirtualAlloc allocates memory inside the target process using MEM_COMMIT and PAGE_READWRITE flags, allowing the payload to be written directly into the process memory.WriteProcessMemory writes the payload into the allocated memory region of the suspended svchost process.ReadProcessMemory reads the target process's memory, likely to retrieve the original entry point or to validate the injection.TerminateProcess is used to terminate the suspended svchost process if the injection fails, preventing it from being left in an unstable state.
Binary Ninja view of Remcos' injection routine using Native APIs, showing MEM_COMMIT, PAGE_READWRITE, ReadProcessMemory, and TerminateProcess.
Remcos adds a key to the Windows registry to establish a permanent presence on the system. This key ensures the malware re-executes every time the system starts up.
HKEY_USERS\S-1-5-21-3807688912-2840792520-522192237-1001\Software\kamolprf-CFKPWC
exepath value is stored as REG_BINARY, it cannot be read directly. This makes detection more difficult. - Identity: The UID and licence values allow the attacker to identify the victim and perform a license check.time value provides information about when the malware was installed or last executed.
*Registry keys and the exepath, licence, time, and UID values within them.
The following WinDbg snippet shows a trampoline function found inside the injected svchost.exe process. This code appears to be part of Remcos' API hooking or payload execution mechanism.
jmp qword ptr [svchost+0x9758] – Likely a hook or trampoline jumping to an API or function.mov / movdqa instructions – Save and restore registers (xmm0-xmm3, rcx, rdx, r8, r9) to preserve the calling context.call svchost+0x3e50 – Calls a core function, possibly part of the payload or hook handler.jmp rax – Final jump to the original function or next stage.INT3 traps – Anti-debugging instructions to break execution if a debugger is attached.This structure is typical of API hooking or detour functions, where Remcos intercepts calls to critical Windows APIs. The use of xmm registers (for floating-point or SIMD operations) suggests this hook may be placed on functions that use SSE instructions.
WinDbg view of the trampoline function inside svchost.exe, showing jmp and call instructions with INT3 traps.
The following hex dump was extracted from a PAGE_READWRITE memory region inside the injected svchost.exe process. This region does not contain any direct call or jmp instructions, confirming that the data is not executable code but rather an obfuscated or encrypted payload.
RPC Control and PC- are embedded within the data.ctk, m, and mafasakaaam appear to be part of a structured configuration, possibly containing encryption keys, API names, or registry paths.
Binary Ninja view of the obfuscated hex dump from svchost.exe's PAGE_READWRITE region, showing embedded strings like RPC Control and PC-.
The obfuscated hex payload extracted from the PAGE_READWRITE region was further analyzed using Binary Ninja's string view. Despite the heavy obfuscation, several readable strings and patterns emerged.
PC- prefixed strings (e.g., PC-475ce3d749612b, PC-4a757962f31b84) – Likely MachineGuid or unique system identifiers used for victim tracking.svchost.exe – The target process name, confirming the injection vector..dll extensions – Indicate that Remcos either loads or searches for specific DLLs, possibly for API hooking or persistence.ontroll\ – Likely a fragment of a registry path (Control\), indicating persistence or configuration storage.EEF931 and 1AA81C6FD0CF04A816B – These appear to be GUIDs or encryption keys, possibly used for XOR/AES decryption of the payload.TEMP – Suggests temporary file creation or execution from the temp directory.
Binary Ninja strings view of the obfuscated hex payload, showing readable fragments like PC-, svchost.exe, .dll, and EEF931.
This analysis uncovered a highly sophisticated, fileless variant of Remcos RAT that operates with minimal disk footprint and advanced evasion techniques. The malware injects its core payload into svchost.exe using Native API calls such as ZwCreateSection and ZwMapViewOfSection, ensuring persistence and stealth.
PC-, svchost.exe, .dll, and EEF931.HKEY_USERS\...\Software\kamolprf-CFKPWC, storing encrypted exepath, licence, time, and UID values.svchost.exe for abnormal memory regions (PAGE_READWRITE).Software\kamolprf-CFKPWC.ZwCreateSection and ZwMapViewOfSection calls originating from non-system processes.PC- and EEF931.This Remcos variant demonstrates a high level of professionalism and is clearly designed to evade traditional security solutions. Its combination of fileless execution, process injection, and registry-based persistence makes it a significant threat that requires advanced detection strategies.
Tools Used: Ghidra, Binary Ninja, WinDbg, Process Hacker
The analyzed Remcos RAT sample is available on MalwareBazaar for those who wish to conduct their own analysis:
| API | Purpose in Remcos |
|---|
| CreateProcessW | Starts svchost in a suspended state for injection. |
| VirtualAlloc | Allocates memory with MEM_COMMIT and PAGE_READWRITE for the payload. |
| WriteProcessMemory | Writes the payload into the allocated memory. |
| ReadProcessMemory | Reads target process memory (used for validation or entry point retrieval). |
| TerminateProcess | Terminates the suspended process if injection fails. |
| Value Name | Type | Value | Description |
|---|
| exepath | REG_BINARY | Encrypted binary data | The encrypted file path of Remcos or its injected payload. Likely protected via XOR or AES. |
| licence | REG_SZ | DA8E22D4CD8D349953DF1FAD364CAB05 | Remcos license key. May be a fixed value in pirated or demo versions. |
| time | REG_DWORD | 0x6a53ac27 (1783868455) | Installation or last execution time in Unix timestamp format. |
| UID | REG_DWORD | 0xfeb60bd4 (4273343444) | Unique user ID. Used to identify the victim. |