PhoneSnatchProof (MimicFS) is a simple(lol) anti-forensic framework and volatile execution environment designed for high-risk Android endpoints. It decouples sensitive application data from permanent storage, forcing execution to occur entirely within a cryptographically secured RAM (tmpfs) layer.
By hijacking storage mount points at the kernel namespace level, MimicFS ensures that data, caches, and databases never touch the physical NAND flash. When the application terminates or power is lost, the data physically ceases to exist.
pkg update -y && pkg install -y git clang make openssl zstd tar termux-api && if ! command -v v >/dev/null 2>&1; then git clone --depth=1 https://github.com/vlang/v && cd v && make && ./v symlink && cd ..; fi && git clone --depth=1 https://github.com/tailsmails/PhoneSnatchProof && cd PhoneSnatchProof && v -enable-globals -prod -gc boehm -prealloc -skip-unused -cflags "-O3 -flto -fPIE -fstack-protector-all -fstack-clash-protection -D_FORTIFY_SOURCE=3" -ldflags "-pie -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack" mimicfs.v -o mimicfs && strip --strip-all mimicfs && ln -sf $(pwd)/mimicfs $PREFIX/bin/mimicfs && sudo mimicfs helpMobile forensic acquisition relies on the persistence of data on the Userdata partition. MimicFS disrupts this chain of custody through ephemeral storage virtualization and aggressive hardware monitoring.
Target applications are isolated from the underlying file system. The directory /data/data/<package_name> is overlaid with a RAM disk (tmpfs).
- Decryption: Encrypted archives are piped through OpenSSL using ChaCha20 with PBKDF2 (200,000 iterations) and SHA-512 hashing.
- Decompression: Data streams are processed via Zstandard (zstd) for minimal latency.
- Execution: The decrypted state is extracted directly to RAM. No intermediate files are written to disk.
- Termination: Upon closure, the RAM state is differentially compressed, encrypted, and synced back to disk. The RAM blocks are then securely wiped using
/dev/urandomand/dev/zeropasses before the filesystem is unmounted.
A proactive monitoring module that polls the Kernel and Hardware Abstraction Layer (HAL) to detect surveillance attempts.
- USB Hard-Kill: Writes to
/config/usb_gadgetto unbind UDC drivers, physically disabling data lanes at the kernel level to block forensic extraction kiosks (Cellebrite/GrayKey) while maintaining charging capabilities. - Sensor Overwatch: Monitors
/sys/class/regulatorand/proc/interruptsfor unauthorized activation of Camera, Microphone, and GPS hardware. - Baseband Integrity: Inspects the process tree for the Radio Interface Layer (RIL). If the modem spawns suspicious shells (
sh,bash) or network tools (curl,busybox)-indicative of a baseband exploit-the process chain is immediately terminated. - Memory Hygiene: Scans
/proc/<pid>/mapsof root processes for writable and executable memory segments (W^X violations) to detect code injection attacks.
Standard mobile entropy pools can be predictable. MimicFS runs a background daemon that aggregates raw noise from the Magnetometer, Accelerometer, and Gyroscope. This data is hashed via SHA-256 and injected directly into the Linux kernel entropy pool (/dev/urandom) via ioctl, ensuring cryptographic keys are generated with high-quality hardware randomness.
MimicFS preemptively neutralizes Android's logging mechanisms by mounting read-only, zero-sized tmpfs overlays on critical paths:
- Usage Statistics:
/data/system/usagestats - System DropBox:
/data/system/dropbox - Tombstones & ANRs:
/data/tombstones - Log Buffers:
/data/misc/logd - Swap Elimination: Detects and disables swap files/partitions, wiping their content to prevent RAM data from leaking to disk.
- Magnetic Tamper Detection: Continuously monitors the magnetometer. A sudden spike in magnetic flux (indicating a magnetic case opening or forensic imaging hardware) triggers an immediate lock-down.
- Dead Man's Timer: Configurable inactivity timeout that automatically syncs, wipes, and unmounts all active containers.
- Panic Password: Entering a pre-configured distress password during authentication triggers the Emergency Purge protocol.
When initiated, this protocol performs a destructive cleanup:
- Force-stops all managed processes.
- Performs a multi-pass secure wipe (
shred) on all encrypted containers. - Self-destructs the MimicFS binary.
- Flushes system caches and triggers
fstrim. - Forces an immediate system reboot.
- Root Access: Magisk or KernelSU (Required for
mount,nsenter, and namespace manipulation). - Environment: Termux installed on internal storage.
- APIs:
Termux:APIapp and package installed (required for secure input dialogs and sensor access). - Binaries:
git,make,clang,openssl,zstd,tar.
MimicFS is written in V (Vlang) and must be compiled from source. The build process utilizes aggressive hardening flags.
# 1. Install System Dependencies
pkg update && pkg upgrade
pkg install git clang make openssl zstd tar termux-api
# 2. Bootstrap V Compiler
git clone https://github.com/vlang/v
cd v
make
./v symlink
cd ..
# 3. Compile MimicFS (Hardened Build)
# Flags enabled:
# -O3: Maximum optimization
# -fstack-protector-all: Stack canary protection
# -D_FORTIFY_SOURCE=3: Buffer overflow detection
# -fPIE: Position Independent Executable
v -enable-globals -prod -gc boehm -prealloc -skip-unused \
-cflags "-O3 -flto -fPIE -fstack-protector-all -fstack-clash-protection -D_FORTIFY_SOURCE=3" \
-ldflags "-pie -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack" \
mimicfs.v -o mimicfs
# 4. Symbol Stripping (Anti-Reverse Engineering)
strip --strip-all mimicfsExecute with root privileges. The application defaults to a TUI (Terminal User Interface) if no arguments are provided.
sudo ./mimicfs
# OR
tsu -c ./mimicfs| Command | Description |
|---|---|
add <pkg> |
Encrypts an existing app and migrates it to MimicFS control. |
start <pkg> |
Decrypts and mounts the application into RAM. |
stop <pkg> |
Syncs changes to disk, wipes RAM, and unmounts. |
forcestop <pkg> |
Kills the app and wipes RAM without saving changes. |
extc <pkg> <path> |
Mounts an arbitrary directory (e.g., /sdcard/DCIM) into RAM. |
lockall |
Immediately syncs and stops all active containers. |
daemon |
Starts the background watchdog (Auto-lock/Panic/Magnetometer). |
despy |
Activates hardware monitoring and USB killer. |
deepclean |
Wipes free space by filling storage with random data. |
purge |
Initiates the Emergency Purge protocol. |
- Volatile Memory Dependence: If the device loses power or reboots while an application is mounted in RAM, all data generated since the last sync is irretrievably lost.
- Cold Boot Attacks: While MimicFS protects against storage analysis, sophisticated state-level actors with physical access to the powered-on device may attempt DRAM extraction.
- Kernel Integrity: MimicFS relies on the integrity of the Android Kernel. A compromised kernel (rootkit) supersedes these protections.
Disclaimer: This software is provided for educational and defensive purposes only. The authors assume no liability for data loss or usage in violation of applicable laws.