Brute Ratel C4
- Type
- Backdoor
- Capabilities
- Post exploitationDefense evasionReconnaissanceLateral movementDLL sideloadingProcess injection
- Delivery
- PhishingMalspamLure
- Platforms
- Windows
Brute Ratel C4, also known as BRC4, is a commercial adversary-emulation and post-exploitation framework released by Chetan Nayak in 2020 for authorized penetration testing and red-team operations. It is also abused by cybercriminal and espionage actors. Its Windows-focused architecture comprises Badger implants, Ratel Server, and the Commander client. Badgers provide remote command execution and support in-memory payload execution, reconnaissance, proxying, pivoting, and lateral movement.
The framework supports HTTPS and DNS-over-HTTPS communications, configurable request and response profiles, runtime profile switching, and adjustable sleep and jitter. Its evasion features include detection of EDR userland hooks and changes to in-memory execution behavior. Observed deployments have used encrypted shellcode, anti-debugging checks, process injection, and DLL search order hijacking through legitimate applications. Some variants protect embedded payloads and configurations with RC4 encryption and dynamically derived keys.
Malicious distribution has included resume-themed ISO lures and second-stage delivery by Qakbot, BumbleBee, and Latrodectus. In documented Qakbot intrusions associated with Black Basta operators, Brute Ratel performed domain reconnaissance, ran SharpHound within an injected process to collect Active Directory information, and preceded Cobalt Strike deployment for further lateral movement. The China-nexus intrusion set Earth Lamia has also deployed Brute Ratel using encrypted shellcode loaders and DLL sideloading. Criminal use includes attacks against financial institutions and ransomware-related intrusions. Brute Ratel is not itself ransomware or an exploit-development framework; attackers use its remote-access and post-exploitation functionality to support subsequent operations.
Associated vulnerabilities
3 CVEs Mallory has correlated with this family across public research and vendor advisories. Each card links to the full Mallory page for that vulnerability.
Associated threat actors
32 distinct threat actors Mallory has associated with this family across public reporting. Open in Mallory to see the full evidence chain and overlapping campaigns.
We also found another DLL sideloading loader used by Earth Lamia to execute Brute Ratel shellcode.
Recently, our Unit 42 incident response team was engaged in a Black Basta breach response that uncovered several tools and malware samples on the victim's machines, including GootLoader malware, Brute Ratel C4 red-teaming tool and an older PlugX malware sample.
Threat actors spread malicious ISOs... The in-memory code, Brute Ratel C4, starts to communicate with IP 174.129.157[.]251 on TCP port 443... The threat actors can remotely access the infected device once the Brute Ratel has been loaded in order to run commands and spread farther throughout the compromised network.
References https://medium.com/@knownsec404team/the-patchwork-group-has-updated-its-arsenal-launching-attacks-for-the-first-time-using-brute-ratel-175741987d87
On 20 September 2024, Proofpoint researchers identified a campaign delivering Brute Ratel C4 and Latrodectus.
On 20 September 2024, Proofpoint researchers identified a campaign delivering Brute Ratel C4 and Latrodectus.
+26 more in the app. View in Mallory
Techniques & procedures
92 distinct techniques documented for this family, organized by ATT&CK tactic.
Reconnaissance
2 techniques
Reconnaissance
These hashes empower server clustering, identification of unique and similar servers, and the pursuit of malicious actors with heightened confidence.
HTTP-Basma’s algorithm's core idea centers on sending 8 specially crafted HTTP requests with varying requirements to elicit different responses from the server.
Resource Development
2 techniques
Resource Development
Malvertising and SEO Poisoning: Victims searching tax-related content are redirected to download malicious JavaScript files like Document-16-32-50.js.
Malvertising and SEO Poisoning: Victims searching tax-related content are redirected to download malicious JavaScript files like Document-16-32-50.js.
Initial Access
3 techniques
Initial Access
Unauthenticated threat actors may exploit the vulnerability to upload malicious executable binaries, leading to a compromise of the host system.
Most of Nobelium campaigns against diplomatic entities use compromised legitimate email accounts belonging to diplomatic staff, and conduct phishing campaigns against diplomatic institutions, embassies and consulates.
recent campaigns using Brutal Rater have exploited fake Microsoft OneDrive installers encapsulated in .iso files to minimise detection by antivirus software.
Execution
14 techniques
Execution
The content repeatedly describes threat actors and malware using WMI/WMIC/wmiexec for remote execution, lateral movement, discovery, persistence, and administrative actions; e.g., 'APT41 used WMI in several ways, including for execution of commands via WMIEXEC as well as for persistence via PowerSploit' and 'Scattered Spider used Windows Management Instrumentation (WMI) to move laterally via Impacket.'
The shellcode-based loader is stored onboard and is loaded into memory. The shellcode stager uses a few Anti Debugging checks such as checking the NtGlobalFlag.
This dialog box includes instructions that appear to describe how to “fix” the problem, but will either: automatically copy and paste a malicious script into the PowerShell terminal, or the Windows Run dialog box, to eventually run a malicious script via PowerShell.
Upon clicking Roshan-Bandara_CV_Dialog, cmd[.]exe is launched: /c start OneDriveUpdater[.]exe
UKM301.bat relaunches itself hidden via a VBS helper... then delete themselves and the VBS files.
Each ZIP contains Python 3.12 x64 (embedded runtime) and five Kramer-obfuscated .py payloads.
LUNAR SPIDER’s recent campaign used Latrodectus, a heavily obfuscated JavaScript loader, to deliver Brute Ratel C4 payloads targeting the financial sector.
The malicious version.dll file has an embedded unencrypted shellcode in its .data section that will be copied to an allocated memory address space with the PAGE_EXECUTE_READ protection to then be executed using the callback function of the EnumChildWindows Windows API.
"...deployment of the Brute Ratel C2 framework using inline MSBuild task execution."
When the victim mounts the ISO and executes the onedrive_fotos.exe binary, it will load the maliciously crafted version.dll.
Annotations ID Technique Tactic T1204.001 Malicious Link Execution
Threat actors spread malicious ISOs that appear to include submitted resumes (CV)... the Roshan-Bandara_CV_Dialog resume file is a Windows shortcut that will start the included OneDriveUpdater[.]exe file.
Annotations ID Technique Tactic T1559 Inter-Process Communication Execution
Earth Lamia packages its hacking tools into DLL files to launch them via DLL sideloading.
Persistence
2 techniques
Persistence
Annotations ID Technique Tactic T1543 Create or Modify System Process Persistence
The BRc4 payload modifies the Windows registry, specifically adding an entry under HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run for persistence across reboots.
Privilege Escalation
10 techniques
Privilege Escalation
The QAKBOT malware now running inside an injected process (wermgr.exe)
Process Injection (QAPC, CreateRemoteThread, and CreateSection Techniques)
The simulated code will look for a cmd.exe process and inject shellcode that will execute a calc.exe.
Figure 11 shows the code function that duplicates the token of “winlogon.exe” or “logonui.exe” and uses that token to a new process using CreateProcessWithTokenW API.
Figure 11 shows the code function that duplicates the token of “winlogon.exe” or “logonui.exe” and uses that token to a new process using CreateProcessWithTokenW API.
On another branch, the binary calls the DuplicateTokenEx method in order to duplicate the access token extracted from “winlogon.exe” or “lsass.exe”. Finally, a new process is created using CreateProcessWithTokenW.
BRC4 is also capable of spoofing the parent process (PPID) for its newly created process to evade detections that are based on parent/child process relationships.
Annotations ID Technique Tactic T1543 Create or Modify System Process Persistence
The BRc4 payload modifies the Windows registry, specifically adding an entry under HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run for persistence across reboots.
The executable enables the above privilege via a function call to AdjustTokenPrivileges... 0x1719 ID – Enable SeDebugPrivilege.
Stealth
24 techniques
Stealth
During our analysis we found obfuscations based on scraping, PEB parsing and API hashing on stage 2, 3 and 4.
we have discovered a recent sample of Brute Ratel C4 packed with Themida.
To resolve the pointers of the functions, the program parses the PEB structure and then makes a loop in the name pointer table in IMAGE_EXPORT_DIRECTORY structure. A call on the hashing function is operated for each name in the table to find the correct function for the requested hash.
During the 2016 Ukraine Electric Power Attack, DLLs and EXEs with filenames associated with common electric power sector protocols were used to masquerade files.
Akira has used legitimate names and locations for files to evade defenses.
The QAKBOT malware now running inside an injected process (wermgr.exe)
Process Injection (QAPC, CreateRemoteThread, and CreateSection Techniques)
The simulated code will look for a cmd.exe process and inject shellcode that will execute a calc.exe.
Another interesting feature of the BRC4 DLL agent is that it can evade Event Tracing for Windows (ETW) and AMSI Windows mechanisms by patching known API responsible for generating or tracing system events. Figure 12 shows the code of this DLL agent that patches “EtwEventWrite” API with “0xC3” opcode.
0xE993 ID – Delete files DeleteFileA is used to delete the target files.
"...deployment of the Brute Ratel C2 framework using inline MSBuild task execution."
Figure 11 shows the code function that duplicates the token of “winlogon.exe” or “logonui.exe” and uses that token to a new process using CreateProcessWithTokenW API.
Figure 11 shows the code function that duplicates the token of “winlogon.exe” or “logonui.exe” and uses that token to a new process using CreateProcessWithTokenW API.
On another branch, the binary calls the DuplicateTokenEx method in order to duplicate the access token extracted from “winlogon.exe” or “lsass.exe”. Finally, a new process is created using CreateProcessWithTokenW.
BRC4 is also capable of spoofing the parent process (PPID) for its newly created process to evade detections that are based on parent/child process relationships.
It then uses the restored key to decrypt the rest of the data and has the original Cobalt Strike shellcode execute in memory.
These scripts retrieve an MSI installer, which deploys Brute Ratel C4 (BRc4) by disguising the payload as legitimate software (vierm_soft_x64.dll under rundll32 execution).
An anti-debug technique involving PEB parsing is used to compare the value at PEB+0xbc with 0x70 .
The malware verifies if the token is elevated using the GetTokenInformation method (0x14 = TokenElevation ).
They execute all .py files via the embedded python.exe , hide the payload directories with attrib +h
0x73E6 ID – Argument Spoofing The badger has the ability to hide the arguments by modifying the process environment block (PEB).
Earth Lamia packages its hacking tools into DLL files to launch them via DLL sideloading.
Execute it in memory with the “Assembly.Load” approach.
The shellcode stager uses a few Anti Debugging checks such as checking the NtGlobalFlag.
Defense Impairment
2 techniques
Defense Impairment
0xA905 ID – Copy files... 0x9B84 ID – Move files... 0xE993 ID – Delete files... 0x3F61 ID – Create directories... 0x8F40 ID – Delete directories.
Another interesting feature of the BRC4 DLL agent is that it can evade Event Tracing for Windows (ETW) and AMSI Windows mechanisms by patching known API responsible for generating or tracing system events.
Credential Access
4 techniques
Credential Access
Process minidump
"Credentials were harvested from several sources like LSASS..."; "...dump LSASS using Windows Error Reporting..."
0x0B06 ID – Convert the time of the last input event in minutes... GetLastInputInfo is used to retrieve the time of the last input event.
"Credentials were harvested from several sources like ... browsers"
Discovery
22 techniques
Discovery
Create, start, modify, enumerate and delete services
Enumerate Registries
Figure 14 shows the code snippet of the function that enumerates Address Resolution Protocol (ARP) entries or physical address map table for IPV4 on the local system using the GetIpNetTable Windows API.
BoomBox has the ability to execute an LDAP query to enumerate the distinguished name, SAM account name, and display name for all domain users. IceApple Active Directory Querier module can perform authenticated requests against an Active Directory server. Sandworm Team has used a tool to query Active Directory using LDAP.
Check the active and idle session of the user in the target host
The content repeatedly describes threat actors and malware performing network scanning, port scanning, service enumeration, OS fingerprinting, and identifying open ports/services across victim environments.
Get process information
The badger obtains the TOKEN_PRIVILEGES structure that contains the privileges of the token using GetTokenInformation... It retrieves the name of the privileges represented by a locally unique identifier (LUID) via a function call to LookupPrivilegeNameW.
Brute Ratel C4 can use LDAP queries, net group "Domain Admins" /domain and net user /domain for discovery. OilRig has run net group "domain admins" /domain and net group "Exchange Trusted Subsystem" /domain to get account listings on a victim. Wizard Spider has identified domain admins through the use of net group "Domain admins" /DOMAIN.
Get system information
List files in a directory
The first parameter is compared with “user” and “users”. In the first case, the malware calls the NetUserGetInfo API to obtain information about the user account... In the second case, the agent retrieves information about all user accounts on the local computer.
AdFind can enumerate domain users. APT41 used built-in net commands to enumerate domain administrator users. BloodHound can collect information about domain users, including identification of domain admin accounts.
0x0A01 ID – Compute the number of minutes that have elapsed since the system was started The GetTickCount function is used to extract the number of milliseconds and a simple calculation is performed.
QAKBOT can run nltest /domain_trusts /all_trusts for domain trust discovery.
An anti-debug technique involving PEB parsing is used to compare the value at PEB+0xbc with 0x70 .
The malware verifies if the token is elevated using the GetTokenInformation method (0x14 = TokenElevation ).
List installed software applications in the targeted host
Adversaries may attempt to get a listing of security software, configurations, defensive tools, and sensors that are installed on a system or in a cloud environment.
In this blog, I will explain my hunting methodology with two practical examples... this methodology (JARM and HTTP Response hash) is applicable to both examples and provides great results.
The shellcode stager uses a few Anti Debugging checks such as checking the NtGlobalFlag.
0xC144 ID – Extract all device drivers EnumDeviceDrivers is utilized to obtain the load address for all device drivers... the process retrieves the name of the device driver by calling the GetDeviceDriverBaseNameA method.
Lateral Movement
4 techniques
Lateral Movement
0x699A ID – Create a TCP listener... The badger creates a TCP socket... The bind function is used to associate the local address with the socket... The malware starts listening on the port specified... Finally, the accept method is utilized to allow incoming connection attempts.
Brute Ratel is a commercial post-exploitation framework with implants that can take many forms, including executables, service binaries, DLLs, and PowerShell scripts. It is capable of moving laterally via Server Message Block (SMB)...
Examples include 'Aquatic Panda used WMI for lateral movement in victim environments,' 'Deep Panda group is known to utilize WMI for lateral movement,' and 'Cinnamon Tempest has used Impacket for lateral movement via WMI.'
The group then deploys post-exploitation frameworks like Cobalt Strike or Brute Ratel to establish stealthy command-and-control (C2) channels and enable lateral movement.
Collection
4 techniques
Collection
0x0B06 ID – Convert the time of the last input event in minutes... GetLastInputInfo is used to retrieve the time of the last input event.
Taking windows desktop screenshot
Figure 9 shows the code snippet BRC4 uses to parse or copy the clipboard data on the targeted host using the Windows API functions OpenClipboard and GetClipboardData.
recent campaigns using Brutal Rater have exploited fake Microsoft OneDrive installers encapsulated in .iso files to minimise detection by antivirus software.
Command and Control
9 techniques
Command and Control
The encoded onboard DLL is still stored RC4 encrypted... the RC4 key for the config is no longer the hardcoded value in the DLL. Instead, it is now the last 8 bytes from the decoded DLL blob.
The current version of Brute Ratel allows users to create command-and-control channels using legitimate tools such as Microsoft Teams, Slack and Discord. | Brute Ratel (BRc4) is a Command and Control (C2) framework designed to help attackers evade defence systems and remain undetected while executing malicious commands.
QAKBOT can use HTTP and HTTPS in communication with the C&C servers.
ATT&CK MITRE: T1102 ... I want to show another simple example ... abuse of Slack Webhook API to upload system information from a victim’s Windows system.
The attackers deployed Brute Ratel, a Command-and-Control (C2) framework... Brute Ratel was retrieved from an external server and was leveraged to inject malicious code into the compromised system’s memory.
The JSON is encrypted using the XOR operator... The process encodes the encrypted JSON using Base64 and exfiltrates the resulting data using HttpSendRequestW... The response is Base64-decoded and decrypted using the same key.
Badgers are similar to Cobalt Strike beacons and connect attackers to a remote command and control server, providing them with remote code execution capabilities.
The group then deploys post-exploitation frameworks like Cobalt Strike or Brute Ratel to establish stealthy command-and-control (C2) channels and enable lateral movement.
Used by QAKBOT, BRUTEL and Cobalt Strike
Exfiltration
2 techniques
Exfiltration
Many entries state malware or actors can upload, transfer, send, or exfiltrate files from compromised hosts to command-and-control servers or attacker infrastructure.
It instructs rundll32.exe to load davclnt.dll for a WebDAV/SSL fetch from the first Cloudflare tunnel.
Impact
3 techniques
Impact
0xEBC0 ID – Kill processes The target process is opened via a function call to OpenProcess (0x1 = PROCESS_TERMINATE )... The process is killed using the TerminateProcess API.
0xB63A ID – Block keyboard and mouse input events The BlockInput method is used to perform the operation.
0x0391 ID – Lock the workstation’s display LockWorkStation is utilized to lock the display.
Observables
180 indicators attributed across vendor reports, sandbox runs, and researcher write-ups. Values are masked here and available in full in Mallory.
Recent activity
132 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.