Mirror on the wall: using blue team techniques in red team ops

Mark Bergman, Marc Smeets (Co-founder · Outflank)

BruCON 0x0A · Day 3

Overview

In this BruCON 2018 talk, "Mirror on the wall: using blue team techniques in red team ops," Mark Bergman and Marc Smeets from Outflank present a compelling argument for evolving red team methodologies. They advocate for a shift from a "no-limits wrecking ball" approach to one that mirrors a "sparring match," where the goal is to help the blue team improve their detection and response capabilities. Central to this philosophy is the innovative application of blue team monitoring techniques—specifically, adapting the ELK stack (Elasticsearch, Logstash, Kibana) for red team operations to create RedELK.

Watch on YouTube

Visual summary for Mirror on the wall: using blue team techniques in red team ops by Mark Bergman, Marc Smeets
Visual summary for Mirror on the wall: using blue team techniques in red team ops by Mark Bergman, Marc Smeets

Key moments

  1. 0:00 Talk Introduction: Blue team techniques in red team ops
  2. 2:30 Red Teaming: Sparring vs. Wrecking Ball Philosophy
  3. 8:00 Core Red Team Infrastructure Components Explained
  4. 18:00 Introducing Red ELK: A SIEM for Red Teams
  5. 32:00 Red ELK Interface Live Demonstration
  6. 38:00 Detecting Blue Team Activities and OPSEC Mistakes
  7. 44:00 RedFile: Deceiving Blue Teams with Dynamic Content
  8. 48:00 Key Takeaways: Boxing, Red ELK, and Blue Team OPSEC

Mirror on the wall: using blue team techniques in red team ops

Speakers: Mark Bergman; Marc Smeets (Co-founder, Outflank)

Conference: BruCON

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

Overview

In this BruCON 2018 talk, "Mirror on the wall: using blue team techniques in red team ops," Mark Bergman and Marc Smeets from Outflank present a compelling argument for evolving red team methodologies. They advocate for a shift from a "no-limits wrecking ball" approach to one that mirrors a "sparring match," where the goal is to help the blue team improve their detection and response capabilities. Central to this philosophy is the innovative application of blue team monitoring techniques—specifically, adapting the ELK stack (Elasticsearch, Logstash, Kibana) for red team operations to create RedELK.

The speakers highlight the increasing complexity of modern red team infrastructure and the need for better operational control and situational awareness. Their solution, RedELK, provides centralized logging, enrichment, and analysis of red team command and control (C2) and traffic data. This allows red teams to not only manage their own operations more effectively but, crucially, to detect when and how blue teams are responding to their activities. By observing blue team actions, such as uploading samples to public analysis services or scanning C2 infrastructure, red teams can adapt their tactics, throw decoys using a tool called RedFile, and ultimately enhance the learning experience for the defending team.

This talk is significant because it challenges conventional red team wisdom, emphasizing that a red team engagement without detection is a failure for both sides. By providing red teams with "blue team eyes," Bergman and Smeets empower them to engage in more realistic, adaptive, and educational simulations. The open-sourcing of RedELK further underscores their commitment to elevating the entire security community's capabilities, fostering a more mature and effective approach to offensive and defensive security exercises.

Background

▶ Watch: Talk Introduction: Blue team techniques in red team ops (0:00)

Traditionally, many perceive red teaming as a "full no-limits wrecking ball" engagement, where every means necessary is employed to achieve the objective, often resulting in a complete knockout for the blue team. While this approach can demonstrate impact, it frequently falls short in delivering meaningful learning effects for the defenders. Outflank, the company founded by Marc Smeets, champions a fundamentally different philosophy: red teaming as a sparring match. In this model, real punches are thrown, and the attacks are genuine, but the engagement is tuned to the blue team's maturity level, designed to accelerate their expertise and bring them up a level. This contrasts with more efficient but less realistic services like penetration testing, or even purple teaming, by prioritizing realism and exercise over pure assessment.

The speakers assert that a red team engagement with no detection is a failure, not a success. If the blue team isn't challenged and doesn't detect the adversary, the opportunity for learning and improvement is lost. This perspective is increasingly relevant as blue teams mature, adopting advanced strategies like "assume compromise," which shifts focus from solely external perimeter defense to also securing the internal network. Furthermore, the concept of an "attacker's playground"—where blue teams set up internal traps to catch adversaries—highlights the evolving landscape.

