I Am Become Loadbalancer, Owner of Your Network

Nate Warfield (Director of Research · Eclypsium)

BruCON 0x0E · Day 1

Overview

In his BruCON 2022 talk, "I Am Become Loadbalancer, Owner of Your Network," Nate Warfield, Director of Research at Eclypsium, unveils sophisticated post-exploitation techniques targeting F5 Big-IP devices. Warfield, a former F5 employee, meticulously details how these critical network appliances, often considered black boxes by organizations, can be compromised to establish stealthy, persistent footholds within enterprise networks. The talk serves as a stark warning about the overlooked security posture of load balancers and other network infrastructure, demonstrating that common defensive strategies are often insufficient against determined adversaries.

Watch on YouTube · Slides

Visual summary for I Am Become Loadbalancer, Owner of Your Network by Nate Warfield
Visual summary for I Am Become Loadbalancer, Owner of Your Network by Nate Warfield

Key moments

  1. 3:00 Motivation: Load balancer vulnerabilities impact hospitals
  2. 5:30 Mandiant report inspires F5 research
  3. 21:30 F5 design flaws enable deep implants
  4. 23:35 Demo: C2 callback via syslog message
  5. 34:50 Demo: Pivoting to Windows server via F5
  6. 35:40 Demo: Abusing F5 iRules to redirect traffic
  7. 37:00 How to build your own F5 hacking lab

I Am Become Loadbalancer, Owner of Your Network

Speakers: Nate Warfield

Conference: BruCON

YouTube: https://www.youtube.com/watch?v=-a6rogNn2jc

Overview

In his BruCON 2022 talk, "I Am Become Loadbalancer, Owner of Your Network," Nate Warfield, Director of Research at Eclypsium, unveils sophisticated post-exploitation techniques targeting F5 Big-IP devices. Warfield, a former F5 employee, meticulously details how these critical network appliances, often considered black boxes by organizations, can be compromised to establish stealthy, persistent footholds within enterprise networks. The talk serves as a stark warning about the overlooked security posture of load balancers and other network infrastructure, demonstrating that common defensive strategies are often insufficient against determined adversaries.

The presentation is particularly timely, building on recent threat intelligence, including a Mandiant report detailing the activities of UNC 3524, a cyber espionage group known for targeting network devices like F5 Big-IPs. Warfield critiques the observed, often unsophisticated, persistence methods used by such groups and showcases how to achieve far more robust and covert control over these devices. His research highlights the significant risk posed by compromised load balancers, which sit at the heart of network traffic, offering unparalleled opportunities for data interception, traffic manipulation, and internal network pivoting.

The talk is crucial for both offensive and defensive security professionals. For pen-testers and red teams, it provides a comprehensive playbook for exploiting F5 devices, detailing discovery, initial access, persistence, evasion, and internal lateral movement. For defenders and blue teams, it offers critical insights into the tactics, techniques, and procedures (TTPs) that advanced adversaries might employ, urging a re-evaluation of security monitoring and incident response strategies for these often-neglected network workhorses. Warfield's personal motivation, stemming from his experience with the CTI League helping hospitals during the 2020 ransomware crisis, underscores the real-world impact of these vulnerabilities.

Background

▶ Watch: Motivation: Load balancer vulnerabilities impact hospitals (3:00)

F5 Big-IP devices are ubiquitous in large enterprises, serving as critical infrastructure for an estimated 400 of the Fortune 500 companies, including major banks, telecommunication providers, and government entities. These high-end appliances, costing anywhere from $90,000 to $750,000 per unit, function as the "Swiss Army knife of networking," offering a wide array of services such as Layer 4-7 load balancing, web application firewall (WAF) capabilities, DNS load balancing, and TLS offloading. Their central placement in the network, often with unfettered access to internal resources, makes them incredibly valuable targets for attackers.

Despite their critical role, F5 devices often suffer from a lack of diligent security management. Organizations frequently leave them unpatched for extended periods due to the complexity and perceived risk of upgrading, which can take up to 1.5 years for certification in large environments like Microsoft's. Furthermore, these proprietary systems typically lack Endpoint Detection and Response (EDR) software, leaving them blind spots in an organization's security monitoring. The underlying operating system, Centos Linux, is often treated as a black box, with administrators assuming vendor-level security.

