Tapjacking
Tip
AWS ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training AWS Red Team Expert (ARTE)
GCP ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:HackTricks Training GCP Red Team Expert (GRTE)
Azure ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training Azure Red Team Expert (AzRTE)
HackTricks ์ง์ํ๊ธฐ
- ๊ตฌ๋ ๊ณํ ํ์ธํ๊ธฐ!
- **๐ฌ ๋์ค์ฝ๋ ๊ทธ๋ฃน ๋๋ ํ ๋ ๊ทธ๋จ ๊ทธ๋ฃน์ ์ฐธ์ฌํ๊ฑฐ๋ ํธ์ํฐ ๐ฆ @hacktricks_live๋ฅผ ํ๋ก์ฐํ์ธ์.
- HackTricks ๋ฐ HackTricks Cloud ๊นํ๋ธ ๋ฆฌํฌ์งํ ๋ฆฌ์ PR์ ์ ์ถํ์ฌ ํดํน ํธ๋ฆญ์ ๊ณต์ ํ์ธ์.
๊ธฐ๋ณธ ์ ๋ณด
Tapjacking์ ์ ์ฑ ์ ํ๋ฆฌ์ผ์ด์ ์ด ์คํ๋์ด ํผํด ์ฑ ์์ ์์ ์ ๋ฐฐ์นํ๋ ๊ณต๊ฒฉ์ ๋๋ค. ํผํด ์ฑ์ ๋์ ๋๊ฒ ๊ฐ๋ฆฐ ๋ค, UI๋ฅผ ์ฌ์ฉ์๊ฐ ์ํธ์์ฉํ๋๋ก ์์ด๊ฒ ์ค๊ณํ๊ณ ๊ทธ ์ํธ์์ฉ์ ํผํด ์ฑ์ผ๋ก ์ ๋ฌํฉ๋๋ค. ๊ฒฐ๊ณผ์ ์ผ๋ก ์ฌ์ฉ์๋ ์์ ์ด ์ค์ ๋ก ํผํด ์ฑ์์ ๋์์ ์ํํ๊ณ ์๋ค๋ ์ฌ์ค์ ์์ง ๋ชปํ๊ฒ ๋ฉ๋๋ค.
ํ์ง
- Android manifest์์ exported activities๋ฅผ ํ์ธํ์ธ์ (intent-filter๊ฐ ์๋ activity๋ ๊ธฐ๋ณธ์ ์ผ๋ก exported๋ฉ๋๋ค). ๋ง์ฝ exported activity๊ฐ ๊ถํ์ผ๋ก ๋ณดํธ๋์ด ์๋ค๋ฉด, ๊ณต๊ฒฉ ์ฑ์ ๋์ผํ ๊ถํ์ ํ์๋ก ํ๋ฏ๋ก ์ต์คํ๋ก์ ๊ฐ๋ฅ์ฑ์ด ์ ํ๋ฉ๋๋ค.
AndroidManifest.xml์android:minSdkVersion(minimum SDK) ๊ฐ์ ํ์ธํ์ธ์. ๊ฐ์ด 30 ๋ฏธ๋ง์ด๋ฉด ์ด์ ์ ๊ธฐ๋ณธ ๋์์ผ๋ก ์ธํด tapjacking์ ์ ์ฉํ๊ธฐ ์ฌ์์ง ์ ์์ต๋๋ค.- ๋ฐํ์์์๋
logcat์ ์ฌ์ฉํด Android 12+์์ ์ฐจ๋จ๋ ํฐ์น๋ฅผ ํ์ธํ์ธ์: ์ค๋ฒ๋ ์ด๊ฐ ํํฐ๋ง๋ ๋ ์์คํ ์Untrusted touch due to occlusion by <package>๋ก๊ทธ๋ฅผ ๋จ๊น๋๋ค.
๋ณดํธ
Android 12+ ๊ธฐ๋ณธ ์ฐจ๋จ ๋ฐ compat flags
Android 12 (API 31)์ โBlock untrusted touchesโ ๊ธฐ๋ฅ์ ๋์
ํ์ต๋๋ค: TYPE_APPLICATION_OVERLAY ํ์
์ ๋ค๋ฅธ UID ์ฐฝ์์ ์ค๋ ํฐ์น(opacity โฅ0.8)๋ ๋ฌด์๋ฉ๋๋ค. ์ด ๊ธฐ๋ฅ์ ๊ธฐ๋ณธ์ ์ผ๋ก ํ์ฑํ๋์ด ์์ต๋๋ค. ํ
์คํธ ์ค์๋ ์ด๋ฅผ ํ ๊ธํ ์ ์์ต๋๋ค:
# disable blocking for a specific package (for PoC crafting)
adb shell am compat disable BLOCK_UNTRUSTED_TOUCHES com.example.victim
# reโenable
adb shell am compat reset BLOCK_UNTRUSTED_TOUCHES com.example.victim
์ ๋ขฐ๋ ์๋์ฐ(์ ๊ทผ์ฑ, IME, assistant)๋ ์ฌ์ ํ ์ด๋ฒคํธ๋ฅผ ์์ ํฉ๋๋ค. ๋ณด์ด์ง ์๊ฑฐ๋ ์์ ํ ํฌ๋ช
ํ ์ค๋ฒ๋ ์ด๋ ์ฐจ๋จ์ ์ฐํํ ์ ์์ผ๋ฉฐ, ๊ณต๊ฒฉ์๋ alpha < 0.8์ ์ ์งํด ์ด๋ฅผ ์
์ฉํ๋ ค๊ณ ํฉ๋๋ค.
๋ถ๋ถ ๊ฐ๋ฆผ ์ฒ๋ฆฌ
๋์ ์์ญ์ ๋
ธ์ถ์ํค๋ ๋ถ๋ถ ์ค๋ฒ๋ ์ด๋ ์๋์ผ๋ก ์ฐจ๋จ๋์ง ์์ต๋๋ค. ๋ฏผ๊ฐํ ๋ทฐ์์๋ FLAG_WINDOW_IS_PARTIALLY_OBSCURED ํ๋๊ทธ๊ฐ ์ค์ ๋ ์ด๋ฒคํธ๋ฅผ ๊ฑฐ๋ถํ์ฌ ์ํํ์ธ์:
@Override
public boolean onFilterTouchEventForSecurity(MotionEvent event) {
if ((event.getFlags() & MotionEvent.FLAG_WINDOW_IS_PARTIALLY_OBSCURED) != 0) {
return false; // drop tap when anything partially obscures us
}
return super.onFilterTouchEventForSecurity(event);
}
filterTouchesWhenObscured
**android:filterTouchesWhenObscured**๊ฐ **true**๋ก ์ค์ ๋์ด ์์ผ๋ฉด, ๋ค๋ฅธ ๋ณด์ด๋ ์ฐฝ์ ์ํด ๋ทฐ์ ์๋์ฐ๊ฐ ๊ฐ๋ ค์ง ๋ View๋ ํฐ์น ์ด๋ฒคํธ๋ฅผ ๋ฐ์ง ์์ต๋๋ค.
setFilterTouchesWhenObscured
setFilterTouchesWhenObscured ์์ฑ์ true๋ก ์ค์ ํ๋ฉด Android ๋ฒ์ ์ด ๋ฎ์ ๊ฒฝ์ฐ์๋ ์ด ์ทจ์ฝ์ ์ ์
์ฉ์ ๋ฐฉ์งํ ์ ์์ต๋๋ค.
๋ง์ฝ **true**๋ก ์ค์ ํ๋ฉด, ์๋ฅผ ๋ค์ด ๋ฒํผ์ ๊ฐ๋ ค์ ธ ์์ ๋ ์๋์ผ๋ก ๋นํ์ฑํ๋ ์ ์์ต๋๋ค:
<Button android:text="Button"
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:filterTouchesWhenObscured="true">
</Button>
Exploitation
Tapjacking-ExportedActivity
The most recent Android application performing a Tapjacking attack (+ invoking before an exported activity of the attacked application) can be found in: https://github.com/carlospolop/Tapjacking-ExportedActivity.
์ฌ์ฉํ๋ ค๋ฉด README ์ง์นจ์ ๋ฐ๋ฅด์ญ์์ค.
FloatingWindowApp
An example project implementing FloatingWindowApp, which can be used to put on top of other activities to perform a clickjacking attack, can be found in FloatingWindowApp (a bit old, good luck building the apk).
Qark
Caution
It looks like this project is now unmaintained and this functionality isnโt properly working anymore
You can use qark with the --exploit-apk โsdk-path /Users/username/Library/Android/sdk parameters to create a malicious application to test for possible Tapjacking vulnerabilities.\
์ํ ๋ฐฉ๋ฒ์ ๋น๊ต์ ๊ฐ๋จํฉ๋๋ค. ๊ฐ๋ฐ์๋ ๋ทฐ๊ฐ ๋ค๋ฅธ ๋ทฐ์ ๊ฐ๋ ค์ก์ ๋ ํฐ์น ์ด๋ฒคํธ๋ฅผ ๋ฐ์ง ์๋๋ก ์ ํํ ์ ์์ต๋๋ค. Using the Android Developerโs Reference:
Sometimes it is essential that an application be able to verify that an action is being performed with the full knowledge and consent of the user, such as granting a permission request, making a purchase or clicking on an advertisement. Unfortunately, a malicious application could try to spoof the user into performing these actions, unaware, by concealing the intended purpose of the view. As a remedy, the framework offers a touch filtering mechanism that can be used to improve the security of views that provide access to sensitive functionality.
To enable touch filtering, call
setFilterTouchesWhenObscured(boolean)or set the android:filterTouchesWhenObscured layout attribute to true. When enabled, the framework will discard touches that are received whenever the viewโs window is obscured by another visible window. As a result, the view will not receive touches whenever a toast, dialog or other window appears above the viewโs window.
Recent overlay-based malware techniques
- Hook/Ermac variants use nearly transparent overlays (e.g., fake NFC prompts) to capture gestures and lock-screen PINs while forwarding touches underneath, delivered via Accessibility-ATS modules.
- Anatsa/TeaBot droppers ship overlays for hundreds of banking/crypto apps and show full-screen โmaintenanceโ overlays to stall victims while ATS completes transfers.
- Hidden-VNC banking RATs briefly display phishing overlays to capture credentials, then rely on covert VNC plus Accessibility to replay taps with fewer on-device artifacts.
Practical takeaway for red teams: mix an alpha < 0.8 overlay to bypass Android 12 blocking, then escalate to a full-screen accessibility overlay once the user toggles the service. Instrument GestureDescription or a headless VNC to keep control after credentials are captured.
Accessibility Overlay Phishing (Banking-Trojan Variant)
Besides classic Tapjacking, modern Android banking malware families (e.g. ToxicPanda, BrasDex, Sova, etc.) abuse the Accessibility Service to place a full-screen WebView overlay above the legitimate application while still being able to forward the user input to the view underneath. This dramatically increases believability and allows attackers to steal credentials, OTPs or even automate fraudulent transactions.
How it works
- ์
์ฑ APK๋
BIND_ACCESSIBILITY_SERVICE๋ผ๋ ๊ณ ๊ฐ๋ ๊ถํ์ ์์ฒญํ๋ฉฐ, ๋ณดํต ์์ฒญ์ ๊ฐ์ง Google/Chrome/PDF-viewer ๋ํ์์ ๋ค์ ์จ๊น๋๋ค. - ์ฌ์ฉ์๊ฐ ์๋น์ค๋ฅผ ํ์ฑํํ๋ฉด, ์
์ฑ์ฝ๋๋ ์ถ๊ฐ๋ก ์ํํ ๊ถํ๋ค(
READ_SMS,SYSTEM_ALERT_WINDOW,REQUEST_INSTALL_PACKAGES, โฆ)์ ๋ถ์ฌํ๊ธฐ ์ํด ํ์ํ ํญ์ ํ๋ก๊ทธ๋๋ฐ์ ์ผ๋ก ์๋ฎฌ๋ ์ด์ ํฉ๋๋ค. - A WebView is inflated and added to the window manager using the
TYPE_ACCESSIBILITY_OVERLAYwindow type. The overlay can be rendered totally opaque or semi-transparent and can be flagged as โthroughโ so that the original touches are still delivered to the background activity (thus the transaction really happens while the victim only sees the phishing form).
WebView phishingView = new WebView(getApplicationContext());
phishingView.getSettings().setJavaScriptEnabled(true);
phishingView.loadUrl("file:///android_asset/bank_login.html");
WindowManager wm = (WindowManager) getSystemService(WINDOW_SERVICE);
WindowManager.LayoutParams lp = new WindowManager.LayoutParams(
WindowManager.LayoutParams.MATCH_PARENT,
WindowManager.LayoutParams.MATCH_PARENT,
WindowManager.LayoutParams.TYPE_ACCESSIBILITY_OVERLAY, // <-- bypasses SYSTEM_ALERT_WINDOW prompt
WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE |
WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL, // ยซthroughยป flag โ forward touches
PixelFormat.TRANSLUCENT);
wm.addView(phishingView, lp);
banking Trojans์์ ์ฌ์ฉ๋๋ ์ผ๋ฐ์ ์ธ ์ํฌํ๋ก์ฐ
- ์ค์น๋ ํจํค์ง(
QUERY_ALL_PACKAGES)๋ฅผ ์กฐํํ์ฌ ํ์ฌ ์ด๋ค ๋ฑ ํน/์ง๊ฐ ์ฑ์ด ์ด๋ ค ์๋์ง ํ์ธํ๋ค. - C2์์ ํด๋น ์ ํ๋ฆฌ์ผ์ด์ ์ ์๋ฒฝํ๊ฒ ๋ชจ๋ฐฉํ๋ HTML/JS overlay template์ ๋ค์ด๋ก๋ํ๋ค(๋ก๊ณ , ์์, i18n ๋ฌธ์์ดโฆ).
- ์ค๋ฒ๋ ์ด๋ฅผ ํ์ํด ์๊ฒฉ์ฆ๋ช /PIN/ํจํด์ ํ์ทจํ๋ค.
- ๋ฐฑ๊ทธ๋ผ์ด๋์์ ์ด์ฒด๋ฅผ ์๋ํํ๊ธฐ ์ํด Accessibility API(
performGlobalAction,GestureDescription)๋ฅผ ์ฌ์ฉํ๋ค.
ํ์ง ๋ฐ ์ํ
adb shell pm list packages -3 -e BIND_ACCESSIBILITY_SERVICE๋ก ์ค์น๋ ์ฑ ๋ชฉ๋ก์ ๊ฐ์ฌํ๋ค.- ์ ํ๋ฆฌ์ผ์ด์ ์ธก(์ํ/์ง๊ฐ)์์๋:
- ๋ฏผ๊ฐํ ๋ทฐ์
android:accessibilityDataSensitive="accessibilityDataPrivateYes"(Android 14+)๋ฅผ ์ ์ฉํด non-Play-Store ์๋น์ค๋ฅผ ์ฐจ๋จํ๋ค. setFilterTouchesWhenObscured(true)์FLAG_SECURE๋ฅผ ํจ๊ป ์ฌ์ฉํ๋ค.
์ ์ฒด ์๊ฒฉ ๋๋ฐ์ด์ค ์ ์ด๋ฅผ ์ํด Accessibility Services๋ฅผ ์ ์ฉํ๋ ๋ฐฉ๋ฒ(์: PlayPraetor, SpyNote ๋ฑ)์ ๋ํ ์ถ๊ฐ ์ธ๋ถ์ฌํญ์ ๋ค์์ ์ฐธ์กฐ:
์ฐธ๊ณ ์๋ฃ
- Android Developers โ Tapjacking risk & mitigations (updated 2024)
- Zimperium โ HOOK v3 overlay expansion (Aug 2025)
Tip
AWS ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training AWS Red Team Expert (ARTE)
GCP ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:HackTricks Training GCP Red Team Expert (GRTE)
Azure ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training Azure Red Team Expert (AzRTE)
HackTricks ์ง์ํ๊ธฐ
- ๊ตฌ๋ ๊ณํ ํ์ธํ๊ธฐ!
- **๐ฌ ๋์ค์ฝ๋ ๊ทธ๋ฃน ๋๋ ํ ๋ ๊ทธ๋จ ๊ทธ๋ฃน์ ์ฐธ์ฌํ๊ฑฐ๋ ํธ์ํฐ ๐ฆ @hacktricks_live๋ฅผ ํ๋ก์ฐํ์ธ์.
- HackTricks ๋ฐ HackTricks Cloud ๊นํ๋ธ ๋ฆฌํฌ์งํ ๋ฆฌ์ PR์ ์ ์ถํ์ฌ ํดํน ํธ๋ฆญ์ ๊ณต์ ํ์ธ์.


