Android APK ์ฒดํฌ๋ฆฌ์ŠคํŠธ

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 ์ง€์›ํ•˜๊ธฐ

Learn Android fundamentals

Static Analysis

  • ๋‹ค์Œ ํ•ญ๋ชฉ ํ™•์ธ: obfuscation ์‚ฌ์šฉ ์—ฌ๋ถ€, ๊ธฐ๊ธฐ๊ฐ€ rooted์ธ์ง€ ์—ฌ๋ถ€, emulator ์‚ฌ์šฉ ์—ฌ๋ถ€, anti-tampering ์ฒดํฌ ๋“ฑ. Read this for more info.
  • ๋ฏผ๊ฐํ•œ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜(์˜ˆ: bank apps)์€ ๊ธฐ๊ธฐ๊ฐ€ rooted์ธ์ง€ ํ™•์ธํ•˜๊ณ  ๊ทธ์— ๋”ฐ๋ผ ๋™์ž‘ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.
  • interesting strings ๊ฒ€์ƒ‰ (passwords, URLs, API, encryption, backdoors, tokens, Bluetooth uuidsโ€ฆ).
  • firebase ๊ด€๋ จ APIs์— ํŠน๋ณ„ํžˆ ์ฃผ์˜ํ•˜์„ธ์š”.(firebase APIs).
  • Read the manifest:
  • ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์ด debug ๋ชจ๋“œ์ธ์ง€ ํ™•์ธํ•˜๊ณ  โ€˜exploitโ€™ ์‹œ๋„ํ•ด๋ณด์„ธ์š”.
  • APK๊ฐ€ backups๋ฅผ ํ—ˆ์šฉํ•˜๋Š”์ง€ ํ™•์ธํ•˜์„ธ์š”.
  • Exported Activities ํ™•์ธ
  • Unity Runtime: exported UnityPlayerActivity/UnityPlayerGameActivity์™€ unity CLI extras bridge. pre-init dlopen() RCE๋ฅผ ์œ„ํ•ด -xrsdk-pre-init-library <abs-path> ํ…Œ์ŠคํŠธ. ์ž์„ธํ•œ ๋‚ด์šฉ์€ Intent Injection โ†’ Unity Runtime ์ฐธ๊ณ .
  • Content Providers ์ ๊ฒ€
  • Exposed services ์ ๊ฒ€
  • Broadcast Receivers ์ ๊ฒ€
  • URL Schemes ์ ๊ฒ€
  • ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์ด ๋‚ด๋ถ€ ๋˜๋Š” ์™ธ๋ถ€์— ๋ฐ์ดํ„ฐ๋ฅผ ์•ˆ์ „ํ•˜์ง€ ์•Š๊ฒŒ ์ €์žฅํ•˜๊ณ  ์žˆ๋Š”๊ฐ€? saving data insecurely internally or externally
  • ํ•˜๋“œ์ฝ”๋”ฉ๋œ ํŒจ์Šค์›Œ๋“œ ๋˜๋Š” ๋””์Šคํฌ์— ์ €์žฅ๋œ ํŒจ์Šค์›Œ๋“œ๊ฐ€ ์žˆ๋Š”๊ฐ€? password hard coded or saved in disk ์•ฑ์ด insecureํ•œ crypto ์•Œ๊ณ ๋ฆฌ์ฆ˜์„ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ๋Š”๊ฐ€? using insecurely crypto algorithms
  • ๋ชจ๋“  ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๊ฐ€ PIE ํ”Œ๋ž˜๊ทธ๋กœ ์ปดํŒŒ์ผ๋˜์—ˆ๋Š”๊ฐ€?
  • ์ •์  Android ๋ถ„์„๊ธฐ๋“ค(static Android Analyzers)์ด ์ด ๋‹จ๊ณ„์—์„œ ๋งŽ์€ ๋„์›€์„ ์ค„ ์ˆ˜ ์žˆ๋‹ค๋Š” ๊ฒƒ์„ ์žŠ์ง€ ๋งˆ์„ธ์š”. (์ž๋™ ๋ถ„์„ ์ฐธ๊ณ )
  • android:exported Android 12+์—์„œ ํ•„์ˆ˜ โ€“ ์ž˜๋ชป ๊ตฌ์„ฑ๋œ exported ์ปดํฌ๋„ŒํŠธ๋Š” ์™ธ๋ถ€ intent ํ˜ธ์ถœ๋กœ ์ด์–ด์งˆ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
  • Network Security Config (networkSecurityConfig XML)๋ฅผ ๊ฒ€ํ† ํ•˜์—ฌ cleartextTrafficPermitted="true" ๋˜๋Š” ๋„๋ฉ”์ธ๋ณ„ ์˜ค๋ฒ„๋ผ์ด๋“œ๊ฐ€ ์žˆ๋Š”์ง€ ํ™•์ธํ•˜์„ธ์š”.
  • Play Integrity / SafetyNet / DeviceCheck ํ˜ธ์ถœ์„ ์ฐพ์•„์„œ ์ปค์Šคํ…€ attestation์„ ํ›…/์šฐํšŒํ•  ์ˆ˜ ์žˆ๋Š”์ง€ ํŒ๋‹จํ•˜์„ธ์š”.
  • App Links / Deep Links (android:autoVerify)๋ฅผ ๊ฒ€์‚ฌํ•˜์—ฌ intent-๋ฆฌ๋””๋ ‰์…˜ ๋˜๋Š” open-redirect ๋ฌธ์ œ๊ฐ€ ์žˆ๋Š”์ง€ ํ™•์ธํ•˜์„ธ์š”.
  • WebView.addJavascriptInterface ๋˜๋Š” loadData*() ํ˜ธ์ถœ์„ ์ฐพ์•„ ์•ฑ ๋‚ด๋ถ€์—์„œ RCE / XSS๋กœ ์ด์–ด์งˆ ์ˆ˜ ์žˆ๋Š”์ง€ ํ™•์ธํ•˜์„ธ์š”.
  • ํฌ๋กœ์Šคํ”Œ๋žซํผ ๋ฒˆ๋“ค(Flutter libapp.so, React-Native JS bundles, Capacitor/Ionic assets)์„ ๋ถ„์„ํ•˜์„ธ์š”. ์ „์šฉ ๋„๊ตฌ:
  • flutter-packer, fluttersign, rn-differ
  • ์ œ3์ž ๋„ค์ดํ‹ฐ๋ธŒ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ์Šค์บ”ํ•˜์—ฌ ์•Œ๋ ค์ง„ CVE ํ™•์ธ(์˜ˆ: libwebp CVE-2023-4863, libpng ๋“ฑ).
  • ์ถ”๊ฐ€ ๋ฐœ๊ฒฌ์„ ์œ„ํ•ด SEMgrep Mobile rules, Pithus ๋ฐ ์ตœ์‹  MobSF โ‰ฅ 3.9 AI ์ง€์› ์Šค์บ” ๊ฒฐ๊ณผ ํ‰๊ฐ€.