Historically, F5 Big-IPs have been subject to significant vulnerabilities:

  • SSH Private Key Disclosure: An early critical flaw involved an SSH public-private key pair left in an ISO image, allowing root access to any F5 device with an open SSH port.
  • 2020 Path Traversal (CVE-2020-5902): This severe vulnerability, a path traversal issue similar to those seen in Citrix NetScaler and Fortigate devices, allowed remote code execution (RCE). Warfield notes that such vulnerabilities were publicly discussed in talks by researchers like "orange side" at Black Hat 2018, yet many organizations failed to heed the warnings. The exploit, remarkably concise, could fit within a tweet.
  • 2022 Remote Code Execution (CVE-2022-1388): A more recent and "beautiful" RCE vulnerability exposed an unauthenticated JSON endpoint, again allowing for command execution. Like its 2020 predecessor, this exploit was compact enough to fit in a tweet, highlighting its simplicity and potency. All these significant vulnerabilities targeted the management interfaces, which are frequently exposed to the internet.

Warfield's motivation for this research stems from two key experiences. First, his involvement with the CTI League in 2020 revealed the pervasive threat of load balancer vulnerabilities when he discovered exposed and vulnerable Citrix devices on his local hospital's network. Second, a 2022 Mandiant report detailing the UNC 3524 cyber espionage group caught his attention. This alleged Russian state-sponsored actor was observed compromising network devices, including SAN arrays and load balancers, to gain initial access and maintain persistence. Mandiant noted that these devices ran Centos or BSD, strongly implying F5s. However, Warfield found their reported persistence methods — primarily dropping a modified dropbear SSH client with a hard-coded password and relying on unreliable RC script modifications — to be surprisingly inept for an advanced threat actor, lacking true robustness against reboots or upgrades. This observation spurred Warfield to challenge himself: "I bet you I could do better."

Key Findings

▶ Watch: F5 design flaws enable deep implants (21:30)

Warfield's research uncovers several critical insights into the security posture of F5 Big-IP devices and how they can be exploited for advanced post-exploitation scenarios:

  • Ubiquitous and Neglected Targets: F5 devices are deeply embedded in critical infrastructure, serving a vast number of major corporations. Despite their strategic network position and the sensitive data they handle, they are often treated as black boxes, receiving less security scrutiny and patching diligence than traditional servers or workstations.
  • Blurred Management and Data Planes: By default, F5 devices can enable management interfaces on traffic-facing self-IPs. This architectural choice blurs the line between the secure management network and the public-facing data network, providing attackers with unexpected avenues for management access once the device is compromised. Furthermore, the management plane can leverage the traffic plane's routing table, allowing malware on the management OS to initiate outbound connections through the data network, bypassing typical segmentation controls.
  • Robust, Documented Persistence Mechanisms: F5's own documentation details methods for running arbitrary scripts at various system events, including device boot (config startup), failover state changes, and even specific syslog messages (user_alert.conf). These features, intended for legitimate automation, provide attackers with powerful, built-in mechanisms to achieve highly persistent code execution that can survive reboots, firmware upgrades, and even re-imaging.
  • Configuration Backup Abuse: The F5 configuration backup process creates a tarball of the entire /config directory. Critically, this process does not differentiate between system files and arbitrary user-created files. This allows attackers to embed their malicious scripts or links to malware within the /config directory, ensuring they are included in backups and subsequently restored onto new boot locations or replacement devices during upgrades, effectively achieving persistence that is extremely difficult to remove.
  • iRules Engine for Traffic Manipulation: The embedded TCL/TK interpreter, known as iRules, allows real-time inspection and manipulation of network traffic at wire speed. This capability, designed for advanced load balancing decisions and traffic shaping, can be repurposed by attackers to inject malicious content into web pages, redirect users, or intercept sensitive data flowing through the device.
  • Stealth and Evasion: Warfield demonstrates how attackers can achieve a high degree of stealth by disabling syslog, disguising malware processes with legitimate-sounding names (e.g., rest_javad), timestamping malicious binaries to match system files, and leveraging F5's lack of logging for interface ACL changes. These techniques allow implants to operate undetected for extended periods.
  • Superiority over Observed APTs: Warfield successfully demonstrates that more sophisticated and persistent attack methods are readily achievable on F5 Big-IPs than those reportedly used by groups like UNC 3524, highlighting a significant gap between observed adversary capabilities and potential ones.

Technical Deep Dive

▶ Watch: Demo: C2 callback via syslog message (23:35)

