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을 제출하여 해킹 트릭을 공유하세요.


