diff --git a/src/pentesting-cloud/gcp-security/gcp-unauthenticated-enum-and-access/gcp-api-keys-unauthenticated-enum.md b/src/pentesting-cloud/gcp-security/gcp-unauthenticated-enum-and-access/gcp-api-keys-unauthenticated-enum.md index 14af0adf0..9794aaf7e 100644 --- a/src/pentesting-cloud/gcp-security/gcp-unauthenticated-enum-and-access/gcp-api-keys-unauthenticated-enum.md +++ b/src/pentesting-cloud/gcp-security/gcp-unauthenticated-enum-and-access/gcp-api-keys-unauthenticated-enum.md @@ -18,9 +18,35 @@ APIキーに関する詳細情報は、以下を確認してください: 例えば、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) -### 元のGCPプロジェクトを確認 - `apikeys.keys.lookup` +### 元のGCPプロジェクトを確認 -これは、**見つけたAPIキーがどのGCPプロジェクトに属しているかを確認するのに非常に便利です**: +これは、**見つけたAPIキーがどのGCPプロジェクトに属しているかを確認するのに非常に便利です**。いくつかのオプションがあります: + +- `https://www.googleapis.com/identitytoolkit/v3/relyingparty/getProjectConfig?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=` に連絡します。 + +簡潔さのために出力は切り捨てられましたが、完全な出力にはプロジェクト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 @@ -45,6 +71,6 @@ reason: AUTH_PERMISSION_DENIED ``` ### ブルートフォースAPIエンドポイント -プロジェクトでどのAPIが有効になっているかわからない場合、ツール[https://github.com/ozguralp/gmapsapiscanner](https://github.com/ozguralp/gmapsapiscanner)を実行して、**APIキーでアクセスできるものを確認するのは興味深いでしょう。** +プロジェクトでどのAPIが有効になっているかわからない場合、ツール[https://github.com/ozguralp/gmapsapiscanner](https://github.com/ozguralp/gmapsapiscanner)を実行し、**APIキーで何にアクセスできるかを確認するのは興味深いでしょう。** {{#include ../../../banners/hacktricks-training.md}}