Warfield’s research delves into the intricate architecture of F5 Big-IP devices to exploit their fundamental design. At its core, an F5 device separates its functions into a management plane and a traffic plane. The management plane runs on a customized Centos Linux environment, providing administrative access via GUI, SSH, and a proprietary command-line interface (tmsh). The traffic plane handles Layer 4-7 network flows, leveraging specialized hardware and a full-proxy architecture, often employing iRules for advanced traffic manipulation.

Initial access is typically gained via vulnerabilities in the management interface, such as the 2022 remote code execution (RCE) against a JSON endpoint (CVE-2022-1388). Once an attacker gains a shell on the Centos Linux management OS, they face a few environmental constraints: it runs Python 2 (limiting modern tooling), lacks compilers by default, and user-space filesystems are often mounted read-only. However, these are surmountable. The Centos environment is fully functional, with a large hard drive, meaning attackers aren't constrained by space. The crucial directory for all configuration and persistence is /config.

Discovery and Reconnaissance:

Upon initial compromise, attackers can leverage embedded commands to gain extensive network intelligence. Similar to Cisco Discovery Protocol (CDP), F5 devices share information about their peers. Commands can reveal:

  • Details about redundant F5 devices in a high-availability pair (e.g., big-ip2).
  • Internal IP addresses and subnet masks of all connected network interfaces.
  • Authentication protocols configured.
  • TLS certificates and private keys, often stored in cleartext on the filesystem, which can be exfiltrated.

Attackers can also use Shodan queries (e.g., searching for the big-ip Server cookie) to identify backend IPs and ports, even before gaining access, revealing the internal network topology behind the load balancer.

Persistence Mechanisms:

Warfield highlights several highly effective, built-in persistence mechanisms:

  1. config startup: This script, located in /config/startup, executes every time the F5 device boots. By injecting malicious commands here, an attacker can ensure their implant starts automatically.
  2. Failover Scripts: The /config/failover directory contains scripts that run when the device transitions between active and standby states. This is ideal for maintaining persistence across high-availability events.
  3. user_alert.conf: This file, part of the syslog configuration, allows administrators to define custom actions (including executing scripts) when specific syslog messages are logged. This provides a unique event-driven persistence trigger.
  4. Configuration Backup Abuse: The F5 backup process creates a tarball of the entire /config directory. Any malicious scripts placed within this directory, or linked from it, will be included in the backup. When a device is upgraded (which involves laying down a fresh OS copy to a new boot location and then restoring the config) or replaced, the malicious payload is automatically restored, achieving incredibly robust persistence across upgrades and re-imaging.

Stealth and Evasion:

To avoid detection, Warfield employs several techniques:

  • Disabling Syslog: A primary step is to turn off syslog reporting on the compromised device to prevent logging of malicious activities.
  • Disguised Process Names: The malware implant is launched with a name chosen to mimic existing F5 daemons, such as rest_javad, which appears in process lists but has no actual running process. This blends the implant into legitimate system activity.
  • Timestamp Spoofing: After downloading and installing the malware (e.g., in /usr/bin after remounting the filesystem read-write), its timestamp is modified to match other legitimate system binaries in the same directory. This makes it harder for defenders to spot newly created or modified files.
  • Randomized Sleep: The runner script includes a random sleep interval before checking for and starting the implant, preventing multiple instances from running simultaneously and reducing suspicious CPU spikes.
  • Unlogged ACL Changes: Changes to interface Access Control Lists (ACLs) are not logged or alerted on, allowing an attacker to open ports for their implant without raising suspicion.

Network Pivoting and iRules Abuse:

The F5 device, by virtue of its position and network access, makes an excellent pivot point. Attackers can:

  • Bind C2 Listeners: The Sliver C2 implant can bind a pivot listener to any system IP on the F5, including self-IPs on traffic-facing VLANs. This allows internal systems to communicate with the external C2 server through the F5, effectively bypassing firewalls.
  • Internal Reconnaissance: From the compromised F5, attackers can use tools like Metasploit's port scan modules to map internal networks, discovering other vulnerable hosts (e.g., Windows servers vulnerable to MS17-010).
  • iRules for Traffic Manipulation: The iRules engine allows for real-time manipulation of HTTP, TLS, and TCP traffic. An attacker can create or modify an iRule to:
  • Inject malicious JavaScript into web pages.
  • Redirect users to phishing sites.
  • Exfiltrate sensitive data from HTTP requests or responses.
  • Modify content served by legitimate applications.

Crucially, changes to iRules that affect load balancing configuration will trigger an "out of sync" alarm between redundant F5s. However, simpler iRules or non-load balancing related changes might not trigger immediate alerts, especially if syslog is disabled.

