Proof of concept implementation of TapTrap that requests camera permissions.
app/src/main/java/click/taptrap/poc/MainActivity.java- Main activity that performs the TapTrap attackapp/src/main/res/anim/fade_in.xml- Malicious animation used to perform TapTrapapp/src/main/res/layout/activity_main.xml- Layout file for the main activityDockerfile- Dockerfile for containerizationgradle/- Gradle wrapper files (used for native builds, not in Docker)
The TapTrap proof-of-concept (PoC) demonstrates a permission-based variant of the TapTrap attack by targeting the system-level camera permission.
- Pressing Start initiates the attack sequence.
- The user is prompted to click “Click here”, which is designed to lure them into unintentionally granting camera access.
- The attack window lasts for 6 seconds. If the permission is not granted within this window, the attack is retried.
- The attack is considered successful if the app displays "Permission granted".
You can manually verify the permission state by navigating to Settings > Security & Privacy > Privacy controls > Permission manager > Camera.
Note
The app is optimized for a Pixel 6a running Android 15. On other devices or OS versios, the positioning of the button in interplay with the Allow button of the permission prompt
may have to be adjusted. To change the animation, go to app/src/main/res/anim/fade_in.xml and change the fromXDelta, toXDelta, fromYDelta, toYDelta parameters accordingly.
The following video demonstrates the proof of concept:
- Build the image. On ARM systems (e.g., Mac with Apple Silicon), include
--platform=linux/amd64:
docker build --platform=linux/amd64 -t taptrap_poc .- Run the container and replace
<OUT_DIR>with the directory you want to store the APK in:
docker run --rm \
-v <OUT_DIR>:/apk-output \
taptrap_poc- The built APK will be saved to:
<OUT_DIR>/click.taptrap.poc.apkWarning
<OUT_DIR> must be an absolute path.
Note
Prerequisite: Android Studio is installed and ANDROID_HOME points to the SDK location.
- Open the project in Android Studio.
- Go to Build > Build App Bundle(s) / APK(s) > Build APK(s).
- The APK will be located at:
app/build/outputs/apk/debug/app-debug.apk- Ensure
local.propertiespoints to the Android SDK:
echo "sdk.dir=$ANDROID_HOME" > local.properties- Run the build:
./gradlew assembleDebug- The APK will be located at:
app/build/outputs/apk/debug/app-debug.apkNote
Prerequisite: ADB must be installed and available in your PATH.
- Connect a device and enable USB debugging (Settings > About phone > Tap Build number 7x, then Developer Options > Enable USB Debugging). USB debugging does not need to be enabled on emulators.
- Install the APK and replace
<APK>with the path to the APK:
adb install <APK>The positioning of the button/zoom of the animation probably does not fit your device. To modify the animation, edit the app/src/main/res/anim/fade_in.xml file and adjust fromXDelta, toXDelta, fromYDelta, and toYDelta. You can also increase alpha to debug.