HelpnetSecurity

Researchers release tool to detect stealthy BPFDoor implants in critical infrastructure networks


Telecommunications providers around the world have been dealing with the burrowing efforts of the China-linked Salt Typhoon APT for many years now.

To help them identify hard-to-detect implants used by the group, researchers have released a scanning script.

Salt Typhoon goes deep

Salt Typhoon has hit US, Canadian, European and Asian telcos.

“By compromising telecom networks, they gain the ability to monitor and collect vast amounts of data, including subscriber records, call data, and even network diagrams, that can be used for a variety of nefarious purposes,” noted Gregory Richardson, BlackBerry VP and Advisory CISO.

Salt Typhoon usually breaches these companies by exploiting known vulnerabilities in edge networking devices and VPN products or by leveraging compromised accounts.

Once inside, retaining long-term access is achieved by placing hard-to-detect kernel-level implants like BPFdoor and passive backdoors like TinyShell.

BPFdoor

“What makes BPFdoor particularly unique is its ability to operate at the kernel level without exposing a traditional network footprint,” Christiaan Beek, VP of Cyber Intelligence at Rapid7, told Help Net Security.

This unconventional Linux malware abuses Berkeley Packet Filter (BPF) functionality to
inspect network traffic directly inside the kernel, and passively listens for specially crafted network packets (aka “magic packets”) that will activate it.

BPFDoor activation relying on magic packets (Source: Rapid7)

“Unlike most backdoors, it doesn’t rely on open ports or persistent connections. You’re essentially trying to identify malicious behavior hidden inside otherwise normal network traffic. It’s like looking for a needle that looks and smells like hay, while the haystack itself keeps changing,” he added.

Rapid7 researchers fittingly describe this type of implant as “sleeper cells” – waiting to spring into action when called, but otherwise laying dormant and blending into the environment. When triggered, BPFdoor spawns a bind shell or reverse shell.

The researchers have analyzed a number of BPFdoor samples and have discovered that older and newer variants:

  • Use code to masquerade as legitimate system services that run bare-metal infrastructure commonly deployed in telecom environments
  • Spoof core containerization components
  • Are capable of monitoring telecom-native protocols such as the Stream Control Transmission Protocol
  • Don’t just rely on magic packets to spring into action, but can also be triggered with packets embedded within seemingly legitimate (encrypted) HTTPS traffic
  • Use older or non-standard encryption routines to confuse inspection systems
  • Use specially crafted Internet Control Message Protocol (ICMP) payloads to signal back to the operator, but also to pass execution instructions from one compromised host to another

These techniques targets different security boundaries, “from TLS inspection at the edge to IDS detection in transit and endpoint monitoring on the host, illustrating a deliberate effort to operate across the full defensive stack,” the researchers pointed out.

A BPFDoor detection script

BPFdoor isn’t the only “magic packet” malware out there: there’s the SEASPY backdoor targeting Barracuda Networks’ Email Security Gateway appliances, and the J-magic backdoor that’s been loaded by attackers into enterprise-grade Juniper router.

Symbiote, a Linux userland-level rootkit/backdoor, is also capable of kernel packet filtering and hiding malicious network traffic from packet capture tools.

In complex and noisy telecom environments, implants like BPFdoor are difficult to catch as – according to Rapid7 – many organizations lack visibility into kernel-level operations, raw packet filtering behavior, and anomalous high-port network activity on Linux systems.

Company researchers have therefore created a scanning script designed to detect known/analyzed BPFDoor variants across Linux environments, and are offering it to defenders.

“The script is highly effective at identifying known patterns and behaviours we’ve validated in real samples,” Beek told us. That said, it can miss highly stealthy or evolving variants and may flag unusual but legitimate activity, so it should be used as part of a broader detection strategy.

Unfortunately, the point of this type of threat is that organizations can’t be 100% certain that they’ve removed them all. “These threats shift the conversation from ‘Did we remove it?’ to ‘Do we have enough visibility to trust the system again?’,” he added.

As their research is ongoing, Rapid7 may or may not create a detection tool for similar threats like Symbiote.

“Rather than chasing individual malware families, we’re focusing on detecting the underlying techniques such as kernel-level stealth and covert network behaviour across multiple threats,” Beek concluded.

Subscribe to our breaking news e-mail alert to never miss out on the latest breaches, vulnerabilities and cybersecurity threats. Subscribe here!



Source link