Android Enterprise Work Profile ํ์ ์ฑ ๋์ฒด
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์ ์ ์ถํ์ฌ ํดํน ํธ๋ฆญ์ ๊ณต์ ํ์ธ์.
๊ณต๊ฒฉ ํ๋ฉด
Android Enterprise Work Profiles are implemented as secondary Android users (BYOD example: user 0 = personal, user 1 = work). ๊ฐ ์ฌ์ฉ์๋ ๋
๋ฆฝ์ ์ธ /data/user/<id> ํธ๋ฆฌ, ์์คํ
์ฑ, Play Services ์ธ์คํด์ค ๋ฐ MDM์ด ๊ด๋ฆฌํ๋ ์ ์ฑ
๊ฐ์ฒด๋ฅผ ๊ฐ์ง๋๋ค. MDM(์: Microsoft Intune)์ด Work Profile์ ๋ํด ์ฑ์ required๋ก ํ์ํ๋ฉด, **Work-Profile Play Store (Finsky)**๋ ์ฃผ๊ธฐ์ ์ผ๋ก ํจํค์ง ์กด์ฌ๋ฅผ ํ์ธํ๊ณ ๋๋ฝ๋ ๊ฒฝ์ฐ ์๋์ผ๋ก ์ค์นํฉ๋๋ค.
CVE-2023-21257 ํจ์น๋ก DISALLOW_INSTALL_APPS ๋๋ DISALLOW_DEBUGGING_FEATURES๊ฐ ์ค์ ๋ ๊ฒฝ์ฐ ADB sideload๋ฅผ ์ฐจ๋จํ๋๋ผ๋, ๋ค์ ์ฒด์ธ์ ๊ณต๊ฒฉ์๊ฐ any Intune-required Work Profile app์ ์์ ์ฝ๋๋ก ๊ต์ฒดํ ์ ์๊ฒ ํฉ๋๋ค:
- Android Studio์ โInstall for all usersโ ๊ฒฝ๋ก๋ฅผ ์ ์ฉํด ๊ด๋ฆฌ๋๋ ํจํค์ง์ ์ ๋ฐ์ดํธ์ฒ๋ผ ๋ณด์ด๋ ์ ์ฑ APK๋ฅผ ์คํ ์ด์งํฉ๋๋ค.
- MDM์ด ํ์ ์ฑ์ด ๋๋ฝ๋ ๊ฒ์ ๊ฐ์งํ๋๋ก ๋ก๋๋ค. Intune์ Work-Profile Finsky ์ธ์คํด์ค์ ์ฌ์ค์น๋ฅผ ํธ๋ฆฌ๊ฑฐํฉ๋๋ค.
- Finsky๋ ์คํ
์ด์ง๋ APK ๋ฒ์ ๊ณผ Play Store ๋ฒ์ ์ ๋น๊ตํ๊ณ ์๋ ์ ํ์ ์ฐํํด **๊ฐ์ฅ ๋์
versionCode**๋ฅผ ์กฐ์ฉํ ์ค์นํฉ๋๋ค.
์ ์ฐฐ ๋ฐ ์ฌ์ ์กฐ๊ฑด ํ์ธ
- Confirm multi-user layout and user IDs:
adb shell pm list users
# Expect user 0 = Owner, user 1 = Work profile (or higher if multiple profiles exist)
- ์ ๋ฌด ์ฌ์ฉ์๋ก์ ์ง์ ์ค์น๋ ์ ์ฑ ์ ์คํจํฉ๋๋ค(์์ ์ค๋ฅ):
adb install --user 1 legit.apk
# java.lang.SecurityException: Shell does not have permission to access user 1
- ์ ์ ๋์ ์ ๊ธ ํด์ ๋ BYOD์ ๋ํ ๋ฌผ๋ฆฌ์ ์ ๊ทผ์ด ์์ด์ผ Developer Options + USB debugging์ ํ์ฑํํ ์ ์์ต๋๋ค.
- ํ์๋ก ํ์๋ Work-Profile ์ฑ์ ํจํค์ง ์ด๋ฆ์ ์๋ณํ์ธ์ (์:
com.workday.workdroidapp).
Android Studio์ ๋ค์ค ์ฌ์ฉ์ ์ค์น๊ธฐ ๋ฌด๊ธฐํ
Android Studio์ Run/Debug configuration์ ์ฌ์ ํ INSTALL_ALL_USERS ํ๋๊ทธ๋ก ๋น๋๋ฅผ ํธ์ํ ์ ์์ต๋๋ค. ์คํํ๊ธฐ ์ ์ Deploy as instant app โ Install for all users๋ฅผ ํ์ฑํํ์ธ์.
๊ด๋ฆฌ๋๋ ์ฑ๊ณผ ๋์ผํ ํจํค์ง ์ด๋ฆ์ ์ฌ์ฉํ๊ณ PackageManager/Finsky๊ฐ ์๋ก์ด ๋ฆด๋ฆฌ์ค๋ก ์ธ์ํ๋๋ก **ํจ์ฌ ๋ ํฐ versionCode**๋ฅผ ๊ฐ์ง ์
์ฑ ํ์ด๋ก๋๋ฅผ ๋น๋ํ์ธ์:
android {
namespace = "com.workday.workdroidapp"
defaultConfig {
applicationId = "com.workday.workdroidapp"
versionCode = 900000004
versionName = "9000000004.0"
}
}
When Android Studio deploys:
- **Personal user (0)**๋ ์ ์ฑ ํจํค์ง๋ฅผ ์ ์์ ์ผ๋ก ์ค์นํ๋ค.
- **Work Profile user (1)**๋ APK๋ฅผ ์์ ์คํ ์ด์ง ์์ญ์ ์์ ํ๊ณ ์ด๋ฅผ ์ ๋ฐ์ดํธ๋ก ์ฒ๋ฆฌํ๋ ค๊ณ ์๋ํ๋ค.
- CVE-2023-21257์ ๋ก์ง์ ์ฌ์ฉ์๊ฐ ์ ํ๋์ด ์์์ ๊ฐ์ง โ ์ค์น๊ฐ ๊ฑฐ๋ถ๋์ง๋ง, ์ ์์ ์ผ๋ก ๊ด๋ฆฌ๋๋ ์ฑ์ ์ ๊ฑฐ๋ ๊ฒ์ผ๋ก ํ์๋๊ณ ์คํ ์ด์ง๋ APK๋ ์บ์์ ๋จ์ ์๋ค.
Intune/Finsky auto-install bypass
Within ~1โ10 minutes (policy refresh interval):
- Intune/Company Portal๋ Work Profile์์ ํ์ ํจํค์ง๊ฐ ๋๋ฝ๋ ๊ฒ์ ๊ฐ์งํ๋ค.
- Work-Profile์ Finsky ์ธ์คํด์ค์ ์ฌ์ค์น๋ฅผ ์์ฒญํ๋ค.
- ๋ฒ์ ํ์ธ ๊ณผ์ ์์ Finsky๋ ๋ค์์ ๋น๊ตํ๋ค:
- Play Store์
com.workday.workdroidapp๋ฉํ๋ฐ์ดํฐ. - ์ด์ ์ค์น ์๋์์ ๋ก์ปฌ์ ์คํ ์ด์ง๋ APK.
- ๋ก์ปฌ ๋น๋๊ฐ **๊ฐ์ฅ ๋์
versionCode**๋ฅผ ๊ฐ์ง๋ฏ๋ก, Finsky๋ ์ด๋ฅผ ์ต์ ๋ฆด๋ฆฌ์ค๋ก ์ ๋ขฐํ๊ณ ์ ํ๋ Work Profile์ ์ค์นํ๋ค (DISALLOW_INSTALL_APPS/DISALLOW_DEBUGGING_FEATURES๊ฒ์ฌ ์ฌ์ ์ฉ ์์ด).
malicious binary๋ ์ด์ ์ ์ ํจํค์ง ์ด๋ฆ์ผ๋ก Work Profile ๋ด๋ถ์ ์กด์ฌํ๋ฉฐ MDM์ ์ํด ์ค์๋๋ ๊ฒ์ผ๋ก ๊ฐ์ฃผ๋๋ค.
Post-exploitation opportunities
- Work-profile data access โ ๋ค๋ฅธ ์ํฐํ๋ผ์ด์ฆ ์ฑ๋ค์ด ๊ต์ฒด๋ ํจํค์ง์ ๋ฐ์ธ๋ฉ๋ Intents/content providers๋ฅผ ๊ณ์ ์ ๋ขฐํ์ฌ ๋ด๋ถ ๋ฐ์ดํฐ ๋๋ ๋ฐ Work Profile์์ ๊ณต๊ฒฉ์ ์ธํ๋ผ๋ก์ ์๋ฐํ exfiltration์ ๊ฐ๋ฅํ๊ฒ ํ๋ค.
- Per-app VPN hijack โ ๊ต์ฒด๋ ํจํค์ง๊ฐ Intune per-app VPN(MS Tunnels + Defender)์ ๋งคํ๋์ด ์์ผ๋ฉด, ์ ์ฑ ๋น๋๋ ์๋์ผ๋ก VPN ํ๋กํ์ ์์๋ฐ์ ๊ณต๊ฒฉ์ ์ ์ด ํ๋ก์ธ์ค์์ ๋ด๋ถ ํธ์คํธ์ ์ง์ ์ ๊ทผํ ์ ์๋ค.
- Persistence โ MDM์ด ์ด์ ํด๋น ์ฑ์ด ์ค์น๋์ด ์๋ค๊ณ ๋ฏฟ๊ธฐ ๋๋ฌธ์, ์ฌ์ฉ์๊ฐ๋ ์๋น์๊ฐ ์ด๋ฅผ ์ ๊ฑฐํ ๋๋ง๋ค reinstall the malicious buildํ์ฌ BYOD Work Profiles์ ์ฅ๊ธฐ์ ์ธ ๊ฑฐ์ ์ ์ ๊ณตํ๋ค.
References
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์ ์ ์ถํ์ฌ ํดํน ํธ๋ฆญ์ ๊ณต์ ํ์ธ์.


