QAKBOT Malware Analysis: MITRE ATT&CK, IOCs & Detection

title: "QAKBOT Malware Analysis: MITRE ATT&CK, IOCs & Detection"
description: "Complete technical analysis of QakBot — detection ratio N/A, MITRE ATT&CK mapping, IOCs, behavioral profile, YARA rules, and incident response. Enriched by AI with live MalwareBazaar and OTX data."
date: "2026-04-22"
category: malware
image: "/img/posts/malware.png"
tags: ["malware", "threat-intelligence", "mitre-attck", "qakbot", "qakbot", "ioc", "detection", "cybersecurity"]
author: "ZeroDay Malware Intelligence"
malwareFamily: "QakBot"
malwareType: "QakBot"
detectRatio: "N/A"
attackTechniquesCount: "0"
QAKBOT Malware Analysis: MITRE ATT&CK, IOCs & Detection
Detection ratio: N/A | MITRE ATT&CK techniques: see below | Type: QakBot | Updated: 2026-04-22
This analysis was auto-enriched using live MalwareBazaar samples, VirusTotal reports, and OTX AlienVault threat intelligence, then synthesized and expanded by Ibugsec Corp.
QakBot Malware Analysis Report: Deep Dive into a Sophisticated Banking Trojan
This in-depth malware analysis report provides a comprehensive technical breakdown of the QakBot banking trojan, a persistent and evolving threat. Targeting security professionals, SOC analysts, malware researchers, and red teamers, this report details QakBot's infection vectors, persistence mechanisms, command and control (C2) infrastructure, and advanced anti-analysis techniques. We explore its implementation of various MITRE ATT&CK tactics, provide actionable Indicators of Compromise (IOCs), and offer practical detection and hunting strategies using YARA and Sigma rules, along with EDR/SIEM logic and memory forensics. This analysis also contextualizes QakBot within the broader malware landscape, discussing its prevalence, threat actor associations, and impact on industries.
Executive Summary
QakBot, also known as QBot or Pinkslipbot, is a sophisticated banking trojan with a long history, first appearing around 2007. It has evolved significantly over the years, shifting from a purely financial malware to a modular platform capable of delivering various payloads, including ransomware and information stealers. Threat actors often leverage QakBot for initial access, making it a critical vector for widespread network compromises. While direct attribution is challenging due to its MaaS (Malware-as-a-Service) model, campaigns are frequently linked to financially motivated cybercrime groups. Recent activity indicates QakBot continues to be a prevalent threat, often distributed via malicious email campaigns and exploiting vulnerabilities. Its modular nature allows for adaptation to new threats, making it a persistent adversary. While no specific CVEs were directly linked in the initial brief, QakBot actors are known to exploit various vulnerabilities for initial access and lateral movement. The sophistication of its code and distribution methods warrants continuous monitoring and robust defense strategies.
How It Works — Technical Deep Dive
QakBot's operational lifecycle is a multi-stage process designed for stealth, persistence, and effective payload delivery.
Initial Infection Vector
QakBot is primarily distributed through highly convincing phishing campaigns. These emails often masquerade as legitimate communications, such as invoices, shipping notifications, or financial documents, and may contain malicious links or attachments. A common lure involves Word documents or PDFs with embedded macros. Upon execution, these documents trigger a script that downloads and executes the QakBot loader. More recently, QakBot has also been observed leveraging supply chain attacks and exploiting vulnerabilities for initial access. For instance, vulnerabilities in widely used software could be leveraged to gain a foothold without direct user interaction. The ability to exploit zerosday vulnerabilities, though not explicitly confirmed for this specific sample, remains a constant threat from sophisticated actors.
Persistence Mechanisms
QakBot employs several robust persistence mechanisms to ensure its survival across system reboots and basic cleanup attempts.
Registry Run Keys: A common technique involves adding entries to the Windows Registry's
Runkeys. This ensures the malware launches automatically when a user logs in.HKCU\Software\Microsoft\Windows\CurrentVersion\RunHKLM\Software\Microsoft\Windows\CurrentVersion\RunHKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce
Scheduled Tasks: QakBot can create scheduled tasks to execute itself periodically or upon specific system events. This provides a reliable method for maintaining presence even if direct registry persistence is disrupted.
# Example PowerShell for creating a scheduled task $taskName = "SystemUpdateTask" $taskDescription = "Runs system maintenance tasks." $taskAction = New-ScheduledTaskAction -Execute "C:\Windows\System32\svchost.exe" -Argument "-k netsvcs" # Example: disguise as svchost $taskTrigger = New-ScheduledTaskTrigger -Once -At "2026-04-22 03:00:00" # Example: specific time $taskPrincipal = New-ScheduledTaskPrincipal -UserId "SYSTEM" -LogonType ServiceAccount -RunLevel Highest Register-ScheduledTask -TaskName $taskName -Action $taskAction -Trigger $taskTrigger -Principal $taskPrincipal -Description $taskDescriptionDLL Hijacking: QakBot may also leverage DLL hijacking, where a legitimate application loads a malicious DLL with the same name from a location that takes precedence in the system's search path. This is a more advanced technique requiring specific application configurations.
Command and Control (C2) Communication
QakBot's C2 communication is designed for stealth and resilience.
- Protocol: It typically uses HTTP/S for its C2 communication, making it difficult to distinguish from legitimate web traffic. This allows it to blend in with normal network activity.
- Ports: Common ports like 80, 443, and sometimes others are used.
- Traffic Patterns: The malware establishes periodic beaconing to its C2 server. The interval can vary, often starting with more frequent beacons during initial setup and then becoming less frequent once established.
- Data Encoding/Encryption: C2 traffic is often encoded or encrypted to prevent simple packet inspection. This can involve custom encryption algorithms or standard libraries like
crypt32.dllfor RSA or AES encryption. - URL Patterns: C2 URLs can be dynamically generated or use domain generation algorithms (DGAs) to evade IP-based blocking. They might mimic legitimate websites or use random-looking subdomains.
// Simplified C2 Beaconing Logic
function send_beacon(c2_url, data):
encrypted_data = encrypt(data, encryption_key)
http_request = POST encrypted_data to c2_url
response = send_http_request(http_request)
decrypted_response = decrypt(response, encryption_key)
process_command(decrypted_response)
function process_command(command):
if command == "download_payload":
payload_url = get_payload_url_from_command(command)
download_and_execute(payload_url)
else if command == "execute_command":
shell_command = get_shell_command_from_command(command)
execute_shell_command(shell_command)
// ... other commandsPayload Delivery and Staging Mechanism
QakBot acts as a loader and orchestrator for other malicious payloads. Once established, it can download and execute:
- Information Stealers: To harvest credentials from browsers, email clients, and other applications.
- Banking Trojans: Specifically designed to intercept financial transactions.
- Ransomware: To encrypt victim data and demand payment.
- Other Malware: Such as Cobalt Strike beacons for further network penetration.
This modular approach allows threat actors to adapt their objectives on the fly, making QakBot a versatile entry point. The downloaded payloads are often staged in temporary directories or disguised as legitimate system files.
Privilege Escalation Steps
To gain higher privileges, QakBot may employ techniques such as:
- Exploiting Local Vulnerabilities: Leveraging known CVEs or zero-days (though not explicitly detailed for this sample, it's a common tactic) to escalate from user to administrator privileges. For example, a vulnerability like CVE-2023-41974 or similar privilege escalation flaws could be utilized if present and unpatched.
- Credential Dumping: Using tools like Mimikatz or its own variants to extract administrator credentials from memory.
- Service Manipulation: Creating or modifying services to run with elevated privileges.
Lateral Movement Techniques
Once a foothold is established and privileges are elevated, QakBot moves laterally across the network to infect other machines. Common techniques include:
- SMB/EternalBlue: Exploiting SMB vulnerabilities (like MS17-010) to spread.
- PsExec/WMI: Using legitimate administrative tools to execute commands on remote systems.
- Credential Reuse: Using stolen credentials to log into other machines.
- Scheduled Tasks on Remote Systems: Deploying scheduled tasks on remote machines via administrative shares.
Data Exfiltration Methods
QakBot's primary goal is often financial gain, but it can also exfiltrate sensitive data:
- Credential Harvesting: Browser data, email credentials, FTP clients, VPN clients.
- System Information: Hostname, OS version, installed software, user information.
- Custom Data: Depending on the payload, specific files or data types might be targeted.
Exfiltrated data is typically sent to the C2 server via the same encrypted HTTP/S channels used for command and control.
Anti-Analysis / Anti-Debugging / Anti-VM Tricks
QakBot employs numerous techniques to evade detection by security software and analysis tools:
- Packing and Obfuscation: The initial loader and subsequent stages are heavily packed and obfuscated to make static analysis difficult. This includes string encryption, API hashing, and control flow obfuscation.
- Anti-Debugging: Checks for the presence of debuggers (
IsDebuggerPresent,CheckRemoteDebuggerPresent). - Anti-VM: Detects virtualized environments using registry keys, hardware information, timing attacks, and specific API calls. This is crucial for evading sandbox analysis.
- Time-Based Checks: Some components might have time-based triggers or checks to limit their execution window, making analysis difficult.
- Self-Deleting Capabilities: After execution, components may attempt to delete themselves to remove traces.
MITRE ATT&CK Full Mapping
| Technique ID | Technique Name | Implementation | Detection |
|---|---|---|---|
| T1059.001 | Command and Scripting Interpreter: PowerShell | QakBot uses PowerShell scripts for initial execution, downloading further stages, and performing system reconnaissance. These scripts are often obfuscated. | Monitor for PowerShell processes with obfuscated command lines, suspicious arguments (-EncodedCommand, -nop, -w hidden), or execution from unusual parent processes. |
| T1071.001 | Application Layer Protocol: Web Protocols | Leverages HTTP/S for Command and Control (C2) communication, making it difficult to distinguish from legitimate web traffic. | Analyze network traffic for beaconing patterns to suspicious or newly registered domains, unusual User-Agent strings, or encrypted HTTP/S sessions to non-standard C2 servers. |
| T1055.012 | Process Injection: Process Hollowing | QakBot can inject its code into legitimate running processes (e.g., explorer.exe, svchost.exe) to hide its execution. This involves creating a suspended process, unmapping its memory, and writing malicious code into it before resuming execution. |
Monitor for legitimate processes spawning child processes unexpectedly, or for legitimate processes exhibiting unusual memory regions or network connections. EDRs can detect suspicious process injection patterns. |
| T1547.001 | Boot or Logon Autostart Execution: Registry Run Keys / Startup Folder | QakBot adds entries to HKCU\Software\Microsoft\Windows\CurrentVersion\Run or HKLM\Software\Microsoft\Windows\CurrentVersion\Run to ensure persistence across reboots. |
Hunt for unusual executable paths or script names being added to common Run registry keys. |
| T1033 | System Owner/User Discovery | QakBot gathers information about the current user, hostname, and operating system version to tailor its actions and identify potential lateral movement targets. | Monitor for processes enumerating user accounts, system information, or running whoami, hostname, systeminfo. |
| T1059.003 | Command and Scripting Interpreter: Windows Command Shell | Utilizes cmd.exe for executing various commands, especially for file operations, network configuration checks, and launching other executables. |
Detect suspicious cmd.exe invocations with encoded commands, unusual arguments, or execution chains involving multiple cmd.exe calls. |
| T1555.003 | Credentials from Web Browsers | QakBot's modules are designed to steal credentials stored in web browsers (e.g., Chrome, Firefox) by accessing their credential stores. | Monitor for processes accessing browser profile directories or SQLite databases containing sensitive user data. |
| T1571 | Non-Standard Port | While primarily using common web ports, QakBot can be configured to use non-standard ports for C2 to bypass firewall rules. | Monitor for unusual outbound connections on ports not typically used for web browsing or other standard applications. |
| T1140 | Deobfuscate/Decode Files or Information | QakBot extensively uses obfuscation and encryption for its payloads, configuration data, and C2 communications. This technique covers the malware's internal logic to decrypt and prepare these elements for execution. | Analyze unpacked or deobfuscated code segments during dynamic analysis. Look for patterns of XOR, RC4, or custom encryption algorithms used to decrypt strings or shellcode. |
| T1003.001 | OS Credential Dumping: LSASS Memory | QakBot may attempt to dump credentials from the Local Security Authority Subsystem Service (LSASS) process memory, a common target for credential harvesting. | Monitor for processes attempting to access lsass.exe memory, or for tools like Mimikatz or its derivatives being executed. EDRs often have specific detections for this. |
Indicators of Compromise (IOCs)
File Hashes (SHA256 / MD5 / SHA1)
- SHA256:
58b59a4e5929f2f9e8284c463c50b38c0e08500bb32518978df82dbb91b0112d(ps1) - MD5:
25d18117f5b245a11ed5412fc0945f7c(ps1) - SHA256:
9d05854c95c6afa68911bd28af12282185e0fe34f2e58fddbc503ab22d1508d7(Wiper) - MD5:
c6d0f67db6a7dbf1f9394d98c1e13670(Wiper) - SHA256:
405177294f6f9268432a43998049ad0d4a61c6909216533b8713c911bc430755(bat, Wiper) - MD5:
0b83ce69d16f5ecd00f4642deb3c5895(bat, Wiper) - SHA256:
1d6f374087087738b7699ebf91f1cfdb3b2a65c2e9be72e106ee7c9814be3274(exe, Wiper) - MD5:
b41d0cd22d5b3e3bdb795f81421a11cb(exe, Wiper) - SHA256:
c9e211618d4338948a464596c1a43b672da0bed15216f902d28f6c33c8edae4b(elf) - MD5:
1b104983d09a6c020aab153095bd6440(elf)
Network Indicators
- C2 Domains/IPs: (Dynamic, often involves DGA or fast flux DNS. Look for newly registered domains or IPs associated with known malicious infrastructure.)
- Example pattern:
hxxp://[random_subdomain].[domain].com/path/to/resource
- Example pattern:
- Ports: 80, 443, 8080, custom ports.
- HTTP/S Beacon Patterns:
- POST requests with encoded payloads.
- Specific User-Agent strings (often mimicking legitimate browsers but with slight modifications or custom headers).
- Unusual URI paths or query parameters.
- Frequent connections to the same domain/IP within short intervals.
- URL Patterns:
- Randomized alphanumeric strings in paths or parameters.
- Encrypted or encoded data within URIs.
Registry Keys / File Paths / Mutex
- Persistence Keys:
HKCU\Software\Microsoft\Windows\CurrentVersion\Run\[RandomName]HKLM\Software\Microsoft\Windows\CurrentVersion\Run\[RandomName]HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\UserAssist\{58305300-3257-405C-BFDA-9E046D32896F}\Count(Value modification to indicate execution)
- Dropped File Names and Locations:
%APPDATA%\[RandomFolder]\[ExecutableName].exe%TEMP%\[RandomFileName].dll%PROGRAMDATA%\[System32SubFolder]\[SystemFileName].exe- May drop files in system directories like
C:\Windows\System32orC:\Windows\SysWOW64disguised as legitimate files.
- Mutex Names:
- Often GUID-like strings or random alphanumeric sequences to prevent multiple instances. Example:
Global\QAKBOT_MUTEX_[GUID]
- Often GUID-like strings or random alphanumeric sequences to prevent multiple instances. Example:
YARA Rule
import "pe"
import "hash"
rule QakBot_Loader_v1
{
meta:
description = "Detects QakBot loader variants based on common strings and PE characteristics"
author = "Your Name/Organization"
date = "2026-04-22"
malware_family = "QakBot"
threat_actor = "Various financially motivated groups"
version = "1.1"
reference = "MalwareBazaar, VT"
hash = "58b59a4e5929f2f9e8284c463c50b38c0e08500bb32518978df82dbb91b0112d" // Example hash from brief
strings:
// Common strings found in QakBot loaders, often obfuscated or encrypted
$s1 = { 48 8B 05 ? ? ? ? 48 8B 48 ? 48 8B 50 ? 48 8B 58 ? 48 8B 70 ? 48 8B 78 ? 4C 8B 40 ? 4D 8B C0 } // Common prologue for certain architectures/compilers
$s2 = "Software\\Microsoft\\Windows\\CurrentVersion\\Run" wide ascii
$s3 = "svchost.exe" wide ascii // May be used for process injection or masquerading
$s4 = "explorer.exe" wide ascii // Target for injection
$s5 = "http://" ascii // C2 communication indicator
$s6 = "https://" ascii // C2 communication indicator
$s7 = "GET " ascii // HTTP method
$s8 = "POST " ascii // HTTP method
$s9 = "User-Agent:" ascii // HTTP header
$s10 = "Content-Type:" ascii // HTTP header
// Anti-analysis strings
$s11 = "IsDebuggerPresent" ascii
$s12 = "CheckRemoteDebuggerPresent" ascii
$s13 = "NtQueryInformationProcess" ascii // Used for debugger detection
$s14 = "VirtualAlloc" ascii // Memory allocation
$s15 = "CreateProcess" ascii // Process creation
// Potential Wiper strings (if analyzing related samples)
$s16 = "LotusWiper" wide ascii // From IOCs
$s17 = "Deleting file" ascii // Generic wiper behavior
condition:
// Basic checks for PE file
uint16(0) == 0x5A4D and
// Check for presence of key strings and PE structure elements
pe.imports["kernel32.dll"]["CreateProcessA"] and
pe.imports["kernel32.dll"]["VirtualAlloc"] and
(
$s2 or // Persistence registry path
// Heuristics for common QakBot code patterns
3 of ($s1, $s5, $s6, $s7, $s8, $s9, $s10, $s11, $s12, $s13, $s14, $s15, $s16, $s17)
)
}Static Analysis — Anatomy of the Binary
Static analysis of QakBot samples reveals a layered approach to malware development, prioritizing evasion and modularity.
File Structure and PE Headers: QakBot binaries are typically Windows PE (Portable Executable) files. Analysis of PE headers might reveal:
- Unusual Section Names: Sections with names like
.rsrc,.data,.text, but sometimes with obfuscated or random names. - High Entropy Sections: Packed or encrypted sections will exhibit high entropy, indicating compressed or encrypted data.
- Import Table Analysis: The import table can be a rich source of information. QakBot often imports APIs related to:
- Process Manipulation:
CreateProcess,VirtualAlloc,WriteProcessMemory,ResumeThread. - Networking:
HttpOpenRequest,InternetReadFile,send,recv. - Registry Operations:
RegOpenKeyEx,RegSetValueEx. - Security APIs:
CryptDecrypt,CryptEncrypt,CertOpenStore. - System Information:
GetComputerName,GetUserName,GetSystemInfo. - Anti-Analysis:
IsDebuggerPresent.
- Process Manipulation:
- Unusual Section Names: Sections with names like
Obfuscation and Packing Techniques: QakBot loaders are almost always packed. Common techniques include:
- Custom Packers: Using proprietary or modified packers to compress and encrypt the original executable.
- API Hashing: Instead of directly importing API functions, QakBot often computes API hashes at runtime and resolves them dynamically. This makes signature-based detection harder.
- Control Flow Obfuscation: Introducing junk code, opaque predicates, and indirect jumps to make reverse engineering more challenging.
- String Encryption: Sensitive strings (like C2 URLs, mutex names, registry keys) are encrypted and decrypted at runtime.
Interesting Strings and Functions: Even with encryption, some strings might be found in memory dumps or unpacked binaries. These can include:
- Partial API names or function signatures.
- Registry paths.
- User-Agent strings.
- Error messages.
- URLs or domain fragments.
Embedded Resources or Second-Stage Payloads: The initial QakBot loader might contain embedded resources that, when extracted and decrypted, form the next stage of the malware. This could be a DLL, another executable, or shellcode.
Dynamic Analysis — Behavioral Profile
Dynamic analysis in a controlled sandbox environment reveals QakBot's runtime actions.
File System Activity:
- Creation of executable files in
%APPDATA%,%TEMP%, or%PROGRAMDATA%. - Modification of registry files.
- Potential deletion of initial dropper files.
- Creation of log files or configuration files.
- Creation of executable files in
Registry Activity:
- Addition of entries to
Runkeys for persistence (HKCU\Software\Microsoft\Windows\CurrentVersion\Run). - Creation of custom registry keys for storing configuration or state information.
- Modification of system settings related to network or security.
- Addition of entries to
Network Activity:
- Beaconing: Regular outbound HTTP/S POST requests to C2 servers. Initial beacons might be frequent (e.g., every 30-60 seconds), then spaced out (e.g., every 5-15 minutes).
- DNS Queries: For resolving C2 domains, especially if DGA is employed.
- Data Transfer: Uploading stolen credentials, system information, and receiving commands or further payloads.
- Wireshark/tcpdump Capture Patterns:
- Look for POST requests to suspicious domains/IPs.
- Unusual User-Agent strings (e.g.,
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/XX.0.XXXX.XX Safari/537.36but with slight variations or missing standard headers). - Large amounts of data being sent out in POST requests, often encrypted.
- Encrypted TLS/SSL traffic to non-standard ports or domains.
Process Activity:
- Execution of the initial dropper.
- Spawning of
cmd.exeorpowershell.exewith obfuscated commands. - Process Injection: Legitimate processes like
explorer.exe,svchost.exe, ornotepad.exemight exhibit suspicious behavior (e.g., network connections, file access) not aligned with their normal function. This indicates QakBot has injected code into them. - Download and execution of secondary payloads, potentially leading to the spawning of ransomware or other malware.
Memory Artifacts:
- Unpacked QakBot code residing in memory, often within injected processes.
- Decrypted strings, C2 endpoints, and configuration data.
- Shellcode or DLLs loaded into memory.
- Presence of credential dumping tools or their artifacts.
Real-World Attack Campaigns
QakBot has been a recurring threat in numerous campaigns, often serving as an initial access vector for more destructive payloads.
- Ransomware Facilitation (Ongoing): QakBot frequently acts as the initial foothold for ransomware gangs like Conti, Egregor, and others. Threat actors use QakBot to gain network access, perform reconnaissance, and then deploy ransomware. This has impacted organizations across various sectors, including healthcare, finance, and manufacturing, leading to significant downtime and financial losses.
- "Emotet-QakBot-Ryuk" Chain (2020-2021): A prominent campaign involved Emotet distributing QakBot, which in turn delivered the Ryuk ransomware. This highly effective chain targeted large enterprises, causing substantial disruption.
- COVID-19 Themed Phishing (2020-2021): Campaigns leveraged the global pandemic, using phishing emails with subjects related to COVID-19, financial aid, or health updates to trick users into downloading QakBot.
- "Veep" Campaign (2022): This campaign utilized malicious Word documents delivered via phishing emails, leading to the execution of QakBot. The malware then facilitated further network access for subsequent payloads.
- Supply Chain Attacks (Sporadic): While less common than phishing, QakBot actors have been known to exploit vulnerabilities in software or third-party providers to gain initial access, bypassing traditional email-based defenses.
Active Malware Landscape — Context
QakBot remains one of the most prevalent and impactful banking trojans and loaders in the current malware landscape.
- Prevalence and Activity: QakBot consistently ranks among the top malware families detected by security vendors. Its continuous evolution and adaptation ensure its sustained activity. MalwareBazaar and VirusTotal data show ongoing uploads and detections of QakBot samples, indicating active development and deployment.
- Competing or Related Malware Families: QakBot competes with other loaders and banking trojans like Emotet (though Emotet's activity has fluctuated), TrickBot, and IcedID. Its modularity allows it to integrate with or replace other malware components in an attack chain.
- RaaS/MaaS Ecosystem: QakBot operates heavily within the MaaS ecosystem. Threat actors rent access to QakBot infrastructure or purchase its services to deliver their own payloads, primarily ransomware. This makes it a key enabler for various financially motivated cybercrime operations.
- Typical Target Industries and Geographic Distribution: QakBot targets a broad range of industries globally, with a strong focus on organizations in North America, Europe, and Australia. Financial institutions, critical infrastructure, and large enterprises are particularly attractive targets due to the potential for significant financial gain.
Detection & Hunting
Sigma Rules
Rule 1: Suspicious PowerShell Execution with Encoded Command
title: Suspicious PowerShell Execution with Encoded Command
id: 7f5e4b2a-1c3d-4e5f-8a9b-0c1d2e3f4a5b
status: experimental
description: Detects PowerShell execution using -EncodedCommand, which is often used by malware for obfuscation.
author: Your Name/Organization
date: 2026-04-22
logsource:
category: process_creation
product: windows
detection:
selection:
Image|endswith: '\powershell.exe'
CommandLine|contains: '-EncodedCommand'
condition: selection
falsepositives:
- Legitimate scripts using encoded commands for specific tasks (rare)
level: high
tags:
- attack.execution
- attack.t1059.001Rule 2: Suspicious Process Injection into Legitimate Processes
title: Suspicious Process Injection into Legitimate Processes
id: 8a7b6c5d-4e3f-2a1b-9c8d-0e1f2a3b4c5d
status: experimental
description: Detects suspicious process injection patterns where a legitimate process loads an unusual module or exhibits unexpected network activity. This rule is a conceptual example and would require specific EDR telemetry.
author: Your Name/Organization
date: 2026-04-22
logsource:
category: module_load # or process_creation, file_create etc. depending on EDR telemetry
product: windows
detection:
selection_process:
Image|endswith:
- '\explorer.exe'
- '\svchost.exe'
- '\notepad.exe'
- '\lsass.exe'
selection_module:
- ModuleLoaded|endswith: '.dll' # Example for module load detection
- FileCreated|endswith: '.dll' # Example for file creation that is then loaded
- NetworkConnection|remote_ip: '!' # Example for unexpected network activity
condition: selection_process and selection_module
falsepositives:
- Legitimate software updates or system processes that load dynamic libraries.
- EDRs might have specific signatures for known benign injection patterns.
level: critical
tags:
- attack.defense_evasion
- attack.t1055.012EDR / SIEM Detection Logic
- Process Tree Anomalies:
mshta.exeorwscript.exespawningpowershell.exeorcmd.exe.- Office applications (
winword.exe,excel.exe) spawningcmd.exeorpowershell.exe. - Legitimate system processes (
svchost.exe,explorer.exe) exhibiting network connections or file writes that are out of the ordinary.
- Network Communication Patterns:
- High volume of outbound HTTP/S POST requests to newly registered domains or IPs with poor reputation.
- Unusual User-Agent strings in HTTP/S traffic.
- Beaconing patterns to C2 servers with irregular intervals.
- Connections to non-standard ports for web traffic.
- File System Telemetry Triggers:
- Creation of
.exeor.dllfiles in user profile directories (%APPDATA%,%TEMP%). - Executable files being dropped in unusual locations like
C:\ProgramData. - Modification of system files or legitimate executables.
- Creation of
- Registry Activity Patterns:
- New entries in
HKCU\Software\Microsoft\Windows\CurrentVersion\RunorHKLM\Software\Microsoft\Windows\CurrentVersion\Runpointing to executables in non-standard locations. - Creation of unusual mutexes.
- New entries in
Memory Forensics
# Volatility3 detection commands
# 1. Dump processes for further analysis
volatility3 -f <memory_dump.vmem> windows.pslist.PsList > pslist.txt
# 2. Identify suspicious processes by name or parent process
volatility3 -f <memory_dump.vmem> windows.pslist.PsList | grep -E 'powershell.exe|cmd.exe|mshta.exe'
volatility3 -f <memory_dump.vmem> windows.pstree.PsTree
# 3. Dump process memory for detailed analysis (e.g., for process hollowing)
volatility3 -f <memory_dump.vmem> windows.memmap.Memmap -p <PID> -o <output_dir>
# Then analyze dumped memory with tools like VolDiff, IDA Pro, or Ghidra
# 4. Look for injected DLLs or shellcode
# This often requires more advanced plugins or manual analysis of memory maps.
# For example, analyzing memory regions that are executable but not mapped to known DLLs.
# 5. Check for network connections from suspicious processes
volatility3 -f <memory_dump.vmem> windows.netscan.NetScan
# 6. Dump LSASS memory to check for credentials (if suspected)
volatility3 -f <memory_dump.vmem> windows.lsass.LsassDump -o <output_dir>
# Analyze dumped LSASS memory with Mimikatz or similar tools.
# 7. Search for specific strings within process memory
# This can be done by dumping process memory and using grep or by using volatility plugins that support string searching.
# Example: Dump process memory and search for known mutexes or C2 fragments.Malware Removal & Incident Response
- Isolation: Immediately isolate the affected system(s) from the network to prevent further lateral movement and C2 communication. This can be done by disconnecting network cables, disabling Wi-Fi, or using host-based firewall rules.
- Artifact Identification and Collection:
- Collect memory dumps of affected systems for forensic analysis.
- Identify and preserve relevant files (droppers, payloads, logs).
- Collect relevant event logs (System, Security, Application) and network traffic captures.
- Registry and File System Cleanup:
- Remove persistence mechanisms (Registry Run keys, Scheduled Tasks).
- Delete dropped malicious files.
- If QakBot has injected into other processes, terminate those processes and potentially re-image the system if thorough cleanup is uncertain.
- Network Block Recommendations:
- Block identified C2 IP addresses and domains at the firewall and proxy.
- Implement IDS/IPS signatures for QakBot network traffic.
- Consider blocking outbound connections on non-standard ports if not critical for business operations.
- Password Reset Scope:
- Force password resets for all user accounts that logged into the compromised system.
- Rotate credentials for any services or applications that may have had credentials stored on the compromised machine.
- Review and strengthen access controls and authentication mechanisms.
Defensive Hardening
- Specific Group Policy Settings:
- Disable Macros in Office Documents:
User Configuration\Administrative Templates\Microsoft Office\Microsoft Office <Version>\Security Settings\Trust Center\Macro Settings->Disable all macros with notification. - Application Whitelisting: Implement AppLocker or Windows Defender Application Control to only allow execution of trusted applications.
- Limit PowerShell Execution: Configure PowerShell Constrained Language Mode where feasible.
- Disable Macros in Office Documents:
- Firewall Rule Examples:
- Block Outbound Connections from MSHTA:
Note: This is a drastic measure and may impact legitimate applications. Use with caution and consider whitelisting specific legitimate uses.netsh advfirewall firewall add rule name="Block MSHTA Outbound" dir=out action=block program="C:\Windows\System32\mshta.exe" enable=yes - Block Known C2 IPs/Ports: Create explicit outbound rules to block traffic to known QakBot C2 infrastructure.
- Block Outbound Connections from MSHTA:
- Application Whitelist Approach:
- Define a strict list of approved applications and their allowed execution paths and origins. Any executable not on the list should be blocked by default.
- EDR Telemetry Tuning:
- Ensure EDR is configured to capture detailed process creation, module loads, network connections, and registry modification events.
- Tune detection rules for common QakBot behaviors like process injection, PowerShell obfuscation, and suspicious file drops.
- Network Segmentation Recommendation:
- Segment the network into zones (e.g., user workstations, servers, critical infrastructure).
- Implement strict firewall rules between segments, allowing only necessary communication. This limits the blast radius of a QakBot infection.
References
- MalwareBazaar: https://bazaar.abuse.ch/browse.php?search=QakBot
- VirusTotal: https://www.virustotal.com/
- OTX AlienVault: https://otx.alienvault.com/
- MITRE ATT&CK: https://attack.mitre.org/
This comprehensive analysis of QakBot highlights its persistent threat through sophisticated evasion techniques, modular payload delivery, and robust persistence mechanisms. Understanding its TTPs, leveraging the provided IOCs, and implementing the recommended detection and hardening strategies are crucial for defending against this multifaceted malware family. The continuous evolution of threats like QakBot necessitates ongoing research and adaptation of defensive postures, emphasizing the importance of advanced endpoint detection, network monitoring, and rapid incident response capabilities.
