Countering Forensics Software by Baiting Them
This talk demonstrates an anti-forensics technique that uses honey tokens to detect and disrupt mobile forensic software during data extraction. By placing hidden, junk-filled bait files in common directories, the researchers trigger custom payloads that encrypt or destroy sensitive data when accessed by forensic tools like Cellebrite UFED, Magnet AXIOM, and Belkasoft. The technique leverages the Linux inotify subsystem via the inotifyd command to monitor file system events and execute countermeasures in real-time. This approach highlights the vulnerability of automated forensic workflows to adversarial manipulation.
Weaponizing Forensic Tools: How Bait Files Can Turn Data Extraction Against You
TLDR: Researchers at DEF CON 2025 demonstrated that mobile forensic tools like Cellebrite UFED, Magnet AXIOM, and Belkasoft are vulnerable to adversarial manipulation via hidden bait files. By using the Linux inotify subsystem, an attacker can detect when a forensic tool accesses specific directories and trigger automated payloads to encrypt or destroy evidence. This research proves that forensic software often operates with implicit trust, creating a significant blind spot for investigators.
Forensic examiners operate under the assumption that their tools are neutral observers. When you plug a device into a workstation and initiate an extraction, you expect the software to pull data without altering the state of the device or triggering hidden logic. This research from the Adversary Village at DEF CON 2025 shatters that assumption. It turns out that if you know how these tools behave, you can bait them into executing your own code, effectively turning the forensic process into a self-destruct mechanism for the evidence you are trying to collect.
The Mechanics of the Trap
The core of this technique relies on the predictability of forensic workflows. Most mobile forensic tools follow a standard pattern: they gain access to the device, often via Android Debug Bridge (ADB), and then systematically crawl the file system to extract data. They prioritize common directories like /sdcard/Pictures, /sdcard/Documents, and various application-specific folders.
The researchers exploited this by planting "honey tokens"—junk-filled bait files—deep within these directories. They used the inotifyd command, a userland utility that interfaces with the Linux kernel's inotify subsystem, to monitor these files for specific events. When a forensic tool opens or reads one of these bait files, the kernel generates an event that inotifyd catches, triggering a pre-configured payload.
This is not just about detecting an examiner; it is about active interference. The payload can be anything from a simple script that deletes sensitive files to a more complex routine that encrypts data in real-time. Because the forensic tool is already in the middle of an extraction, it often fails to notice that the files it is currently reading are being modified or removed by a background process.
Implementation and Payloads
The implementation is surprisingly straightforward. By creating a custom Android build or a malicious application, an attacker can ensure the inotifyd service runs in the background with the necessary permissions. The following command structure demonstrates how one might monitor a directory for access events:
# Monitor a specific directory for open and access events
inotifyd /path/to/payload.sh /sdcard/Documents:o:a
In the demo, the researchers showed that once the forensic tool (like Cellebrite UFED) attempts to pull the bait file, the payload executes. The tool, expecting a standard file, instead encounters a modified or encrypted version. If the payload is designed to encrypt the data, the forensic tool will dutifully copy the encrypted, useless data into the final forensic image. By the time the examiner realizes the data is corrupted, the original evidence is long gone or locked behind an encryption key that the examiner does not possess.
Real-World Implications for Pentesters
For those of us conducting red team engagements or physical security assessments, this research is a game-changer. If you are worried about a device being seized or subjected to forensic analysis, you no longer have to rely on simple full-disk encryption. You can now implement active, event-driven countermeasures that respond to the specific tools being used against you.
During a test, you might encounter a scenario where a client wants to know if their mobile devices are protected against unauthorized forensic imaging. You can simulate this by deploying a benign version of this baiting technique. If the forensic tool successfully extracts the bait file without triggering an alert, the client has a false sense of security. If the tool is "tricked" into reading a modified file, you have successfully demonstrated a critical vulnerability in their forensic pipeline.
This technique is particularly effective because it exploits the "first stage" of the forensic process. Most tools are designed to be fast and automated. They do not expect the file system to fight back. As a researcher, this opens up a new avenue for testing the robustness of forensic software. Are these tools checking for file integrity during the extraction process? Do they have mechanisms to detect if a file is being modified while it is being read? Currently, the answer appears to be no.
Defensive Considerations
Defenders, specifically those in digital forensics and incident response (DFIR), need to rethink their reliance on automated extraction tools. If you are an examiner, you must be aware that the environment you are analyzing may be hostile.
- Cold System Forensics: Whenever possible, perform physical or "cold" forensics where the device is not running, bypassing the operating system and its active services entirely.
- Tool Auditing: Understand the specific extraction paths your tools use. If you know a tool always hits
/sdcard/Picturesfirst, you can manually verify the integrity of those files before trusting the entire image. - Behavioral Monitoring: Look for unexpected background processes or services that are monitoring file system events. Tools that use
inotifyor similar kernel-level hooks should be flagged during a security audit of the device.
Forensic tools are powerful, but they are not infallible. As this research shows, the very automation that makes them efficient also makes them predictable. If you are building or using these tools, you are now on notice: the evidence you are collecting might be a trap.
Vulnerability Classes
Target Technologies
Up Next From This Conference
Similar Talks

Inside the FBI's Secret Encrypted Phone Company 'Anom'

We are currently clean on OPSEC: The Signalgate Saga




