【问题标题】:Andoid 12 Keystore user_0 missing foderAndroid 12 Keystore 用户 0 缺少文件夹
【发布时间】:2022-06-21 03:13:08
【问题描述】:

我目前正在研究 Android 12 API 31 上的应用取证。在这项研究中,我需要使用来自 Keystore 的私钥,我在 Android 11 中发现没有问题,通常位于“/data/misc”中/keystore/user_0/”。但在 Android 12 中找不到“user_0”文件夹,我只能找到一个名为“persistent.sqlite”数据库文件的文件。我是否在 AOSP 的文档中遗漏了任何更新,或者我错过了对 Keystore persistent.sqlite 文件的理解的概念

Android 12 密钥库文件结构

emulator64_x86_64_arm64:/data/misc/keystore # ls -la
total 156
drwx------  2 keystore keystore   4096 2022-02-14 14:57 .
drwxrwx--t 64 system   misc       4096 2021-12-11 11:35 ..
-rw-------  1 keystore keystore 126976 2022-02-14 14:57 persistent.sqlite
-rw-------  1 keystore keystore      0 2021-12-11 11:37 timestamp
-rw-------  1 keystore keystore  16384 2021-12-11 11:36 vpnprofilestore.sqlite

Android 11 密钥库文件结构

generic_x86:/data/misc/keystore/user_0 # ls -la
total 88
drwx------ 2 keystore keystore 4096 2022-02-13 21:59 .
drwx------ 3 keystore keystore 4096 2022-02-13 21:59 ..
-rw------- 1 keystore keystore  169 2022-02-13 21:50 .10087_chr_USRPKEY_unstable+^825349ac930c2370b39f30e7d789963b+^2
-rw------- 1 keystore keystore  158 2022-02-13 21:50 .10087_chr_USRPKEY_unstable+^c7202ece89390c490b1b94d5b71225e1+^+]3617777111701302822
-rw------- 1 keystore keystore  158 2022-02-13 21:50 .10087_chr_USRPKEY_unstable+^c7202ece89390c490b1b94d5b71225e1+^1127810549181744279
-rw------- 1 keystore keystore  158 2022-02-13 21:50 .10087_chr_USRPKEY_unstable+^c7202ece89390c490b1b94d5b71225e1+^116472976498382090
-rw------- 1 keystore keystore  153 2022-02-13 21:50 .1010_chr_USRPKEY_MacRandSecret
-rw------- 1 keystore keystore  169 2022-02-13 21:59 .10121_chr_USRPKEY_SignalSecret
-rw------- 1 keystore keystore 1331 2022-02-13 21:50 10087_CACERT_unstable+^c7202ece89390c490b1b94d5b71225e1+^+]3617777111701302822
-rw------- 1 keystore keystore 1331 2022-02-13 21:50 10087_CACERT_unstable+^c7202ece89390c490b1b94d5b71225e1+^1127810549181744279
-rw------- 1 keystore keystore 1331 2022-02-13 21:50 10087_CACERT_unstable+^c7202ece89390c490b1b94d5b71225e1+^116472976498382090
-rw------- 1 keystore keystore  310 2022-02-13 21:50 10087_USRCERT_unstable+^825349ac930c2370b39f30e7d789963b+^2
-rw------- 1 keystore keystore  824 2022-02-13 21:50 10087_USRCERT_unstable+^c7202ece89390c490b1b94d5b71225e1+^+]3617777111701302822
-rw------- 1 keystore keystore  824 2022-02-13 21:50 10087_USRCERT_unstable+^c7202ece89390c490b1b94d5b71225e1+^1127810549181744279
-rw------- 1 keystore keystore  825 2022-02-13 21:50 10087_USRCERT_unstable+^c7202ece89390c490b1b94d5b71225e1+^116472976498382090
-rw------- 1 keystore keystore  295 2022-02-13 21:50 10087_USRPKEY_unstable+^825349ac930c2370b39f30e7d789963b+^2
-rw------- 1 keystore keystore  284 2022-02-13 21:50 10087_USRPKEY_unstable+^c7202ece89390c490b1b94d5b71225e1+^+]3617777111701302822
-rw------- 1 keystore keystore  284 2022-02-13 21:50 10087_USRPKEY_unstable+^c7202ece89390c490b1b94d5b71225e1+^1127810549181744279
-rw------- 1 keystore keystore  284 2022-02-13 21:50 10087_USRPKEY_unstable+^c7202ece89390c490b1b94d5b71225e1+^116472976498382090
-rw------- 1 keystore keystore  190 2022-02-13 21:50 1010_USRPKEY_MacRandSecret
-rw------- 1 keystore keystore  190 2022-02-13 21:59 10121_USRPKEY_SignalSecret

有没有人看到可以解释的东西?

PS Tbh 我正在寻找 SignalSecret 私钥:3

【问题讨论】:

    标签: android cryptography android-keystore selinux computer-forensics


    【解决方案1】:

    编辑:

    在深入研究了 Android 12 中引入的新 KeyStore 的代码后,我发现确实有一种存储密钥的新方法。现在一切都在/data/misc/keystore/persistent.sqlite DB 文件中。在/data/misc/keystore/user_<user-id>/ 目录中存储内容是一种传统方式,所有内容都会自动迁移到persistent.sqlite DB 文件中。

    尝试将该数据库文件上传到 SQL Lite 阅读器(例如 https://sqliteonline.com/)并从 keyentry 表中查询所有条目:

    SELECT * FROM keyentry
    

    您可以在那里找到您已经熟悉的条目,例如:“MacRandSecret”、“SignalSecret”、“synthetic_password em>”等)。每个条目还有一个以前是文件的 BLOB。

    原来的错误答案:

    在 Android 12 上,现在有两个密钥库变体:`keystore` 和 `keystore2`。 `keystore2` 有一个遗留部分,因此很可能您的 ROM 没有使用正确的部分,这就是 `/data/misc/keystore/user_#` 目录为空的原因。

    检查 logcat 是否有密钥库错误。

    参考:https://android.googlesource.com/platform/system/security/+/refs/heads/android-s-beta-4

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-09-20
      • 2019-05-05
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多