Linux malware hides via process name masquerading
Attackers use prctl() and argv manipulation to disguise malicious Linux processes as legitimate kernel workers, evading detection by standard monitoring tools.
Security researchers have demonstrated how Linux malware can masquerade as legitimate system processes by manipulating process names in /proc/<pid>/comm and /proc/<pid>/cmdline. The technique, catalogued as MITRE ATT&CK T1036, involves using the prctl(PR_SET_NAME) system call to alter the 'comm' field and overwriting the argv/environ memory region to spoof the command line visible to tools like ps and top. A proof-of-concept shows a user-mode process successfully disguising itself as '[kworker/0:1-events]', a common kernel worker thread name.
The technique has been observed in real-world campaigns, notably by the Velvet Ant Chinese APT group. While the masquerading defeats traditional process-listing tools, eBPF-based monitoring solutions like Kunai can detect the discrepancy between the reported process name and the actual executable path. Detection hinges on correlating the exec name with the command line — a mismatch indicates probable masquerading.
On Windows systems, similar masquerading is possible but more constrained. Attackers can modify the Process Environment Block (PEB) from user mode to alter ImagePathName and CommandLine fields visible to Task Manager and WMI queries. However, kernel-mode structures like EPROCESS.ImageFileName cannot be rewritten from user space, providing a more reliable indicator of the true process identity for kernel-level monitoring tools.
Mentioned in this report
Detection guidance
Linux Process Masquerading as Kernel Worker Thread
Detects user-mode processes whose reported name/command line mimics kernel worker thread naming conventions (e.g. [kworker/*], [ksoftirqd/*]) while having a real backing executable image path, indicating comm/cmdline spoofing rather than an actual kernel thread. Auto-generated starting point — validate and tune in your environment before deploying. IOC matches can false-positive on shared infrastructure and decay as adversary infrastructure rotates.
title: Linux Process Masquerading as Kernel Worker Thread
id: 06afcd81-3e42-55db-a990-95b8977f566a
status: experimental
logsource:
category: process_creation
product: linux
detection:
selection_kernel_name_pattern:
CommandLine|contains:
- '[kworker/'
- '[ksoftirqd/'
- '[kthreadd'
- '[migration/'
- '[rcu_'
- '[watchdog/'
filter_real_kernel_thread:
Image: ''
condition: selection_kernel_name_pattern and not filter_real_kernel_thread
fields:
- Image
- CommandLine
- ParentImage
falsepositives:
- Telemetry pipelines that do not populate Image for genuine kernel threads may cause
false positives; validate that Image resolves to a real user-space executable
- Custom monitoring agents that log kernel thread names with placeholder image paths
level: high
tags:
- attack.t1036
- attack.defense_evasion
author: Vorant
Linux prctl PR_SET_NAME Process Name Spoofing
Detects use of the prctl(PR_SET_NAME) syscall to rewrite the /proc/<pid>/comm field, a common technique used by Linux malware to masquerade as legitimate or kernel processes. Auto-generated starting point — validate and tune in your environment before deploying. IOC matches can false-positive on shared infrastructure and decay as adversary infrastructure rotates.
title: Linux prctl PR_SET_NAME Process Name Spoofing
id: cf69d1be-a692-5939-a489-f99039aa1f50
status: experimental
logsource:
category: syscall
product: linux
detection:
selection:
syscall: prctl
a0: PR_SET_NAME
condition: selection
falsepositives:
- Legitimate multi-threaded applications naming worker threads for debugging (e.g.
thread pools, database engines)
- Container runtimes and init systems that set process names for readability
level: medium
tags:
- attack.t1036
- attack.defense_evasion
author: Vorant
Linux Process with Kernel-Thread-Style Name Executing from Writable Directory
Detects execution of binaries from user-writable locations (/tmp, /var/tmp, /dev/shm) whose process name or command line is formatted to resemble a kernel worker thread, a strong indicator of masquerading rather than a legitimate kernel-spawned thread which never has a backing executable file. Auto-generated starting point — validate and tune in your environment before deploying. IOC matches can false-positive on shared infrastructure and decay as adversary infrastructure rotates.
title: Linux Process with Kernel-Thread-Style Name Executing from Writable Directory
id: 75a93da6-34c9-5a6d-b2fe-89cd9e0f6d92
status: experimental
logsource:
category: process_creation
product: linux
detection:
selection_writable_path:
Image|contains:
- /tmp/
- /var/tmp/
- /dev/shm/
selection_kernel_name:
CommandLine|contains:
- kworker
- ksoftirqd
- kthreadd
- migration/
- rcu_
- watchdog/
condition: selection_writable_path and selection_kernel_name
falsepositives:
- Legitimate diagnostic or testing tools deliberately named after kernel threads for
benchmarking purposes
level: high
tags:
- attack.t1036
- attack.defense_evasion
author: Vorant
Behavioural rules are generated from public reporting — validate in your environment before deploying.
Source reporting: https://isc.sans.edu/diary/rss/33102
This is the public brief
Subscribers see the full picture: extracted IOCs, ready-to-deploy detections (Sigma, Splunk, KQL, Elastic, YARA, Suricata), the entity graph, TAXII 2.1 feed and real-time alerts matched to your sectors.
Start free