However, this increased blue team maturity also places greater demands on red teams. Operations are becoming more complex, involving multiple scenarios, larger infrastructures, and multi-team member engagements. A typical red team infrastructure, as described, extends far beyond a simple Kali Linux laptop. It involves:

  • Backend C2 servers: Often running tools like Cobalt Strike, PowerShell Empire, or Pupy, serving as the central hub for operations.
  • Redirectors: Disposable virtual private servers (VPSs) acting as a crucial layer between the target and the C2, obfuscating the true origin of the attacks. These are often highly dynamic and can be spun up and down rapidly.
  • Social engineering infrastructure: Including LinkedIn identities or email accounts for initial contact.
  • VPNs: Essential for red team operators to mask their own browsing activity when researching targets.
  • Multifunctional redirectors: Going beyond simple forwarding to host web-based file servers, facilitate HTML smuggling (assembling documents on the victim's browser to bypass proxies), and embed tracking pixels in emails and documents. These pixels provide crucial telemetry on email opens, document views, and macro execution, acting as a "remote debugger" for the red team.

The growing complexity of these infrastructures, often spanning multiple scenarios and clients, generates a vast amount of scattered log data. This data—from C2 beacons, redirector traffic, and operational commands—is difficult to correlate, search historically, and analyze efficiently. Red team operators face the tedious task of SSHing into multiple machines and grepping through logs to find specific information, making it challenging to maintain situational awareness, enrich data, or provide auditability to a white team. This problem, the speakers realized, is one that blue teams have already largely solved with SIEM solutions, leading them to adapt these blue team techniques for offensive operations.

Key Findings

▶ Watch: Core Red Team Infrastructure Components Explained (8:00)

The talk's central findings revolve around addressing the growing complexity and operational blind spots within red team engagements by borrowing and adapting established blue team methodologies. The key findings are:

  1. Red Teaming Needs a Methodological Shift: The traditional "wrecking ball" approach to red teaming is often ineffective for improving blue team capabilities. A "sparring" approach, focused on detection, learning, and adaptation, is far more beneficial. This necessitates red teams having better visibility into their own operations and the blue team's responses.
  1. Blue Team Techniques are Adaptable for Red Teams: The core problem of aggregating, correlating, and analyzing disparate log data from complex, distributed systems is common to both blue and red teams. The speakers realized that blue team solutions like the ELK stack (Elasticsearch, Logstash, Kibana) could be repurposed to provide red teams with crucial operational intelligence.
  1. Introduction of RedELK: This is the primary contribution: an open-source, ELK-based SIEM for red teams. RedELK centralizes all relevant operational and traffic logs from red team infrastructure (specifically Cobalt Strike and HAProxy), performs detailed filtering and enrichment, and provides a Kibana interface for real-time dashboards and historical searching. This solves the problem of scattered logs and poor situational awareness, enabling better decision-making and post-engagement reporting.
  1. Detection of Blue Team Activity is Possible and Crucial: By monitoring their own infrastructure logs within RedELK and integrating with external Indicator of Compromise (IOC) sources (like Virustotal, IBM X-Force, and GrayNoise), red teams can actively detect when the blue team is analyzing their payloads, scanning their C2 infrastructure, or otherwise responding to the attack. This "mirror on the wall" capability allows red teams to understand blue team OPSEC mistakes and adapt their operations dynamically.
  1. Dynamic Decoys (RedFile) Enhance Red Team Adaptability: To counter blue team detection, the talk introduces RedFile, a lightweight Python module that enables red teams to serve dynamic content from their redirectors. This allows them to present different payloads or decoys based on specific request parameters (e.g., user agent, query count, time of day), effectively misdirecting blue teams and prolonging engagements for maximum learning.

These findings collectively present a more sophisticated and effective model for red teaming, one that prioritizes continuous learning and adaptation for both offensive and defensive teams.

Technical Deep Dive

▶ Watch: Red ELK Interface Live Demonstration (32:00)

The technical core of this talk revolves around RedELK, an open-source ELK stack implementation tailored for red team operations. Its architecture is designed to centralize, enrich, and visualize diverse log data from a distributed red team infrastructure.

At its foundation, RedELK utilizes Filebeat, a lightweight data shipper, installed on all redirectors and Cobalt Strike team servers. Filebeat is configured to collect all relevant operational and traffic logs and forward them to a central Logstash instance. Logstash acts as the processing engine, performing heavy filtering and enrichment before indexing the data into Elasticsearch. Finally, Kibana provides the graphical user interface for real-time dashboards, historical searching, and visualization. A second data copying stream is also implemented to centralize raw data like screenshots and keylogger outputs for easy access via simple hyperlinks in Kibana.

A significant challenge addressed by RedELK is the parsing of Cobalt Strike logs. Unlike standard syslog formats, Cobalt Strike logs are highly idiosyncratic:

  • Multi-line and Variable Format: Beacon transcripts, for example, are multi-line, and each line can have a different structure.
  • Metadata Distribution: Crucial metadata (IP address, hostname, username, architecture, beacon ID) is often only present on the first line of a multi-line log entry. RedELK's Logstash configuration meticulously extracts this metadata and then injects it into every subsequent line of the same log entry, ensuring that every record is fully enriched and searchable.
  • Diverse Log Types: Cobalt Strike generates various log types, including beacon transcripts (full session input/output), screenshots, keylogger outputs, a central event log, and failed beacon logs. RedELK processes the most relevant ones, filtering out less useful logs like generic web server logs (as HAProxy is preferred for web traffic) and download logs (as downloads are already captured in beacon transcripts). The speakers emphasize that they avoid using Cobalt Strike's internal web server functionality, preferring HAProxy for more granular control and logging.

For HAProxy logs, RedELK leverages the proxy's custom logging formats to capture comprehensive details, including the full user agent and request body, which are critical for identifying blue team activity. HAProxy redirectors are configured to differentiate between legitimate C2 traffic, destined for Cobalt Strike, and other "noise" or investigative traffic. This allows for intelligent routing; for instance, a generic request might be sent to a decoy server, while a specific beacon call goes to the C2. The logs also filter out IPv6 "ffff" prefixes that Linux often includes when IPv6 is enabled, streamlining the data.

Log enrichment is a cornerstone of RedELK's analytical power:

  • GeoIP, Reverse DNS, IP Block Owner: For external traffic, RedELK performs lookups to identify the geographical location, reverse DNS, and the owner of the connecting IP block. This is crucial for identifying scanning services like Symantec or suspicious IP ranges.
  • System Classification and Tags: Internal processes classify and tag systems as known test systems, sandboxes, Tor nodes, IP addresses belonging to the customer's network, or the red team's own IP space. This allows for easy filtering of internal testing noise and prioritization of suspicious external connections.
  • GrayNoise Integration: RedELK integrates with GrayNoise, a service that indexes internet-wide scanners (e.g., Shodan, Google, vulnerability scanners). If an incoming IP address is identified by GrayNoise as a generic scanner, RedELK can tag it as "not interesting," allowing red teams to focus on unknown or potentially blue team-related scanning activity.

The Kibana interface provides intuitive dashboards and querying capabilities:

  • Operational Dashboards: Overview of active beacons, historical beacon activity (last 30 days), specific user/system selections.
  • Traffic Dashboards: Global maps of traffic, distinguishing between C2 traffic and decoy traffic.
  • Quick Queries: Predefined links for common searches like IOCs, keystrokes, and screenshots.
  • Screenshot Viewer: A centralized gallery of screenshots from all team servers, with thumbnails and full image views, eliminating the need to log into individual servers.
  • Full Transcripts: Direct links from beacon overviews to the complete transcript of a specific beacon session, providing full context of commands and outputs.

Beyond its core ELK functionality, RedELK enables blue team detection through several mechanisms:

  • Monitoring Unusual Traffic: RedELK's enriched logs highlight connections from unexpected sources (e.g., Tor nodes, known security vendors like Symantec, unusual user agents).
  • External IOC Source Querying: RedELK includes Python scripts to query public services like Virustotal and IBM X-Force for hashes of red team payloads. While these services have rate limits (e.g., IBM X-Force allows 500 queries/day but 404 responses for unknown hashes are free), proper caching and strategic querying allow red teams to detect if their payloads have been uploaded for analysis. GrayNoise also contributes by identifying general internet scanners, allowing red teams to quickly filter out benign noise and focus on potentially targeted reconnaissance.
  • Blue Team OPSEC Mistakes: RedELK helps identify common blue team errors, such as uploading red team samples to public analysis services, manual visits to C2 URLs with distinct browser user agents (e.g., Firefox from an investigator's machine), or playing around with payloads in unexpected environments (e.g., off-hours, unusual IP ranges).

Demo / Proof of Concept

▶ Watch: Detecting Blue Team Activities and OPSEC Mistakes (38:00)

During the presentation, the speakers provided a live demonstration of RedELK's capabilities through its Kibana interface, showcasing how it centralizes and visualizes red team operational data.

The demo began with a general overview of the RedELK dashboard, highlighting a clean, customized interface featuring a distinct "RedELK" logo. Users can navigate to various Kibana dashboards, such as one displaying current and historical beacons over a selectable timeframe (e.g., the last 30 days). This dashboard allows filtering by specific users or systems and was shown populated with data from test beacons generated against public scanners like Virustotal. Another dashboard focused on traffic analysis, featuring a global map to visualize connection origins and differentiate between traffic destined for Cobalt Strike C2 and other decoy traffic.

The most impactful part of the demo illustrated RedELK's utility for operational awareness and post-engagement analysis:

  • IOCs and Keystrokes: The interface provided quick access links to query for Indicators of Compromise and captured keystrokes.
  • Detailed Beacon Transcripts: Clicking on a specific beacon in the overview would instantly display its full transcript, including the timestamp, operator, target details (IP, hostname, user, OS version), and every command entered with its output. This eliminates the need to manually search through scattered log files.
  • Screenshot Gallery: A highly practical feature demonstrated was the centralized screenshot view. Instead of logging into multiple team servers, operators could browse a gallery of thumbnails from all captured screenshots. Clicking on a thumbnail would display the full image, allowing for quick visual recall of specific desktop environments or open applications.
  • Data Export: As an ELK stack, RedELK also supports exporting queried data into formats like CSV, simplifying the process of generating timelines and reports for customers.

The demonstration seamlessly transitioned into the concept of detecting blue team activity, symbolized by a "silence lady" slide. This led to the introduction of RedFile, a proof-of-concept tool for dynamic content serving. The speakers showcased how RedFile, a mere 24 lines of Python code, could be used to serve different content from a web server based on parameters like the number of times a URL is queried:

  1. First Query (e.g., from an antivirus scanner or proxy): Serves a robots.txt file or an uninteresting page.
  2. Second Query (e.g., from the target victim): Serves the actual red team payload.
  3. Third Query (e.g., from a blue team analyst): Serves a decoy, such as a fake "Bitcoin stealer" code.
  4. Fourth Query (e.g., from blue team management): Serves a humorous image of a management presentation, implying the blue team is escalating a false positive.

This RedFile demonstration powerfully illustrated how red teams can actively misdirect and engage the blue team, turning their detection attempts into opportunities for dynamic interaction and further learning. The combined demonstration of RedELK's monitoring and RedFile's deception capabilities underscored the talk's core message of adopting blue team techniques for more effective and adaptive red team operations.

Defensive Implications

▶ Watch: Key Takeaways: Boxing, Red ELK, and Blue Team OPSEC (48:00)

The insights shared in this talk offer critical defensive implications for blue teams, urging them to re-evaluate their operational security (OPSEC) and incident response strategies. The "mirror on the wall" concept means that red teams are not only attacking but also actively monitoring the blue team's reactions.

  1. Blue Team OPSEC is Paramount: The most direct implication is the absolute necessity of robust Blue Team OPSEC. Defenders must avoid uploading any suspicious files or artifacts from a red team engagement to public analysis services like Virustotal or IBM X-Force. Doing so immediately alerts the red team, allowing them to adapt, switch C2s, or deploy decoys. Similarly, manually visiting suspicious URLs from C2 infrastructure should be done with extreme caution, using dedicated, isolated environments, and masking identifying information like user agents or source IP addresses. Any unique browser profile or IP block associated with security vendors or internal investigation teams is a clear giveaway.
  1. Assume Compromise Mindset is Validated: The red team's sophisticated infrastructure and monitoring capabilities underscore the validity of the "assume compromise" mindset. Defenders should operate under the assumption that their perimeter might be breached and focus heavily on internal network monitoring, lateral movement detection, and endpoint visibility.
  1. Proactive Internal Monitoring: Blue teams should implement robust internal monitoring to detect unusual outbound connections to unknown IP addresses or domains, anomalous DNS queries, and suspicious internal network activity that could indicate C2 or beaconing. This includes monitoring for connections from unexpected geographic regions or to IPs known to be associated with VPS providers frequently used by red teams.
  1. Understanding Adversary Adaptation: Defenders must recognize that modern adversaries, including red teams, are dynamic and adaptive. If detection occurs, the adversary will likely change tactics, and potentially employ misdirection techniques like those demonstrated with RedFile. Incident responders need to be prepared for this, understanding that initial findings might be decoys designed to waste time or resources.
  1. Leverage Threat Intelligence Effectively: Services like GrayNoise are valuable for filtering out known internet scanners, allowing blue teams to focus on truly anomalous or targeted reconnaissance. However, defenders should also be aware that red teams use these same services to identify "uninteresting" traffic, making any unknown scanning activity highly suspicious from the red team's perspective.
  1. Embrace Red Team Engagements as Learning Opportunities: The talk frames red teaming as a "sparring match." Blue teams should view these engagements not as tests to "win" or "lose," but as invaluable training exercises. Work closely with the white team and, where appropriate, the red team (after the engagement) to understand the full attack chain, the detection points missed, and, crucially, how the red team detected the blue team's response. This collaborative approach fosters continuous improvement in detection and response capabilities.

In essence, the talk serves as a wake-up call for blue teams: the red team is watching, and their ability to adapt is directly influenced by the blue team's OPSEC and detection maturity. By understanding these offensive techniques, defenders can significantly strengthen their own defensive posture.

Key Takeaways

  • Red Teaming as Sparring, Not a Wrecking Ball: Shift the mindset from aiming for a full knockout to engaging in a realistic sparring match designed to train and improve the blue team's detection and response capabilities. A red team engagement without detection is a missed learning opportunity for all involved.
  • RedELK for Operational Visibility: Leverage RedELK, an open-source ELK stack tailored for red teams, to centralize, enrich, and analyze all red team operational and traffic logs. This provides crucial situational awareness, historical search capabilities, and streamlined reporting for complex, distributed operations.
  • Blue Team OPSEC is Critical (and Monitored): Red teams are actively using blue team techniques to monitor defensive responses. Avoid common OPSEC mistakes such as uploading red team samples to public analysis services (e.g., Virustotal, IBM X-Force) or conducting manual C2 reconnaissance without proper isolation and masking of identifying information.
  • Dynamic Decoys with RedFile: Employ tools like RedFile to dynamically serve different content based on request parameters (user agent, query count, time of day). This allows red teams to misdirect blue teams, prolong engagements, and create false positives that divert defensive resources, enhancing the realism of the exercise.
  • Log Enrichment is Key to Detection: Beyond basic log aggregation, enrich traffic and operational logs with GeoIP, reverse DNS, IP block owner information, and integrate with services like GrayNoise. This helps differentiate generic internet scanning from targeted blue team reconnaissance, allowing red teams to focus on relevant activity.
  • Proactive Detection of Blue Team Activity: Actively monitor for indicators of blue team detection, such as unusual traffic patterns, connections from known security vendors, or queries to external IOC services for red team payload hashes. This early detection enables red teams to adapt their tactics and ensure a more impactful and educational engagement.

About the Speaker(s)

Mark Bergman began his career before 2000, initially programming in COBOL. While he describes himself as "not yet [an] average developer," he was proficient in writing functional code. Around 2004, he transitioned into offensive security. He worked for a large firm for four years before becoming self-employed, and by the time of this talk, he was fully dedicated to red teaming. Mark is often responsible for building out the extensive infrastructure required for large red team operations, noting his tendency to automate tasks if he finds himself typing a command more than three times.

Marc Smeets is the co-founder of Outflank, a Dutch niche company solely focused on red teaming, which had been in operation for two and a half years at the time of the talk. His background is rooted in system and network engineering before he moved into offensive security around 2006. Marc is active on Twitter, where he shares thoughts on InfoSec, sports cars, and champagne, among other topics. He co-founded Outflank with a vision for red teaming that emphasizes sparring and helping blue teams improve, rather than simply achieving a "full knockout."

Reviews

→ Top-rated talks at BruCON 0x0A

All talks from BruCON 0x0A