Dynamic Analysis

  • ํ™˜๊ฒฝ ์ค€๋น„(online, local VM or physical)
  • ์˜๋„์น˜ ์•Š์€ data leak(๋กœ๊น…, ๋ณต์‚ฌ/๋ถ™์—ฌ๋„ฃ๊ธฐ, crash logs) ์—ฌ๋ถ€ ํ™•์ธ
  • SQLite DB์— ๊ธฐ๋ฐ€ ์ •๋ณด๊ฐ€ ์ €์žฅ๋˜๊ณ  ์žˆ๋Š”๊ฐ€?(Confidential information being saved in SQLite dbs)
  • Exploitable exposed Activities ์—ฌ๋ถ€
  • Exploitable Content Providers ์—ฌ๋ถ€
  • Exploitable exposed Services ์—ฌ๋ถ€
  • Exploitable Broadcast Receivers ์—ฌ๋ถ€
  • ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์ด clear text๋กœ ์ •๋ณด๋ฅผ ์ „์†กํ•˜๊ฑฐ๋‚˜ ์•ฝํ•œ ์•Œ๊ณ ๋ฆฌ์ฆ˜์„ ์‚ฌ์šฉํ•˜๋Š”๊ฐ€?(transmitting information in clear text/using weak algorithms) MitM๊ฐ€ ๊ฐ€๋Šฅํ•œ๊ฐ€?
  • HTTP/HTTPS ํŠธ๋ž˜ํ”ฝ ๊ฒ€์‚ฌ(Inspect HTTP/HTTPS traffic)
  • HTTP ํŠธ๋ž˜ํ”ฝ์„ ์บก์ฒ˜ํ•  ์ˆ˜ ์žˆ๋‹ค๋ฉด ์ผ๋ฐ˜์ ์ธ Web ์ทจ์•ฝ์ ์„ ์ฐพ์„ ์ˆ˜ ์žˆ์œผ๋ฏ€๋กœ ๋งค์šฐ ์ค‘์š”ํ•ฉ๋‹ˆ๋‹ค(Hacktricks๋Š” ์›น ์ทจ์•ฝ์ ์— ๊ด€ํ•œ ๋งŽ์€ ์ •๋ณด๋ฅผ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค).
  • ๊ฐ€๋Šฅํ•œ Android Client Side Injections ๊ฒ€์‚ฌ(Android Client Side Injections) (์ •์  ์ฝ”๋“œ ๋ถ„์„์ด ๋„์›€๋  ์ˆ˜ ์žˆ์Œ)
  • Frida: Frida๋ฅผ ์‚ฌ์šฉํ•ด ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์—์„œ ํฅ๋ฏธ๋กœ์šด ๋™์  ๋ฐ์ดํ„ฐ๋ฅผ ํš๋“ํ•˜์„ธ์š”(์˜ˆ: ํŒจ์Šค์›Œ๋“œ).
  • Tapjacking / Animation-driven attacks (TapTrap 2025) ํ…Œ์ŠคํŠธ โ€” Android 15+์—์„œ๋„(overlay ๊ถŒํ•œ ๋ถˆํ•„์š”) ์ฃผ์˜.
  • overlay / SYSTEM_ALERT_WINDOW clickjacking ๋ฐ Accessibility Service ๋‚จ์šฉ์„ ํ†ตํ•ด ๊ถŒํ•œ ์ƒ์Šน ์‹œ๋„.
  • adb backup / bmgr backupnow๋กœ ์•ฑ ๋ฐ์ดํ„ฐ๋ฅผ ๋คํ”„ํ•  ์ˆ˜ ์žˆ๋Š”์ง€ ํ™•์ธ(allowBackup๋ฅผ ๋น„ํ™œ์„ฑํ™”ํ•˜์ง€ ์•Š์€ ์•ฑ).
  • Binder-level LPEs ํƒ์ƒ‰(์˜ˆ: CVE-2023-20963, CVE-2023-20928) โ€” ํ—ˆ์šฉ๋˜๋Š” ๊ฒฝ์šฐ ์ปค๋„ ํผ์ € ๋˜๋Š” PoC ์‚ฌ์šฉ.
  • Play Integrity / SafetyNet์ด ๊ฐ•์ œ๋˜๋Š” ๊ฒฝ์šฐ runtime ํ›…(์˜ˆ: Frida Gadget, MagiskIntegrityFix, Integrity-faker) ๋˜๋Š” ๋„คํŠธ์›Œํฌ ๋ ˆ๋ฒจ ๋ฆฌํ”Œ๋ ˆ์ด ์‹œ๋„.
  • ์ตœ์‹  ํˆด๋กœ ๊ณ„์ธก:
  • Objection > 2.0, Frida 17+, NowSecure-Tracer (2024)
  • ์‹œ์Šคํ…œ ์ „๋ฐ˜์˜ ๋™์  ํŠธ๋ ˆ์ด์‹ฑ: perfetto / simpleperf.

Some obfuscation/Deobfuscation information

์ฐธ๊ณ ์ž๋ฃŒ

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 ์ง€์›ํ•˜๊ธฐ