mirror of
https://github.com/HackTricks-wiki/hacktricks-cloud.git
synced 2026-02-05 03:16:37 -08:00
Translated ['src/pentesting-cloud/gcp-security/gcp-unauthenticated-enum-
This commit is contained in:
@@ -12,15 +12,41 @@
|
||||
|
||||
### OSINT techniques
|
||||
|
||||
**Google API 密钥被任何类型的应用广泛使用**,这些应用从客户端使用它们。通常可以在网站源代码或网络请求中找到它们,在移动应用中,或者仅仅是在像 Github 这样的平台上搜索正则表达式。
|
||||
**Google API 密钥被任何类型的应用广泛使用**,这些应用从客户端使用。通常可以在网站源代码或网络请求中找到它们,在移动应用中,或者仅仅是在像 Github 这样的平台上搜索正则表达式。
|
||||
|
||||
正则表达式是:**`AIza[0-9A-Za-z_-]{35}`**
|
||||
|
||||
例如,可以在 Github 上搜索: [https://github.com/search?q=%2FAIza%5B0-9A-Za-z\_-%5D%7B35%7D%2F\&type=code\&ref=advsearch](https://github.com/search?q=%2FAIza%5B0-9A-Za-z_-%5D%7B35%7D%2F&type=code&ref=advsearch)
|
||||
|
||||
### Check origin GCP project - `apikeys.keys.lookup`
|
||||
### Check origin GCP project
|
||||
|
||||
这对于检查**您找到的 API 密钥属于哪个 GCP 项目**非常有用:
|
||||
这对于检查**您找到的 API 密钥属于哪个 GCP 项目**非常有用。我们有不同的选项:
|
||||
|
||||
- 联系 `https://www.googleapis.com/identitytoolkit/v3/relyingparty/getProjectConfig?key=<api-key>`
|
||||
|
||||
为了简洁起见,输出被截断,但在完整输出中,项目 ID 出现了超过 5 次。
|
||||
```bash
|
||||
curl -s "https://www.googleapis.com/identitytoolkit/v3/relyingparty/getProjectConfig?key=AIzaSyD[...]uE8Y"
|
||||
|
||||
{
|
||||
"error": {
|
||||
"code": 403,
|
||||
"message": "Identity Toolkit API has not been used in project 943955951114 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/identitytoolkit.googleapis.com/overview?project=943955951114 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.",
|
||||
[...]
|
||||
```
|
||||
- 联系 `https://www.googleapis.com/identitytoolkit/v3/relyingparty/getProjectConfig?key=<api-key>`
|
||||
|
||||
为了简洁起见,输出被截断,但在完整输出中,项目 ID 出现了超过 5 次。
|
||||
```bash
|
||||
curl -s "https://identitytoolkit.googleapis.com/v1/projects?key=AIzaSyD[...]uE8Y"
|
||||
|
||||
{
|
||||
"error": {
|
||||
"code": 403,
|
||||
"message": "Identity Toolkit API has not been used in project 943955951114 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/identitytoolkit.googleapis.com/overview?project=943955951114 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.",
|
||||
[...]
|
||||
```
|
||||
- [这个不再有效了!] `apikeys.keys.lookup`
|
||||
```bash
|
||||
# If you have permissions
|
||||
gcloud services api-keys lookup AIzaSyD[...]uE8Y
|
||||
|
||||
Reference in New Issue
Block a user