GCP - Bigtable Privesc
Tip
学习并练习 AWS Hacking:
HackTricks Training AWS Red Team Expert (ARTE)
学习并练习 GCP Hacking:HackTricks Training GCP Red Team Expert (GRTE)
学习并练习 Az Hacking:HackTricks Training Azure Red Team Expert (AzRTE)
支持 HackTricks
- 查看 subscription plans!
- 加入 💬 Discord group 或者 telegram group 或 关注 我们的 Twitter 🐦 @hacktricks_live.
- 通过向 HackTricks 和 HackTricks Cloud github 仓库 提交 PRs 来分享 hacking tricks。
Bigtable
有关 Bigtable 的更多信息,请参阅:
bigtable.instances.setIamPolicy
权限: bigtable.instances.setIamPolicy(通常还需要 bigtable.instances.getIamPolicy 来读取当前绑定)。
拥有实例的 IAM 策略允许你授予自己 roles/bigtable.admin(或任何自定义角色),该权限会级联到实例中的每个集群、表、备份和授权视图。
在实例上授予自己 bigtable.admin 角色
```bash gcloud bigtable instances add-iam-policy-bindingTip
如果你无法列出现有的 bindings,编写一个新的 policy 文档并使用
gcloud bigtable instances set-iam-policy推送它,只要确保自己仍在其中即可。
获取此权限后,请查看 Bigtable Post Exploitation section 中的技术,以了解更多滥用 Bigtable 权限的方法。
bigtable.tables.setIamPolicy
权限: bigtable.tables.setIamPolicy (可选 bigtable.tables.getIamPolicy)。
Instance policies can be locked down while individual tables are delegated. If you can edit the table IAM you can promote yourself to owner of the target dataset without touching other workloads.
Grant yourself bigtable.admin role on table
```bash gcloud bigtable tables add-iam-policy-binding在获得此权限后,请查看 Bigtable Post Exploitation section 中的技术,了解更多滥用 Bigtable 权限的方法。
bigtable.backups.setIamPolicy
Permissions: bigtable.backups.setIamPolicy
备份可以恢复到你控制的任意项目中的任意实例。首先,赋予你的身份对该备份的访问权限,然后将其恢复到你拥有 Admin/Owner 角色的沙箱中。
如果你拥有 bigtable.backups.setIamPolicy 权限,你可以授予自己 bigtable.backups.restore 权限,以恢复旧的备份并尝试访问敏感信息。
获取备份快照所有权
```bash # Take ownership of the snapshot gcloud bigtable backups add-iam-policy-binding在查看 Bigtable Post Exploitation section 中关于如何恢复备份的内容后,进行此权限检查。
更新 authorized view
Permissions: bigtable.authorizedViews.update
Authorized Views 用于对行/列进行脱敏。修改或删除它们会移除防御方所依赖的细粒度保护措施。
将 authorized view 更新以扩大访问范围
```bash # Broaden the subset by uploading a permissive definition gcloud bigtable authorized-views updateJson example not filtering any row or column
cat <<‘EOF’ > /tmp/permissive-view.json
{
“subsetView”: {
“rowPrefixes”: [“”],
“familySubsets”: {
“
Describe the authorized view to get a family name
gcloud bigtable authorized-views describe
–instance=
</details>
在获得此权限后,请参考 [**Bigtable Post Exploitation section**](../gcp-post-exploitation/gcp-bigtable-post-exploitation.md) 了解如何从授权视图读取数据。
### `bigtable.authorizedViews.setIamPolicy`
**权限:** `bigtable.authorizedViews.setIamPolicy`.
具有此权限的攻击者可以为自己授予对授权视图 (Authorized View) 的访问权限,该视图可能包含他们原本无法访问的敏感数据。
<details><summary>为自己授予对授权视图的访问权限</summary>
```bash
# Give more permissions over an existing view
gcloud bigtable authorized-views add-iam-policy-binding <view-id> \
--instance=<instance-id> --table=<table-id> \
--member='user:<attacker@example.com>' \
--role='roles/bigtable.viewer'
在进行此权限检查并查看 Bigtable Post Exploitation section 中关于如何从授权视图读取的内容之后。
Tip
学习并练习 AWS Hacking:
HackTricks Training AWS Red Team Expert (ARTE)
学习并练习 GCP Hacking:HackTricks Training GCP Red Team Expert (GRTE)
学习并练习 Az Hacking:HackTricks Training Azure Red Team Expert (AzRTE)
支持 HackTricks
- 查看 subscription plans!
- 加入 💬 Discord group 或者 telegram group 或 关注 我们的 Twitter 🐦 @hacktricks_live.
- 通过向 HackTricks 和 HackTricks Cloud github 仓库 提交 PRs 来分享 hacking tricks。
HackTricks Cloud

