Anti-Forensics AF
int0x80
BruCON 0x08 · Day 1
Overview
In his BruCON talk, "Anti-Forensics AF," int0x80, a veteran anti-forensics researcher and red team operator, delves into advanced techniques designed to thwart forensic analysis across various platforms. The presentation picks up from his previous work, focusing on methods that allow malware or illicit activity to remain undetected or unanalyzed even after system acquisition. The core theme revolves around understanding the assumptions forensic tools make and exploiting them from an attacker's perspective to achieve stealth and deny evidence.

Key moments
- 0:00 Introduction and talk agenda
- 3:00 Windows memory anti-forensics: zeroing PE header
- 9:00 Demo: IDA Pro fails to analyze memory-dumped malware
- 14:00 Linux memory anti-forensics: elf header zeroing
- 28:00 Android anti-forensics: Duck the Police app
- 34:00 CTF: SD card challenge setup
- 45:00 CTF solution: SD card firmware write protection
- 48:00 Practical applications of SD card anti-forensics
Anti-Forensics AF
Speakers: int0x80
Conference: BruCON
YouTube: https://www.youtube.com/watch?v=8q_1VF7jJ3g
Overview
In his BruCON talk, "Anti-Forensics AF," int0x80, a veteran anti-forensics researcher and red team operator, delves into advanced techniques designed to thwart forensic analysis across various platforms. The presentation picks up from his previous work, focusing on methods that allow malware or illicit activity to remain undetected or unanalyzed even after system acquisition. The core theme revolves around understanding the assumptions forensic tools make and exploiting them from an attacker's perspective to achieve stealth and deny evidence.
The talk covers three main areas: in-memory anti-forensics for Windows and Linux, leveraging Android device features for rapid data destruction, and a fascinating demonstration of firmware-level manipulation on SD cards to create "disappearing" data. int0x80 emphasizes a red team mindset, where the goal is to protect custom malware from blue team analysis and ensure operational security. His approach is practical, demonstrating how simple, yet often overlooked, techniques can render sophisticated forensic tools ineffective.
This article dissects int0x80's methodologies, providing a technical deep dive into how these anti-forensics measures work, the tools used for both attack and defense, and the critical implications for forensic investigators and security defenders. By understanding these offensive techniques, blue teams can better anticipate threats and fortify their detection and response strategies against increasingly sophisticated adversaries.
Background
▶ Watch: Introduction and talk agenda (0:00)
The landscape of digital forensics has evolved significantly over the past decade. Traditionally, investigations heavily relied on dead disk forensics, analyzing data at rest on storage devices. However, with advancements in computing and the increasing sophistication of malware, memory forensics emerged as the "hotness," offering a snapshot of a system's live state, including running processes, network connections, and volatile data that might not be written to disk. This shift presented new opportunities for forensic investigators but also new challenges for attackers aiming to remain undetected.
From a red team or malware author perspective, the primary goal is to achieve persistence and execute operations without leaving traces that could lead to detection or analysis. While custom malware offers an advantage over off-the-shelf tools like MSFVenom, the investment in developing a unique toolchain necessitates robust protection against forensic analysis. The problem arises when blue teams acquire memory images, hoping to reverse engineer and understand the malware's functionality. This talk explores how attackers can leverage low-level system interactions to subvert these memory analysis efforts, making malware effectively invisible to common forensic tools like IDA Pro, Volatility, and Google's Recall framework.
Furthermore, the proliferation of mobile devices, particularly Android, introduces new vectors for both attack and evidence collection. The inherent difficulties in acquiring data from locked, encrypted, or rooted Android devices create a fertile ground for anti-forensic measures. The talk also touches upon the often-overlooked area of physical storage media, specifically SD cards, revealing how even seemingly robust storage can be manipulated at a firmware level to hide or destroy data, posing a unique challenge to investigators relying on physical acquisition.
Key Findings
▶ Watch: Demo: IDA Pro fails to analyze memory-dumped malware (9:00)
The talk presents several critical findings that challenge conventional forensic methodologies:
- In-Memory Executable Header Nullification: The most significant finding for memory forensics is that an executable's PE header (on Windows) or ELF header (on Linux) is primarily required for loading the program from disk into memory. Once the program is resident and executing in memory, these headers are no longer strictly necessary for its continued operation. By strategically zeroing out these header sections in memory, the presenter demonstrates that standard forensic tools designed to parse executable formats (like IDA Pro for disassembly or Volatility/Recall for process dumping) fail to correctly identify or reconstruct the malware's code. Instead, they often present a blob of unidentifiable data, effectively rendering analysis impossible.
- Android Sensor-Triggered Self-Destruction: For mobile devices, the key finding is the effectiveness of combining full disk encryption with sensor-driven automated device shutdown. By leveraging readily available device sensors (Bluetooth pairing status, cellular network connectivity, GPS geofencing, or even physical movement), an Android application can detect potential compromise (e.g., being moved from a safe location, losing network connectivity in a Faraday bag) and trigger an immediate device shutdown. Since the device is fully encrypted, powering it off renders all data inaccessible without the decryption key, effectively neutralizing the threat of data acquisition by law enforcement or incident responders.
- SD Card Firmware-Level Write Protection: A surprising and impactful finding is the vulnerability of SD cards to firmware manipulation that can create temporary, user-controlled write protection, independent of the physical lock switch. The talk demonstrates that even when the physical write-protect switch is disengaged, and the operating system reports successful writes and even formatting, the data may not actually persist across unmount/remount cycles. This is attributed to counterfeit SD cards or firmware that can be programmatically toggled into a state where writes appear to succeed but are never committed, effectively creating "disappearing" data. This mechanism can be exploited to ensure that no logs, history, or operational data from a hardware implant (like a Raspberry Pi) are ever written to persistent storage, leaving no forensic trace.
These findings collectively highlight a fundamental disconnect between how operating systems and forensic tools perceive data integrity and how an attacker can manipulate underlying mechanisms to deny evidence.
Technical Deep Dive
▶ Watch: Android anti-forensics: Duck the Police app (28:00)
int0x80's talk offers a detailed look at the technical mechanisms behind his anti-forensic techniques, demonstrating their efficacy across different platforms.
Windows Memory Anti-Forensics
The Windows technique targets the Portable Executable (PE) header. This header contains crucial metadata about the executable, including section tables, import/export tables, and entry points, which are vital for the operating system to load the program into memory and for analysis tools to understand its structure.
- Header Nullification: The malware first resolves its own MS-DOS header and then the PE header.
- Permission Modification: It then uses the Windows API call
VirtualProtectto modify the memory page permissions of the PE header, temporarily adding write permissions. - Zeroing Out: Following this,
RtlZeroMemoryis called to completely zero out the entire PE header in memory. - Permission Restoration: Finally,
VirtualProtectis used again to restore the original memory page permissions. - Execution: The malware continues to execute normally because, once loaded, the operating system no longer strictly requires the header information for ongoing execution.
The presenter demonstrated this using a custom malware named "the keys are like right next to each other.exe". For memory acquisition, WinPmem was used to create a full memory dump (lol.AFF). To extract the malware from the dump, Google's open-source Recall framework was employed. Recall's procdump module, which can target processes by regex, attempted to extract the malware. However, when the dumped executable was opened in IDA Pro, it failed to parse correctly, showing only a blob of data rather than a clean disassembly with functions and cross-references. This technique is effective on Windows XP through Windows 10.
Linux Memory Anti-Forensics
The Linux approach mirrors the Windows technique but targets the Executable and Linkable Format (ELF) header, which serves a similar purpose to the PE header on Windows.
- Header Identification: The malware identifies its own ELF header in memory. A "lazy" method involving parsing
/proc/self/mapsto find the executable's base address was mentioned, though acknowledged as not always robust in restricted environments. - Permission Modification: The
mprotectsystem call is used to add write permissions to the memory page containing the ELF header. - Zeroing Out:
memsetis then called to zero out the ELF header. - Permission Restoration:
mprotectrestores the original permissions. - Execution: The process continues to run without interruption.
For Linux memory acquisition, the open-source kernel module LIME (Linux Memory Extractor) was used to dump RAM (lol.lime). Volatility, a widely used memory forensics framework, was then used for analysis. A crucial step for Volatility in Linux is building a profile specific to the target system's kernel. After building the profile (module.dwarf and System.map), Volatility's Linux_pslist command was used to find the PID of the running malware. Subsequently, Linux_procdump was employed to extract the process's memory. Similar to the Windows demo, the resulting dumped file was empty (file command showed "empty"), confirming the effectiveness of the header nullification.
Android Anti-Forensics
The Android strategy combines full disk encryption with sensor-based triggers for device shutdown.
- Acquisition Challenges: int0x80 first highlighted the difficulties of Android forensics: acquisition requires the device to be powered on, decrypted, unlocked, rooted, and have USB debugging enabled. Memory acquisition further requires loadable kernel modules, rarely present. The typical acquisition method involves cross-compiling
netcatfor ARM, pushing it to the device, setting upadb forward, and then pipingddoutput throughnetcatto a listening client on the analyst's machine – a process that modifies the device and is easily disrupted. - "Duck the Police" App: The proposed solution is a custom Android app called "duck the police." This app leverages various device sensors to detect potential compromise:
- Bluetooth: If the device unpairs from a trusted Bluetooth device (e.g., at home), it might indicate it's been moved or placed in a Faraday bag.
- Cell Network: Loss of cellular connectivity (e.g., in a Faraday bag).
- GPS: Leaving a predefined geofence around a safe location.
- Movement: Detecting physical movement after being at rest (simulating someone picking it up).
- Automated Shutdown: Upon detecting a trigger, the app initiates an immediate device shutdown. Since modern Android devices utilize full disk encryption, powering off the device renders all data inaccessible without the user's decryption key. This provides a strong defense against physical acquisition.
- Red Team Application: This technique is also useful for hardware implants. An Android device configured as a RADIUS attack access point (e.g., broadcasting a fake corporate Wi-Fi SSID) can be dropped in a target environment. If discovered, "duck the police" can wipe the evidence.
SD Card Firmware Manipulation
This segment demonstrated a novel anti-forensic technique exploiting firmware vulnerabilities in SD cards.
- The CTF Scenario: A CTF challenge required players to add their name to a text file on an SD card, unmount it, and remount it, with the name persisting. Players found that even after successfully writing the name, unmounting, and remounting, the name would disappear. Attempts to
ddthe entire image or format the disk also failed to make changes persistent. - The Root Cause: Counterfeit Firmware: The issue stems from counterfeit SD cards that report a larger capacity than they actually possess (e.g., advertised as 64GB but only having 16GB of usable storage). Crucially, these cards often have firmware that can be put into a temporary write-protected state, independent of the physical lock switch. While the OS believes writes are occurring, the firmware discards them.
SD tool: int0x80 introducedSD tool, an open-source utility, which can query and manipulate this firmware-level write protection. By usingSD toolto explicitly unlock the device's temporary write protection, data can then be written and will persist across unmount/remount cycles.- Anti-Forensic Utility: This technique allows an attacker to operate a hardware implant (like a Raspberry Pi running a PORTAL of Pi Tor gateway or an attack VM) from an SD card. All operational logs, history, and temporary files can be directed to
/dev/nullor simply written to the "write-protected" SD card, ensuring that no persistent evidence is left behind if the device is physically recovered.
These technical deep dives illustrate int0x80's comprehensive understanding of system internals and forensic tool limitations, offering potent anti-forensic capabilities.
Demo / Proof of Concept
▶ Watch: CTF: SD card challenge setup (34:00)
int0x80's talk was heavily demo-driven, showcasing the practical application of each anti-forensic technique.
- Windows Memory Anti-Forensics Demo:
- Setup: A Windows 10 VM was used. The custom malware, "the keys are like right next to each other.exe," was launched.
- Acquisition:
WinPmemwas executed to dump the VM's memory into a file namedlol.AFF. - Analysis Attempt: Google's
Recallframework was then used, specifically theprocdumpmodule, to attempt to extract the running malware from the memory dump using its name as a regex. - Result: The extracted file, when opened in IDA Pro, displayed as an unidentifiable blob of data. Compared to a statically loaded version of the malware, which showed clear functions and code, the in-memory dumped version was completely unparseable, demonstrating that the PE header nullification successfully thwarted analysis.
- Linux Memory Anti-Forensics Demo:
- Setup: A Linux environment was prepared. A Linux variant of the custom malware was launched, showing debug output indicating ELF header nullification.
- Acquisition: The
LIMEkernel module was used to quickly dump the system's memory intolol.lime. - Analysis Attempt: Volatility was employed. After specifying the correct system profile (which needs to be built beforehand for the target kernel),
Linux_pslistidentified the malware's PID.Linux_procdumpwas then used to extract the process memory. - Result: The resulting file was completely empty, as verified by the
filecommand, confirming that the ELF header nullification effectively prevented Volatility from reconstructing the executable.
- Android "Duck the Police" App Demo:
- Setup: An Android phone running the "duck the police" app was shown. The app was configured to trigger on "movement."
- Demonstration: With the phone at rest, int0x80 simulated an FBI agent picking it up. As soon as the phone detected movement, it initiated a full shutdown.
- Result: The device powered off, ensuring that all data, protected by full disk encryption, became inaccessible to anyone without the decryption key. This simple yet effective demonstration highlighted the power of combining readily available device features for robust anti-forensics.
- SD Card CTF / Firmware Manipulation Demo:
- Setup: An SD card was inserted into a laptop. A file named
challenge.txtwas present. - Initial Challenge: int0x80 attempted to add his name (
int0x80) tochallenge.txtusingvimandsudo. He then unmounted the card, removed it, and reinserted it. - Failure: Upon remounting and checking
challenge.txt, his name was gone. Attempts to copy, overwrite, and even format the card (which failed to complete in the demo due to time, but the principle was explained) yielded similar results: the changes did not persist. - The Solution: The
SD toolutility was introduced.SD toolwas used to query the card's status, revealing it was "temporarily write protected." Then,SD toolwas used to unlock the device. - Success: After unlocking, int0x80 again added his name to
challenge.txt, unmounted, removed, and reinserted the card. This time, upon remounting, his name was present, demonstrating that the firmware-level write protection was the root cause andSD toolwas the key to bypassing it. This demo effectively showed how physical storage media can be manipulated to deny forensic acquisition.
Each demo successfully validated the anti-forensic claims, providing concrete proof of concept for the techniques discussed.
Defensive Implications
▶ Watch: Practical applications of SD card anti-forensics (48:00)
The techniques demonstrated by int0x80 pose significant challenges for defenders and forensic investigators. Understanding these anti-forensic methods is crucial for building more resilient security postures.
Against Memory Anti-Forensics:
- Early Detection is Key: The most effective defense against in-memory header nullification is to detect the malware before it has a chance to execute and modify its memory space. This emphasizes the importance of robust endpoint detection and response (EDR) solutions, antivirus, and application whitelisting to prevent initial compromise.
- Behavioral Analysis: Since static analysis of a dumped process becomes difficult, defenders must shift towards behavioral analysis. Monitoring process creation, API calls, network connections, file system modifications, and other indicators of compromise (IOCs) can reveal malware presence even if its executable image is obfuscated in memory.
- Live Memory Analysis: While dumping memory for offline analysis is common, live memory analysis techniques might be more effective in certain scenarios, potentially catching the malware before header nullification occurs or identifying other artifacts. However, this is often impractical for large-scale operations.
- Kernel-Level Monitoring: More advanced monitoring at the kernel level might be able to detect the
VirtualProtect/mprotectcalls that modify executable page permissions, serving as an early warning sign of anti-forensic activity. - Memory Reconstruction Challenges: Forensic tools need to evolve to handle these obfuscated memory regions. Research into reconstructing executables from fragmented or header-less memory sections, perhaps using heuristics or identifying common code patterns, could be a future direction.
Against Android Anti-Forensics:
- Assume Device Compromise: Defenders should operate under the assumption that a physically acquired Android device, especially if encrypted, might self-destruct or be wiped. This means prioritizing remote wiping capabilities and ensuring regular, encrypted backups of critical data.
- Strong Authentication and Encryption: Mandate full device encryption and strong, complex lock screen passcodes/biometrics. This is the primary defense against data access after a device is powered off.
- Physical Security: Implement robust physical security measures for devices, especially in sensitive environments, to prevent unauthorized access and potential "duck the police" triggers.
- Awareness of Sensor Exploitation: Be aware that attackers can leverage device sensors. For corporate-issued devices, consider policies around Bluetooth pairing, GPS usage, and network connectivity that could be exploited.
- Hardware-Level Acquisition: For law enforcement, this highlights the need for advanced hardware-level acquisition techniques that can bypass software encryption, though these are often expensive and specialized.
Against SD Card Firmware Manipulation:
- Verify Storage Media Authenticity: Forensic investigators must be vigilant about the authenticity and integrity of storage media, especially SD cards. Tools that verify actual storage capacity (not just reported capacity) and check for firmware anomalies should be standard practice.
- Beyond File System Checks: Simple file system checks (
ls,cat,file) are insufficient. Investigators must perform block-level integrity checks and verify that data written to the device actually persists across power cycles and remounts. - Specialized Tools: Utilize specialized tools like
SD toolor similar utilities to query and manipulate firmware-level protection flags. This is essential to ensure that acquired data is truly reflective of the device's state. - Chain of Custody: Maintain an impeccable chain of custody for all physical media. Documenting the state of physical lock switches and any observed anomalies is critical.
- Implications for Hardware Implants: For blue teams hunting hardware implants (e.g., Raspberry Pis), the knowledge that logs might not persist on SD cards means focusing on real-time network monitoring and physical security audits of the environment rather than relying solely on post-mortem analysis of recovered devices.
In essence, int0x80's talk serves as a wake-up call, demonstrating that attackers are actively working to undermine forensic capabilities. Defenders must adapt by shifting their focus from static analysis to dynamic and behavioral monitoring, investing in stronger preventive measures, and developing a deeper understanding of low-level system interactions and hardware vulnerabilities.
Key Takeaways
- Executable Header Nullification is Effective: Malware can zero out its PE (Windows) or ELF (Linux) headers in memory after loading, effectively preventing common forensic tools like IDA Pro, Volatility, and Recall from correctly parsing or analyzing the executable image.
- Android Encryption + Sensors = Strong Anti-Forensics: Combining full disk encryption with sensor-triggered device shutdowns (e.g., via Bluetooth, GPS, movement) provides a robust defense against data acquisition in scenarios of physical device compromise.
- SD Card Firmware Manipulation is a Blind Spot: Counterfeit SD cards or those with manipulable firmware can be put into a temporary write-protected state, causing data to appear written but not persist across unmounts, thus thwarting forensic collection.
- Red Teams Drive Forensic Innovation: These anti-forensic techniques, developed from a red team perspective, highlight critical gaps in current forensic tools and methodologies, forcing defenders to adapt and develop more advanced detection and analysis capabilities.
- Beyond Static Analysis: Defenders must pivot from relying solely on static analysis of memory dumps to more dynamic, behavioral, and kernel-level monitoring to detect sophisticated malware that actively evades traditional forensic tools.
- Physical Media Integrity is Crucial: Forensic investigators must go beyond superficial checks of physical storage media, verifying authenticity, actual storage capacity, and persistence of data at a firmware level to avoid being misled by manipulated devices.
About the Speaker(s)
int0x80 is a security researcher and a member of the rap group Dual Core, known for songs like "Drank All the Booze, Hack All the Things." He has a history of presenting on anti-forensics, having debuted previous iterations of his research at conferences like BruCON in 2012. Operating on a red team, int0x80 focuses on developing and employing techniques to protect custom malware and evade detection. He openly states his enjoyment of "trolling federal agencies" and approaches security research with a "dog science on the keyboard" methodology, experimenting with "what happens if I do this" to uncover novel attack and anti-forensic vectors.
Reviews
- Dr. Zero (Offensive Security Researcher) — MUST SEE ★★★★★