Adaptive Adversaries
David Kennedy (Founder · TrustedSec and Binary Defense)
BruCON 0x0E · Day 1
Overview
In his BruCON 2022 talk, "Adaptive Adversaries," David Kennedy, founder of TrustedSec and Binary Defense, delves into the evolving landscape of cybersecurity, highlighting how modern attackers have become increasingly sophisticated and adaptable. Kennedy argues that the traditional, often static, approaches to security — relying heavily on vulnerability scanners, generic product detections, and one-to-one mappings of known threats — are no longer adequate against adversaries who meticulously customize their techniques to circumvent defenses. The presentation serves as a critical call to action for organizations to shift their focus from reactive patching and generic controls to proactive, behavior-based security, emphasizing deep environmental understanding, robust telemetry, and the development of custom detection capabilities.

Key moments
- 0:00 Introduction and Adaptive Adversaries Concept
- 8:00 CSO Experience: Live Defcon Malware Deployment
- 12:00 Bypassing Push-based Multi-Factor Authentication
- 18:30 Demo: Office Session Token Extraction to Bypass MFA
- 24:00 Demo: Simple AMSI Bypass Shows Fragile Detections
- 32:00 Red Team Busted by Custom Environment Detections
- 47:00 Q&A: Pragmatic Security for Critical Infrastructure Providers
Adaptive Adversaries
Speakers: David Kennedy, Founder, TrustedSec and Binary Defense
Conference: BruCON
YouTube: https://www.youtube.com/watch?v=c-2IiL4_ih0
Overview
In his BruCON 2022 talk, "Adaptive Adversaries," David Kennedy, founder of TrustedSec and Binary Defense, delves into the evolving landscape of cybersecurity, highlighting how modern attackers have become increasingly sophisticated and adaptable. Kennedy argues that the traditional, often static, approaches to security — relying heavily on vulnerability scanners, generic product detections, and one-to-one mappings of known threats — are no longer adequate against adversaries who meticulously customize their techniques to circumvent defenses. The presentation serves as a critical call to action for organizations to shift their focus from reactive patching and generic controls to proactive, behavior-based security, emphasizing deep environmental understanding, robust telemetry, and the development of custom detection capabilities.
Kennedy, a veteran of the security industry with over two decades of experience, including serving as a Chief Security Officer for a Fortune 1000 company and developing renowned tools like the Social-Engineer Toolkit (SET) and Magic Unicorn, draws upon extensive red team experience and real-world incidents to illustrate his points. He showcases how organized crime groups, ransomware syndicates, and even seemingly amateur groups like Lapsus$ now possess capabilities akin to nation-state actors, driven by specialization and significant monetary incentives. This new breed of adversary manually probes, maps, and exploits organizational infrastructure, rendering traditional defenses largely ineffective.
The core message of Kennedy's talk resonates with the urgent need for a paradigm shift in defensive strategies. By demonstrating how readily common security mechanisms like Multi-Factor Authentication (MFA) push notifications and Anti-Malware Scan Interface (AMSI) can be bypassed with simple, customized techniques, he underscores the fragility of relying solely on technology. Kennedy advocates for defenders to embrace a "purple team" mindset, learning from offensive tactics to build more resilient and adaptive defenses that are tailored to their unique environments, ultimately aiming to reduce complexity and improve the industry's collective security posture.
Background
▶ Watch: Introduction and Adaptive Adversaries Concept (0:00)
The cybersecurity landscape has undergone a profound transformation over the last 10 to 15 years, moving from a simplistic focus on isolated technical vulnerabilities to a complex battle against highly adaptive adversaries. David Kennedy recounts a time when penetration testers could consistently exploit the same vulnerabilities year after year, finding an exploit, gaining privilege escalation, lateral movement, and ultimately access to domain controllers without much resistance. The emphasis was on myopic technical findings, not the entire flow of an attack. Today, however, breaking into organizations is significantly more challenging, requiring attackers to identify subtle flaws, exploit misconfigurations, and meticulously circumvent advanced detection criteria.
This shift has been a positive development, fostering a greater understanding of offense and leading to the blending of red and blue teams—a "purple" approach that has substantially improved defensive capabilities. Despite these advancements, a significant challenge persists: the difficulty in communicating the return on investment (ROI) in security. Many organizations, particularly those of medium size, struggle to allocate resources for dedicated security personnel capable of understanding their environments, let alone implementing advanced detection and response strategies. Kennedy notes that less than five percent of organizations possess the capabilities to understand emulation and simulation, or to detect novel tools and modified attack techniques effectively.
The rise of highly sophisticated adversaries further complicates this picture. Kennedy points to the Conti leaks as an example, revealing dedicated research divisions within ransomware groups and detailed operational playbooks that outline methodical attack strategies. These organized crime groups, often with specializations in areas like delivery, initial access, C2, MFA circumvention, and backend infrastructure, now exhibit capabilities comparable to nation-state actors. This unprecedented level of sophistication allows them to manually attack, map infrastructure, identify existing products, and adapt their techniques to specific organizational defenses.
A critical vulnerability highlighted is the pervasive lack of cloud visibility. Kennedy observes that most organizations have significantly less visibility into their cloud infrastructure compared to their on-premise environments. This blind spot is actively exploited by threat actors, including nation-states like Russia and China, and groups like Lapsus$. The Lapsus$ group, described as a collective of teenagers, successfully breached major companies such as Uber, Microsoft, LG, and Octa, often leveraging compromised credentials and VPN concentrators. Their initial hacks predominantly lived in the cloud, exploiting this visibility gap.
The Uber hack by Lapsus$ provides a concrete illustration of these challenges. Kennedy references Michael Kazwara's mapping of the attack to MITRE ATT&CK techniques, specifically highlighting the effectiveness of Multi-Factor Authentication (MFA) spamming. TrustedSec’s internal research shows a 100% success ratio for bypassing push-based MFA using a simple pretext: sending an SMS message informing the user of an upcoming MFA outage, then initiating push notifications a few hours later. Users, expecting re-authentication, invariably hit "approve." The Lapsus$ attack also involved scanning for open file shares—a technique often overlooked by operating system-focused EDRs—and discovering a PowerShell script containing hard-coded administrative credentials for Uber's CyberArk Privileged Access Management (PAM) system. The industry's surprise at these findings, Kennedy argues, is misplaced, as such egregious misconfigurations are alarmingly common even in organizations with mature security programs.
Key Findings
▶ Watch: Bypassing Push-based Multi-Factor Authentication (12:00)
David Kennedy's talk reveals several critical findings about the current state of cybersecurity and the evolution of threat actors:
- Adversaries are Adaptive and Customized: The most significant finding is that modern adversaries no longer rely on generic attacks. They adapt their techniques and procedures to the specific target organization, meticulously customizing their approach to circumvent existing detections. This bespoke attack methodology renders broad, "one-to-one" security product signatures largely ineffective.
- Sophistication of Organized Crime and Ransomware Groups: Driven by specialization and significant monetary gains, organized crime and ransomware groups have achieved capabilities on par with nation-state actors. They employ dedicated research divisions, develop operational playbooks, and conduct manual, in-depth reconnaissance to tailor their attacks.
- Fragility of Current Detection Mechanisms: Most Endpoint Detection and Response (EDR) and antivirus (AV) products rely on fragile, one-to-one detections—signatures specific to previously observed attacks. Kennedy demonstrates how even minor modifications to attack code, such as simply splitting a PowerShell command, can completely bypass these defenses, highlighting a fundamental weakness in product-centric security.
- Technology Alone Cannot Solve Bad Security Practices: A core tenet of Kennedy's argument is that merely deploying more security products will not fix underlying poor security practices. True security requires a deep understanding of the environment, comprehensive visibility into telemetry data, and the ability to build custom, behavior-based detections.
- Major Visibility Gaps in Cloud Infrastructure: Organizations consistently lack adequate visibility into their cloud environments compared to on-premise networks. This blind spot is a prime target for adaptive adversaries, allowing them to operate undetected for extended periods.
- MFA Push Notifications Are Easily Bypassed: Despite being a widely adopted security control, push-based MFA solutions are highly vulnerable to social engineering. Kennedy reports a 100% success rate in bypassing them using a specific pretext involving a fake outage notification combined with geo-location awareness. He unequivocally states, "Push notifications suck, they're awful, they're the worst, do not use push ever."
- Living Off The Land Binaries (LOLBins) Remain a Persistent Threat: Legitimate operating system executables like
regsvr32.exeandmsdt.exe(as seen in the Follina vulnerability, CVE-2022-30190) are routinely abused by attackers. Their widespread use and the difficulty in distinguishing malicious from legitimate activity make them potent tools for bypassing application control and generic detections. - Research Often Precedes Detection: Critical vulnerabilities and attack techniques, such as the Follina exploit (research dating back to 2015) or the LastPass memory extraction method (based on a Sophos blog from 2019), often exist as publicly known research long before security products develop effective detections or before tools are widely released. Attackers are quick to weaponize this research.
- Custom, Environment-Specific Detections are Paramount: The most effective defense comes from understanding an organization's unique environment, baselining normal behavior, and building custom detections for deviations. Kennedy's anecdote about a red team being busted by a specific rule detecting
whoamiAPI calls from non-technical users powerfully illustrates the efficacy of this approach over generic signatures.
Technical Deep Dive
▶ Watch: Demo: Office Session Token Extraction to Bypass MFA (18:30)
David Kennedy’s talk provides several compelling technical deep dives and practical demonstrations illustrating the adaptive nature of modern adversaries and the fragility of common security controls.
1. Office Token Extraction via Beacon Object File (BOF)
Kennedy introduces a newly released Beacon Object File (BOF), developed by TrustedSec (building on research by "Mr. Doc"), designed to extract Office tokens directly from memory.
- Mechanism: This tool targets systems where users are logged into Office applications (e.g., Teams, Outlook). It operates on both 32-bit and 64-bit architectures.
- Bypass: Once extracted, these session tokens can be parsed and replayed on a different machine. This technique circumvents Multi-Factor Authentication (MFA), providing persistent access to a compromised user's emails, Teams chats, and other Office 365 resources without triggering further MFA prompts.
- Detection Evasion: Crucially, Kennedy states that this token extraction and replay method currently goes undetected by existing security products. The demonstration shows the tool in action, extracting and parsing the token from a compromised system, ready for replay.
2. Multi-Factor Authentication (MFA) Push Notification Bypass
Kennedy reveals a highly successful social engineering technique for bypassing push-based MFA solutions:
- Pretext: The attacker sends an SMS text message to the target user, masquerading as IT support (e.g., Microsoft), informing them of an upcoming, temporary MFA outage (e.g., "Microsoft will have an outage between 8 PM and 9 PM, you may need to re-authenticate").
- Execution: After a few hours, the attacker initiates numerous MFA push notifications to the target's device.
- Success Rate: Kennedy reports a 100% success ratio with this technique internally at TrustedSec. Users, having been prepped for an outage and potential re-authentication, almost invariably hit "approve," especially if the attacker's geographic location can be spoofed to match the user's general area or corporate office. He strongly advises against the use of push notifications for MFA due to this inherent susceptibility.
3. AMSI Bypass with PowerShell (Magic Unicorn)
A live demonstration showcases how easily the Anti-Malware Scan Interface (AMSI) in PowerShell can be bypassed, highlighting the fragility of signature-based detections.
- AMSI Function: AMSI acts as a hook within PowerShell, scanning scripts and commands just before execution using an AMSI provider (e.g., Windows Defender) to identify malicious content.
- Initial Attempt: Kennedy uses his tool, Magic Unicorn, which leverages an x86 downgrade attack to inject Metasploit's Meterpreter Shellcode directly into memory via a PowerShell command. When executed in its raw form, AMSI successfully detects and blocks the malicious content.
- Bypass Technique: To bypass AMSI, Kennedy makes a remarkably simple modification: he splits the
Invoke-Expression(IEX) command into two variables. Instead ofIEX $shellcode, he uses$a = "IEX"; $a $shellcode. - Result: This minor alteration completely circumvents AMSI's detection, allowing the Meterpreter shell to execute successfully. This illustrates that security products often rely on very specific, "one-to-one" signatures that can be bypassed by trivial code manipulation.
4. Living Off The Land Binaries (LOLBins) and Fragile Detections
Kennedy further elaborates on the abuse of LOLBins and the weaknesses in their detection:
regsvr32.exe: This legitimate Windows binary is frequently abused. While many EDRs block its use with specific parameters (e.g.,/s /i), attackers can bypass this by usingwgetorbitsadminto download a scriptlet object, then callingregsvr32without the/iparameter.msdt.exe(Follina, CVE-2022-30190): Kennedy notes that research on abusingmsdt.exefor code execution existed as far back as 2015. However, no widespread detections were implemented until its exploitation through Office documents (the "Follina" attack) became popular, demonstrating a reactive rather than proactive security posture.
5. LastPass Memory Extraction
Kennedy reveals ongoing research and a soon-to-be-released tool by TrustedSec for extracting LastPass vault data:
- Vulnerability: Based on an obscure Sophos blog post from 2019, LastPass does not erase the master password hash from memory even after the vault is closed.
- Attack: The new tool automatically searches for Chrome and Brave extensions, extracts the master password hash from memory, salts it, and then uses it to authenticate to the offline password vault, allowing the extraction of all stored passwords. Additionally, the cleartext password is stored in memory for several minutes after a user logs in.
- Detection Evasion: Currently, there are no detections for this technique, making it a potent post-exploitation capability.
6. The Power of Custom Detections (Whoami API Example)
Kennedy recounts a red team engagement against a highly sophisticated financial institution that powerfully demonstrates the value of custom, environment-specific detections:
- The Attack: After three months of effort, including leveraging a zero-day, the red team gained initial access and established command and control (C2) on a target machine, with no detections.
- The Bust: Instead of directly running the
whoamicommand (which would likely be detected), the red team hooked thewhoamiAPI to determine the user context. The client, however, had implemented a highly specific custom rule: if thewhoamiAPI was queried by a non-technical user account (as defined by their Active Directory groups), it would trigger an alarm. - Outcome: The custom detection immediately triggered, busting the red team and shutting down their access. This highlights that generic tools and tactics are less effective against defenses tailored to an organization's unique behavioral patterns and user classifications.
These technical insights underscore Kennedy's central argument: relying on commodity security products and generic rules is insufficient. Effective defense requires a deep understanding of offensive techniques, coupled with rich telemetry and the ability to build highly specific, behavior-based detections tailored to one's own environment.
Demo / Proof of Concept
▶ Watch: Red Team Busted by Custom Environment Detections (32:00)
David Kennedy presented two key demonstrations to visually illustrate his points about adaptive adversaries and the fragility of generic detections:
- Office Token Extraction (20:00-21:00):
- Setup: The demonstration showed a Team Server (likely Cobalt Strike or a similar C2 framework) on the right side of the screen, indicating an attacker's control panel.
- Execution: Kennedy's team used their newly released Beacon Object File (BOF) to extract Office tokens directly from the memory of a compromised machine.
- Output: The output displayed a collection of raw token data. The demonstration then showed the process of parsing this data to isolate the full, usable Office token.
- Implication: Kennedy emphasized that this extracted token could then be replayed on a different machine, granting persistent access to the victim's Office 365 environment (emails, Teams, etc.) and effectively circumventing Multi-Factor Authentication. This highlights the power of memory-based attacks against authentication mechanisms.
- AMSI Bypass (24:00-28:00):
- Setup: Kennedy used his tool, Magic Unicorn, to generate a PowerShell command designed to inject Meterpreter Shellcode into memory, without any obfuscation. He also set up a listener to catch the incoming shell.
- Initial Attempt (Blocked): He first executed the raw, un-obfuscated PowerShell command in a Windows machine's PowerShell interpreter. As expected, Windows Defender (acting as the AMSI provider) immediately detected the malicious content and blocked its execution, displaying an alert that "malicious content was found."
- Bypass (Successful): Kennedy then demonstrated the bypass. Instead of changing the core malicious payload, he simply modified the PowerShell command by splitting the
Invoke-Expression(IEX) function into two parts (e.g.,$a = "IEX"; $a $code). - Result: Upon executing this slightly modified command, the Meterpreter shell successfully dropped onto the attacker's listener, bypassing AMSI and Windows Defender without triggering any alerts. This visually underscored his point that "one-to-one" detections are "very fragile" and easily circumvented by minor, non-sophisticated changes to attack code.
These demonstrations served as powerful real-world examples of how easily common security controls can be bypassed by adaptive adversaries, reinforcing the need for more sophisticated, behavior-based detection strategies.
Defensive Implications
▶ Watch: Q&A: Pragmatic Security for Critical Infrastructure Providers (47:00)
The insights presented by David Kennedy have profound implications for defensive strategies, demanding a shift from generic, product-centric security to a more adaptive, environment-aware approach.
1. Embrace Rich Telemetry and Visibility:
Kennedy stresses that telemetry data is paramount, especially given that storage is now relatively inexpensive compared to a decade ago. Organizations need comprehensive visibility across their entire infrastructure:
- Full packet captures: Where feasible, to understand network traffic in detail.
- Cloud infrastructure telemetry: To address critical blind spots that adversaries are actively exploiting.
- On-premise infrastructure telemetry: To monitor endpoints and servers.
- Network telemetry: To observe all network communications.
This holistic data collection is essential for painting a complete picture of the environment and understanding deviations from normal behavior.
2. Understand and Baseline Your Unique Environment:
Reliance on "one-to-one" detections, typically seen in EDRs and AV products, is insufficient. These detections are often reactive and easily bypassed. Instead, defenders must:
- Baseline normal behavior: Identify what is considered "normal" activity for users, systems, and applications within their specific environment.
- Look for deviations: Focus on detecting anomalies and behaviors that fall outside the established baseline. For example,
regsvr32should rarely, if ever, execute from user land. Administrator accounts should not typically log into workstations from other workstations. - Go beyond MITRE ATT&CK as a checklist: While MITRE ATT&CK is valuable for understanding adversary capabilities, it should not be treated as a simple checklist for generic detections. Instead, use it to prioritize and develop custom detections relevant to the specific threat actors targeting your industry.
3. Develop Custom, Behavior-Based Detections:
The most effective defenses are those tailored to the environment:
- Identify "weird" behavior: Focus on what is genuinely unusual in your environment. If PowerShell is used everywhere, but non-technical users in sales don't need a full-fledged programming language, then PowerShell execution under their context should be investigated or blocked.
- Refine detections: Employ detection engineers to continuously refine rules, reduce false positives, and ensure that alerts are actionable for analysts. This involves understanding the noise in your environment and shrinking it down to manageable, high-fidelity alerts.
- Implement deception: Deception technologies, such as honeypots, honeytokens, and fake credentials (e.g., honey creds with bad passwords stored in memory), can actively trap attackers and provide early warning. Attackers don't know the difference between real and fake, making these highly effective.
4. Strengthen MFA and Address Vulnerabilities:
- Avoid push notifications for MFA: Kennedy strongly advises against push-based MFA due to its susceptibility to social engineering pretexts. Organizations should prioritize more robust methods like FIDO2 hardware tokens or time-based one-time passwords (TOTP).
- Patch known vulnerabilities: While "one-to-one" detections are fragile, patching known vulnerabilities and addressing misconfigurations (like hard-coded credentials) remains fundamental.
5. Reduce Lateral Movement:
This is a critical strategy to minimize damage from successful breaches:
- Network segmentation: Isolate critical systems and user groups. Workstation-to-workstation communication should be heavily restricted or monitored, as it's a primary vector for lateral movement.
- Application control/allow listing: Restrict unauthorized executables. While difficult to implement overnight, it significantly hampers attacker capabilities.
- Minimize user privileges: Implement the principle of least privilege to limit an attacker's reach once initial access is gained.
6. Prioritize Incident Response:
Given that prevention cannot be 100% perfect and takes time to implement, a strong focus on rapid incident response is crucial.
- Faster response times: Effective telemetry and custom detections enable quicker identification and containment of attacks, thereby reducing the overall damage.
7. Special Considerations for Critical Infrastructure:
For critical infrastructure and legacy Operational Technology (OT) systems (often 10-20 years old with delayed patching):
- Extreme network segmentation: Isolate these systems into "high security zones" or individual islands.
- Enhanced, non-invasive monitoring: Focus on network telemetry, protocol analysis (e.g., for PLCs), and specialized tools (like Dragos) that provide visibility without directly touching or scanning sensitive systems.
- Strict vendor management: Scrutinize remote access by third-party vendors.
By implementing these defensive implications, organizations can move beyond a reactive, checklist-based approach to security and build a more resilient, adaptive defense capable of thwarting sophisticated adversaries.
Key Takeaways
- Adaptive Adversaries Demand Adaptive Defenses: Modern threat actors, including organized crime and nation-states, are highly specialized and adapt their techniques to specific organizational environments, rendering generic, "one-to-one" security product detections largely ineffective.
- Fragile Detections Are Easily Bypassed: Security products often rely on specific signatures that can be bypassed by minor, non-sophisticated modifications to attack code or execution parameters (e.g., splitting a PowerShell command to evade AMSI).
- MFA Push Notifications Are a Weak Link: Push-based Multi-Factor Authentication is highly susceptible to social engineering, with specific pretexts (like fake outage notifications combined with geo-location) achieving a 100% bypass success rate. Organizations should consider more robust MFA options.
- Visibility, Baselining, and Custom Detections are Paramount: Effective defense requires deep environmental understanding, comprehensive telemetry (cloud, on-prem, network), baselining normal behavior, and building custom detections for deviations and "weird" activity unique to the organization.
- Reduce Lateral Movement to Minimize Damage: Since prevention is never perfect, focusing on strategies to prevent lateral movement (e.g., network segmentation, workstation-to-workstation communication restrictions, least privilege) is critical to reduce the overall impact and damage of a successful breach.
- Technology Alone is Insufficient: Relying solely on security products to fix poor security practices is a losing battle. True security improvement requires human intelligence, dedicated detection engineering, and a continuous effort to understand and adapt to the evolving threat landscape.
About the Speaker(s)
David Kennedy is a highly respected and influential figure in the cybersecurity industry, with over 20 years of experience. He is the founder of two prominent security companies, TrustedSec and Binary Defense, which specialize in offensive and defensive security services, respectively. Kennedy previously served as the Chief Security Officer (CSO) for a Fortune 1000 company, Diebold, where he gained firsthand experience in managing enterprise security programs.
Known for his focus on building innovative tools and releasing impactful research, Kennedy is credited with creating the "Powershell security industry" by delivering the very first Powershell security talk at Defcon. He is the original author of widely recognized open-source penetration testing tools such as the Social-Engineer Toolkit (SET) and Magic Unicorn. Beyond his technical contributions, Kennedy is a frequent media commentator on cybersecurity issues, having appeared on numerous news organizations including CNN, BBC, Fox, MSNBC, and CNBC, and even testified in front of Congress. He also served as a technical consultant for the popular TV show Mr. Robot.