Skip to content

Commit 11f1f81

Browse files
committed
Check origin GCP project
1 parent 38c6ba9 commit 11f1f81

File tree

1 file changed

+32
-2
lines changed

1 file changed

+32
-2
lines changed

src/pentesting-cloud/gcp-security/gcp-unauthenticated-enum-and-access/gcp-api-keys-unauthenticated-enum.md

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,39 @@ The regex is: **`AIza[0-9A-Za-z_-]{35}`**
1818

1919
Search it for example in Github following: [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)
2020

21-
### Check origin GCP project - `apikeys.keys.lookup`
21+
### Check origin GCP project
2222

23-
This is extremely useful to check to **which GCP project an API key that you have found belongs to**:
23+
This is extremely useful to check to **which GCP project an API key that you have found belongs to**. We have different options:
24+
25+
- Contact `https://www.googleapis.com/identitytoolkit/v3/relyingparty/getProjectConfig?key=<api-key`
26+
27+
For the sake of brevity the output was truncated, but in the complete output the project ID appears more than 5 times
28+
29+
```bash
30+
curl -s "https://www.googleapis.com/identitytoolkit/v3/relyingparty/getProjectConfig?key=AIzaSyD[...]uE8Y"
31+
32+
{
33+
"error": {
34+
"code": 403,
35+
"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.",
36+
[...]
37+
```
38+
39+
- Contact `https://www.googleapis.com/identitytoolkit/v3/relyingparty/getProjectConfig?key=<api-key`
40+
41+
For the sake of brevity the output was truncated, but in the complete output the project ID appears more than 5 times
42+
43+
```bash
44+
curl -s "https://identitytoolkit.googleapis.com/v1/projects?key=AIzaSyD[...]uE8Y"
45+
46+
{
47+
"error": {
48+
"code": 403,
49+
"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.",
50+
[...]
51+
```
52+
53+
- [This one no longer works!] `apikeys.keys.lookup`
2454
2555
```bash
2656
# If you have permissions

0 commit comments

Comments
 (0)