Play Integrity Attestation Bypass (SafetyNet Replacement)

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をサポートする

What Play Integrity Does

Play Integrity はアプリの attestation に対する Google の SafetyNet の後継です。アプリが API を呼び出すと、Google Play Services がソフトウェア/ハードウェアのシグナルを収集し、それを googleapis.com に暗号化して送信し、Google は署名・暗号化された JWT を返します。アプリはトークンをバックエンドに転送し、バックエンドは Google の公開鍵で署名を検証し、ペイロードを復号して、verdict フィールドに基づいてポリシーを適用します。

  • appIntegrity: APK のビルド/署名が一致(再パック/改ざんがないこと)。
  • deviceIntegrity: 正規かつ認定されたデバイス、ブートローダーがロックされている、root/システム改ざんがないこと。
  • accountDetails: Google Play 経由でのインストール。

よく確認される主要な verdict フラグ:

  • MEETS_BASIC_INTEGRITY: genuine Play Services によって生成されたトークン(エミュレータや改ざんされた輸送ではない)。
  • MEETS_DEVICE_INTEGRITY: genuine/certified デバイス、ブートローダーがロック、root/システム改ざんなし。
  • MEETS_STRONG_INTEGRITY: DEVICE に加え、すべてのパーティション(OS + vendor)での最近のセキュリティパッチ適用を要求。

Bypass Model

Google の JWT を偽造する代わりに、Google が評価するシグナルを偽装して、別の正当なデバイスプロファイルに一致させます。攻撃チェーンは次の通りです:

  1. ローカルチェックやPlay Services のプローブが Magisk/su を検出しないように root を隠す。
  2. genuine デバイスのものと入れ替えることで、Play Integrity が認定/ロックされたデバイスとして見るように key attestation certificate chainkeybox.xml)を置き換える。
  3. MEETS_STRONG_INTEGRITY を満たすために security patch level を偽装する。

Google は 悪用された keyboxes を失効させることで緩和しているため、keybox がブロックされたらローテーションが必要です。

Prerequisites & Tooling

Achieve MEETS_BASIC_INTEGRITY + MEETS_DEVICE_INTEGRITY

  1. Install modules & reboot: Flash TrickyStore and Tricky Addon in Magisk, reboot.
  2. Configure TrickyStore (via KSU Web UI): Select TrickyStoreSelect AllDeselect UnnecessarySave.
  3. Inject a valid keybox: In Keybox, choose Valid to download/apply a new keybox.xml (vendor attestation credentials). This file underpins hardware key attestation and is now spoofed from a certified/locked device.
  4. Verify: Run Play Integrity API CheckerMEETS_BASIC_INTEGRITY and MEETS_DEVICE_INTEGRITY should pass. In Key Attestation the bootloader appears locked because the attestation chain is replaced.

Achieve MEETS_STRONG_INTEGRITY (Patch-Level Spoof)

STRONG fails on outdated patch levels. TrickyStore can spoof a modern security patch date for all partitions:

  1. In TrickyStore, pick Set Security PatchGet Security Patch DateSave.
  2. Re-run Play Integrity API Checker; MEETS_STRONG_INTEGRITY should now pass.

Operational Notes

  • Revocation risk: Hitting the API repeatedly with the same keybox.xml can flag and block it. If blocked, replace with a fresh valid keybox.
  • Arms race: Publicly shared keyboxes burn fast; keep private copies and track community module updates (XDA/Telegram/GitHub) for new working chains.
  • Scope: This bypass only spoofs attestation inputs; backend signature verification by Google still succeeds because the JWT itself is genuine.

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をサポートする