Demo / Proof of Concept

▶ Watch: Demo: Abusing F5 iRules to redirect traffic (35:40)

Warfield's demonstration vividly illustrates the advanced post-exploitation capabilities on F5 Big-IP devices. The demo unfolds in a lab environment featuring two F5s (big-ip1 and big-ip2) in a high-availability pair, and an internal Windows Server.

  1. Initial Compromise and Evasion:
  • Warfield begins by showcasing poor operational security: big-ip1 is exposed to the internet.
  • Using the 2022 remote code execution (RCE) against the F5's JSON endpoint, he gains a shell on big-ip1.
  • Immediately, he executes a command to disable syslog on big-ip1, preventing logs of subsequent malicious activity.
  1. Discovery and Lateral Movement (F5 to F5):
  • From the compromised big-ip1, embedded F5 commands are used to discover its peer device, big-ip2, revealing its IP addresses and network interfaces. This demonstrates how an attacker can map the F5 cluster from a single point of compromise.
  • Syslog is then disabled on big-ip2 as well, extending stealth across the entire F5 cluster.
  1. Implant Deployment and Persistence:
  • Warfield deploys the Sliver C2 implant. On big-ip1, the full exploit is used to load and start the implant, establishing a command and control (C2) session.
  • On big-ip2, the implant is downloaded, and persistence files (the runner script disguised as rest_javad) are written to the failover scripts and config startup locations. The implant is not immediately started on big-ip2 to demonstrate failover persistence.
  • The runner script handles mounting the user filesystem read-write, downloading the 15MB Sliver C2 binary, timestamping it to blend with system files in /usr/bin, and then remounting the filesystem read-only.
  • Crucially, the F5's high-availability status remains "in sync," indicating no immediate alarms are raised.
  1. Network Pivoting and Internal Lateral Movement:
  • A Sliver C2 pivot listener is set up on big-ip1, binding to one of its system IPs. Firewall rules are added to allow traffic, again without logging or alerting. This transforms the F5 into a secure tunnel for internal access.
  • Using Metasploit channeled through the F5 pivot, Warfield performs a port scan of the internal network, discovering a Windows Server.
  • He then exploits the Windows Server using MS17-010 (the WannaCry vulnerability), which he previously helped patch during his time at Microsoft. A Sliver C2 implant is uploaded to the Windows Server (pre-staged for demo speed) and started. This implant pivots its C2 traffic back through the F5 to the external attacker, demonstrating multi-hop pivoting through the compromised load balancer.
  1. iRules Abuse and Persistence Validation:
  • Warfield creates a malicious iRule designed to redirect traffic from goodguy.com to badguy.com.
  • Upon saving the iRule, the F5s briefly display "changes pending," indicating a configuration change. A config sync command is then issued to bring them back "in sync," making the change appear legitimate.
  • A user attempting to access goodguy.com is now redirected to badguy.com, demonstrating the real-time traffic manipulation capabilities of iRules.
  • To validate persistence, Warfield initiates a failover from big-ip1 to big-ip2. As big-ip2 becomes active, its pre-planted Sliver C2 implant activates, and the malicious iRule remains in effect, proving the robustness of the chosen persistence methods across state changes and even potential upgrades/re-imaging.

The demo effectively highlights how an attacker can gain deep, stealthy control over F5 Big-IP devices, pivot into internal networks, and manipulate critical application traffic, all while evading typical monitoring.

Defensive Implications

▶ Watch: How to build your own F5 hacking lab (37:00)

