BPFDoor is a Linux backdoor that opens no listening port, so port scans and host firewall reviews do not find it. It attaches a Berkeley Packet Filter (BPF) program to a raw socket and waits, passively, for a specific inbound packet before it starts a shell. Public reporting ties it to long-running espionage against telecommunications operators in Asia and the Middle East, and later to financial services and retail. This guide explains how the passive design works at a high level, what has been officially attributed, and how Linux defenders and telecom and cloud SOC teams can find it on hosts and on the network, respond and harden. It is defensive only and gives no trigger packet details.
Key takeaways
- No open port, no scan hit: BPFDoor sniffs traffic through a socket filter below the host firewall, so the usual "what is listening" checks miss it.
- Hunt for packet sockets with BPF filters: listing packet sockets, their owning processes and attached filters is the single most useful host check.
- Process names lie: the implant overwrites its displayed command line to look like a system daemon and deletes its binary, so compare names with real executable paths.
- Hashes are not enough: the filter programs and binaries have changed repeatedly since 2021; detect on behaviour and artefacts.
- It needs root: the implant needs root (or CAP_NET_RAW) to open raw sockets, so privileged access control and server exposure reduction are the main preventive levers.
What BPFDoor is
MITRE ATT&CK tracks BPFDoor as software S1161 and describes it as a Linux based passive long-term backdoor used by China-based threat actors, first seen in 2021, named after its use of Berkeley Packet Filter. ATT&CK lists the aliases JustForFun, Backdoor.Linux.BPFDOOR and Backdoor.Solaris.BPFDOOR.ZAJE, and notes support for TCP, UDP and ICMP to communicate with its controller and for local or reverse shells that use iptables rules to get around the host firewall. Trend Micro reports Linux and Solaris samples.
Trend Micro's 2023 analysis showed the filter programs under active development: a 30-instruction BPF program in samples from 2018 to 2022, growing to programs of 205 and 229 instructions in 2023 variants, about six times larger. In April 2025 Trend Micro reported a previously unseen controller component that operators used for lateral movement inside already compromised networks. The family is therefore not a static indicator set; plan detection around what it has to do on a host, not around one sample.
ATT&CK techniques for S1161
| Technique | How BPFDoor uses it (per ATT&CK) | Defender angle |
|---|---|---|
| T1205.002 Socket Filters | Attaches BPF bytecode to a socket to inspect ICMP, UDP or TCP packets, including on ports 22, 80 and 443 | Enumerate sockets with attached filters |
| T1036.011 Overwrite Process Arguments | Overwrites argv[0] so the process list shows a fake name | Compare displayed name with /proc/<pid>/exe |
| T1036.009 Break Process Trees | Forks, and the parent exits, leaving an orphaned child | Daemons with unusual parentage or start times |
| T1070.004 File Deletion | Deletes the dropped binary after launch | Processes whose executable is marked deleted |
| T1070.006 Timestomp | Changes the executable's timestamps | Do not trust file times alone in triage |
| T1070 Indicator Removal | Clears the process environment | Daemons with an empty /proc/<pid>/environ |
| T1480 and T1480.002 Execution Guardrails, Mutual Exclusion | Uses lock and PID files to avoid running twice | Unexpected lock or PID files under /var/run |
| T1564.011 Ignore Process Interrupts | Ignores hang-up and interrupt signals | Context for process analysis |
| T1686 Disable or Modify System Firewall | Adds iptables redirect rules from the operator's address to a shell port | Alert on unexpected NAT and redirect rules |
| T1690 Prevent Command History Logging | Sets HISTFILE and MYSQL_HISTFILE to /dev/null | Monitor for history suppression |
| T1059.004 Unix Shell | Creates a reverse shell | Unexpected outbound sessions from servers |
| T1027 Obfuscated Files or Information | Can require a password and uses RC4 or libtomcrypt encryption | Payload content inspection is of limited use |
How passive BPF backdoors work (high level)
Classic BPF lets a process attach a small filter program to a socket so that the kernel hands it only the packets it wants. Tools such as tcpdump and DHCP clients use this legitimately. A packet socket with a filter sees traffic as it arrives at the interface, before netfilter (iptables or nftables) decides whether to drop it. The eBPF Security Guide covers the wider BPF and eBPF attack surface; BPFDoor uses the older classic socket filter mechanism.
BPFDoor exploits this ordering. Its filter discards almost everything and passes only packets that carry a specific trigger. Because the process never binds to a port, nothing appears as listening, and a host firewall that blocks the port does not stop the trigger from being seen. When a valid trigger arrives, the implant either connects out to the operator (a reverse shell, which looks like an outbound connection) or opens a shell on a high port and adds a firewall redirect so that the operator's traffic reaches it. Sandfly Security reports shell ports in the range 42391 to 43391 in the samples it analysed. The trigger structure is deliberately not described here; detection does not depend on it.
| Property | Conventional backdoor | Passive BPF backdoor |
|---|---|---|
| Listening port | Yes, visible to ss, netstat and port scans | None until triggered |
| Host firewall | Blocks it if the port is closed | Sees packets before the firewall acts |
| Beaconing | Often periodic outbound callbacks | Silent until an operator sends a trigger |
| Best host signal | Listening socket, process tree | Packet socket with a filter, deleted binary, masqueraded name |
| Best network signal | Callback destinations | Unusual inbound packets to exposed hosts, odd interactive sessions on bulk ports |
Targets and attribution
Attribution below is stated as the named sources state it. Treat it as reported, and base your response on what you find, not on the label.
- MITRE ATT&CK: describes BPFDoor as used by China-based threat actors.
- PwC and Trend Micro: PwC first identified the group it calls Red Menshen in 2021 and attributed BPFDoor to it (as summarised by Singapore's IMDA). Trend Micro's 2023 analysis gives Red Menshen the aliases DecisiveArchitect and Red Dev 18; in 2025 it tracked the actor as Earth Bluecrow and assessed its 2025 attribution with medium confidence.
- Sectors and regions: Trend Micro reported 2023 detections concentrated in telecommunications organisations in Türkiye and Hong Kong, and 2024 activity against telecommunications in Hong Kong, South Korea and Myanmar, financial services in Egypt and retail in Malaysia.
- Government advisory: Singapore's Infocomm Media Development Authority (IMDA) issued an advisory to the infocomm media sector on Earth Bluecrow's use of BPFDoor across telecoms in Asia, with indicators, an ATT&CK annex and detection advice.
For telecoms, BPFDoor sits alongside other long-dwell intrusions into carrier networks; the Salt Typhoon Threat Actor Profile covers a separate actor with a similar target set. Cloud and hosting providers are relevant because any internet-exposed Linux server with root compromise is a candidate host.
Detection on hosts
These checks are read-only and safe to run on production systems with root. Run them across the fleet, not on one host, and compare against a known-good baseline. The How to check a Linux server for signs of compromise guide gives the wider triage routine.
| Check | Safe command or source | What is suspicious |
|---|---|---|
| Packet sockets with BPF filters | ss -0 -p -b (packet sockets, owning process, dump BPF program) | Any process with a filter that is not a known capture tool or DHCP client; large instruction counts |
| Raw sockets | ss -w -a -p, or /proc/net/packet and /proc/net/raw | Raw or packet sockets owned by a "daemon" that should not need them |
| Deleted executables | ls -l /proc/*/exe 2>/dev/null | grep deleted | A running process whose binary no longer exists on disk |
| Masqueraded names | Compare /proc/<pid>/cmdline and /proc/<pid>/comm with readlink /proc/<pid>/exe | "dbus-daemon", "udevd" or "journald" style names pointing at an unexpected or deleted path |
| Empty environment | /proc/<pid>/environ | A long-running daemon with no environment at all |
| Staging and lock files | Files under /dev/shm; /var/run/haldrund.pid and /var/run/initd.lock (reported in ATT&CK and Sandfly analysis) | Executables in shared memory; unexplained zero-byte PID or lock files |
| Firewall redirects | iptables -t nat -S or nft list ruleset | Redirect rules tied to single external source addresses, or to ports 42391 to 43391 |
| History suppression | Process environments and shell start-up files | HISTFILE or MYSQL_HISTFILE set to /dev/null |
| Persistence | Init scripts, systemd units, rc files, crontabs | References to unfamiliar binaries; Sandfly notes the implant has no built-in persistence, so the operator adds it elsewhere |
Continuous telemetry: use auditd or an EDR sensor to record socket creation of packet and raw types, and setsockopt calls that attach a socket filter, by processes outside an allowlist of capture tools. Record executions from /dev/shm and /tmp. The Linux Logging and auditd for Defenders Guide covers rule design, and the Linux Detection and Response Guide covers sensor coverage. Trend Micro notes that process names change per infection and controller passwords vary, so rules based on names or fixed values are weak.
Network detection
- Inbound oddities to exposed hosts: small, unsolicited inbound UDP, ICMP or TCP packets to internet-facing Linux servers that do not match a service the host offers. Network detection that inspects raw packets and non-standard protocol behaviour, as IMDA recommends, can flag these.
- Interactive sessions on bulk ports: Sandfly suggests looking for low-bandwidth, long-latency, interactive-looking sessions on ports that normally carry bulk traffic, such as 443 on a web server.
- Unexpected outbound connections: reverse shells appear as outbound connections from servers that normally only receive traffic. Alert on new outbound destinations from telecom core, billing, database and management hosts.
- High-port sessions: sessions to or from 42391 to 43391 on Linux servers merit review, accepting that operators can change ports.
- Internal lateral movement: Trend Micro reported the controller on hosts used to reach other compromised hosts in the same network, so watch east-west traffic from servers to servers, not only the edge.
Full packet capture at key choke points helps confirm a suspected trigger after the fact. See the Network Monitoring and Packet Capture Guide.
Measuring detection coverage
- Fleet sweep coverage: percentage of Linux servers checked for packet sockets with filters in the last 30 days.
- Telemetry coverage: percentage of internet-facing Linux hosts sending raw socket and socket filter events to the SIEM.
- Baseline quality: number of approved processes allowed to hold packet sockets, reviewed quarterly.
- Root exposure: count of internet-facing hosts with direct root SSH login enabled (target zero).
- Time to triage: median time from a socket filter alert to an analyst decision.
Response and hardening
If you find an active implant, treat the host as fully compromised: BPFDoor needs root, and operators have used compromised hosts to reach others.
- Preserve first. Capture memory and the running process (the deleted binary can still be recovered from the live process) before killing it. Record sockets, firewall rules and process listings. The Linux Forensics Guide covers acquisition.
- Isolate at the network layer. A host firewall rule will not stop the trigger, so isolate with upstream network controls or the cloud security group.
- Find the persistent copy. Sandfly advises that the real binary is likely elsewhere on disk; review init, systemd and cron entries. See the Linux Persistence Forensics Guide.
- Scope the estate. Sweep every Linux host with the checks above and the published indicators, and review east-west connections from the affected host.
- Rotate credentials. Treat SSH host and user keys, service account passwords, API tokens and database credentials stored on or used from the host as exposed, and rotate them.
- Rebuild, do not clean. Rebuild from a trusted image and restore data from backups taken before the earliest evidence of compromise.
Hardening:
- Restrict root and CAP_NET_RAW: remove direct root login, put privileged access behind just-in-time controls, and do not grant CAP_NET_RAW to services or containers that do not need it. See the Linux Capabilities Guide.
- Reduce exposure: IMDA recommends validating and disabling processes, ports and protocols with no business need; keep management interfaces off the internet.
- Allowlist packet capture: maintain the list of processes allowed to hold packet sockets and alert on anything else.
- Test controls: validate detections in a lab using published indicators and YARA rules before rolling them out, as IMDA advises.
Framework mapping
| Framework | Reference | Relevance |
|---|---|---|
| ATT&CK | S1161; T1205.002; M1037 Filter Network Traffic; M1031 Network Intrusion Prevention | Technique coverage and upstream network controls |
| NIST CSF 2.0 | DE.CM-01, DE.CM-09 | Monitoring networks and computing runtime environments |
| NIST SP 800-53 Rev 5 | SI-4 System Monitoring, SI-3 Malicious Code Protection, CM-7 Least Functionality, AC-6 Least Privilege | Detection, malware defence, exposure and privilege reduction |
Common failure patterns
- Trusting port scans: declaring a host clean because nothing unexpected is listening.
- Trusting process names: accepting "dbus-daemon" at face value without checking the executable path.
- Hash-only hunting: sweeping for known hashes when samples are recompiled per campaign.
- Killing before capturing: terminating the process and losing the only copy of a deleted binary.
- Cleaning one host: removing one implant while the persistent copy and other infected hosts remain.
Practitioner checklist
- Sweep all Linux servers for packet sockets with attached BPF filters and baseline the legitimate ones.
- Check for running processes with deleted executables and masqueraded daemon names.
- Collect raw socket and socket filter telemetry from internet-facing hosts into the SIEM.
- Alert on unexpected iptables or nftables redirect rules and on history suppression.
- Monitor outbound and east-west connections from servers that should only receive traffic.
- Remove direct root login and restrict CAP_NET_RAW to approved tools.
- Prepare a Linux response runbook that preserves memory before killing processes.
- Rotate host credentials and keys and rebuild hosts after any confirmed infection.
Standards and references
- MITRE ATT&CK: BPFDoor (S1161)
- IMDA Singapore: Earth Bluecrow Deploys BPFDoor Malware Across Telcos in Asia
- MITRE ATT&CK: Traffic Signaling, Socket Filters (T1205.002)
- Trend Micro: Detecting BPFDoor Backdoor Variants Abusing BPF Filters
- Trend Micro: BPFDoor Hidden Controller Research (April 2025)
- Sandfly Security: BPFDoor, an Evasive Linux Backdoor Technical Analysis
Related NHI Mgmt Group resources: Linux Detection and Response Guide · eBPF Security Guide · Linux Persistence Forensics Guide · How to check a Linux server for signs of compromise · Salt Typhoon Threat Actor Profile