Skip to content

DEF CON 34 talks are here: 354 talks, summarized and searchable.

Browse DEF CON 34

Building Better Backdoors Than China

Khael Kugler

Where

Packet Hacking Village
DEF CON 34

Duration

37 min

Shows how a Linux implant can hide a bidirectional command channel inside spoofed TCP responses on any open port, even when firewall rules block outbound traffic.

Summary

The talk opens with a red-team scenario drawn from collegiate defense competitions, where an attacker loses their usual callback channel after a sysadmin blocks inbound ports and stateful outbound traffic. The speaker surveys familiar persistence options, including user-level backdoors, service-specific backdoors and cloud-hosted beacons, and explains why each one tends to break down under those restrictions.

The core idea is a proof-of-concept implant called PhantomShell. It attaches a raw packet socket with a BPF filter, watches inbound TCP frames for marker bytes, runs the embedded command, then builds a matching TCP response from scratch using the incoming packet's headers and sequence values. Because the reply resembles the service's own answer, it passes as stateful traffic even when outbound rules are locked down. A live demo against a cloud instance with outbound access disabled produced an interactive shell. The speaker also showed that the extra response can confuse clients such as Firefox, and that an attacker-side sniffer can simply ignore the duplicate packet.

For defenders, the main takeaways are that local host firewalls do little against raw-socket capture, that socket and process inspection can expose the implant, and that central monitoring for duplicate or spurious TCP responses may be the most practical detection signal. The speaker notes that this is a persistence technique rather than an evasion breakthrough, and that the detection side remains a cat-and-mouse problem.

Materials

Related talks