Nate Warfield's research offers critical insights for defenders grappling with the security of F5 Big-IP devices. Given their strategic position and common neglect, these appliances demand a more proactive and nuanced defensive strategy:

  • Treat F5s as Critical Endpoints: Organizations must stop viewing F5 Big-IPs as unmonitored black boxes. They are powerful Centos Linux servers running critical software and must be integrated into the broader security monitoring strategy. This includes monitoring for unusual process execution, unexpected network connections originating from the management interface, and significant changes in disk usage or file sizes, particularly within the /config directory.
  • Strict Network Segmentation: Re-evaluate and enforce strict network segmentation. The default behavior of enabling management interfaces on traffic-facing self-IPs is a significant risk. Management interfaces should be isolated on a dedicated, highly restricted management network, physically or logically separated from the data plane and the internet. Review existing configurations to ensure this default behavior has been explicitly disabled where not intended.
  • Robust Patch Management: Despite the complexity and testing overhead, a dedicated and aggressive patch management strategy for F5 devices is paramount. Outdated software versions are consistently the entry point for known vulnerabilities, as demonstrated by the 2020 and 2022 RCEs. Prioritize patching management plane vulnerabilities.
  • Configuration Integrity Monitoring: Implement integrity monitoring for critical configuration files and directories. Specifically, monitor /config/startup, /config/failover/*, /config/user_alert.conf, and the entire /config directory for any unauthorized modifications. Tools that track file hashes or content changes can detect malicious injections. Pay attention to the size of configuration backups; a sudden, unexplained increase could indicate embedded malware.
  • Review iRules and Custom Scripts: Regularly audit all iRules and custom scripts deployed on F5 devices. Any iRule that performs traffic manipulation, redirection, or content injection should be scrutinized. Similarly, review any scripts configured to run on boot, failover, or syslog events for malicious payloads.
  • Enhanced Logging and Alerting: While attackers may disable syslog, defenders should have external syslog collectors and SIEM systems configured to ingest F5 logs. Monitor for syslog service shutdowns, unusual process starts, and any changes that might indicate iRule or configuration modifications, even if the F5's internal logging is tampered with. Configure SNMP traps and other out-of-band alerts for critical configuration changes or device state transitions.
  • No EDR, but still Monitor for Anomalies: Although traditional EDR doesn't run on F5s, defenders can look for behavioral anomalies. Monitor for processes with unusual CPU or memory usage, network connections to unknown external IPs from the management interface, and suspicious binaries in system directories (e.g., /usr/bin), even if timestamps are spoofed. Regular comparisons of filesystem contents against known good baselines can help.
  • Validate Backup Contents: When performing disaster recovery or upgrades, always validate the integrity and contents of configuration backups before restoring them. Assume that a compromised backup could re-infect a clean device.
  • Leverage Threat Intelligence: Stay informed about APTs (like UNC 3524) and their TTPs targeting load balancers and other network infrastructure. Understanding how adversaries operate on these devices can guide defensive priorities.

By moving beyond a "set and forget" mentality, organizations can significantly improve their security posture against sophisticated attacks targeting F5 Big-IP devices.

Key Takeaways

  • F5 Big-IP devices are prime targets for advanced adversaries due to their central network position, access to sensitive data, and common lack of dedicated security monitoring.
  • Attackers can establish robust, stealthy persistence on F5s that survives reboots, firmware upgrades, and even device re-imaging by abusing built-in features like config startup, failover scripts, user_alert.conf, and the configuration backup mechanism.
  • The F5's architecture allows attackers to blur the lines between management plane and traffic plane, enabling internal network pivoting, bypassing segmentation, and real-time manipulation of application traffic via iRules.
  • Observed APT groups often use relatively unsophisticated persistence methods; more advanced and covert techniques, as demonstrated by Warfield, are readily achievable, highlighting a gap between current threat intelligence and potential adversary capabilities.
  • Defenders must actively monitor and secure F5 devices, treating them as critical endpoints rather than unmonitored black boxes. This includes strict network segmentation, diligent patching, configuration integrity checks, and comprehensive logging.
  • Setting up a fully functional F5 Big-IP lab environment is straightforward using virtual editions and trial licenses, providing an accessible platform for security research and defensive testing.

About the Speaker(s)

Nate Warfield is a distinguished security researcher with a diverse background in both offensive and defensive security. He is currently the Director of Research at Eclypsium, a company specializing in firmware security. Warfield is one of the founders of the CTI League, an organization of infosec volunteers formed in 2020 to help hospitals combat ransomware attacks, a critical initiative that earned recognition in Wired Magazine.

His extensive industry experience includes a decade at F5, where he gained deep insights into the architecture and functionality of their products, which he candidly admits might not make them "too thrilled" about his talk. Prior to that, he spent seven years at Microsoft, notably contributing to the release of Patch Tuesday updates, and holds the "dubious honor" of having shipped MS17-010, the patch for the vulnerability later exploited by WannaCry. Warfield self-identifies as primarily having a defensive background, not a traditional red teamer, emphasizing that if he can uncover these exploitation methods, then others with more dedicated offensive expertise certainly can. His passion for network hacking dates back to his teenage years.

Reviews

  • Heather Calloway (CISO) — MUST SEE ★★★★★

→ Top-rated talks at BruCON 0x0E

All talks from BruCON 0x0E