mirror of
https://github.com/HackTricks-wiki/hacktricks-cloud.git
synced 2025-12-23 07:29:04 -08:00
86 lines
3.9 KiB
Markdown
86 lines
3.9 KiB
Markdown
# GCP - Cloud Run Unauthenticated Enum
|
|
|
|
{% hint style="success" %}
|
|
Learn & practice AWS Hacking:<img src="../../../.gitbook/assets/image (1) (1) (1) (1).png" alt="" data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<img src="../../../.gitbook/assets/image (1) (1) (1) (1).png" alt="" data-size="line">\
|
|
Learn & practice GCP Hacking: <img src="../../../.gitbook/assets/image (2) (1).png" alt="" data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<img src="../../../.gitbook/assets/image (2) (1).png" alt="" data-size="line">](https://training.hacktricks.xyz/courses/grte)
|
|
|
|
<details>
|
|
|
|
<summary>Support HackTricks</summary>
|
|
|
|
* Check the [**subscription plans**](https://github.com/sponsors/carlospolop)!
|
|
* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks\_live**](https://twitter.com/hacktricks_live)**.**
|
|
* **Share hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos.
|
|
|
|
</details>
|
|
{% endhint %}
|
|
|
|
## Cloud Run
|
|
|
|
For more information about Cloud Run check:
|
|
|
|
{% content-ref url="../gcp-services/gcp-cloud-run-enum.md" %}
|
|
[gcp-cloud-run-enum.md](../gcp-services/gcp-cloud-run-enum.md)
|
|
{% endcontent-ref %}
|
|
|
|
### Enumerate Open Cloud Run
|
|
|
|
With the following code [taken from here](https://gitlab.com/gitlab-com/gl-security/security-operations/gl-redteam/gcp_misc/-/blob/master/find_open_cloudrun.sh) you can find Cloud Run services that permit unauthenticated invocations.
|
|
|
|
```bash
|
|
#!/bin/bash
|
|
|
|
############################
|
|
# Run this tool to find Cloud Run services that permit unauthenticated
|
|
# invocations anywhere in your GCP organization.
|
|
# Enjoy!
|
|
############################
|
|
|
|
for proj in $(gcloud projects list --format="get(projectId)"); do
|
|
echo "[*] scraping project $proj"
|
|
|
|
enabled=$(gcloud services list --project "$proj" | grep "Cloud Run API")
|
|
|
|
if [ -z "$enabled" ]; then
|
|
continue
|
|
fi
|
|
|
|
|
|
for run in $(gcloud run services list --platform managed --quiet --project $proj --format="get(name)"); do
|
|
ACL="$(gcloud run services get-iam-policy $run --platform managed --project $proj)"
|
|
|
|
all_users="$(echo $ACL | grep allUsers)"
|
|
all_auth="$(echo $ACL | grep allAuthenticatedUsers)"
|
|
|
|
if [ -z "$all_users" ]
|
|
then
|
|
:
|
|
else
|
|
echo "[!] Open to all users: $proj: $run"
|
|
fi
|
|
|
|
if [ -z "$all_auth" ]
|
|
then
|
|
:
|
|
else
|
|
echo "[!] Open to all authenticated users: $proj: $run"
|
|
fi
|
|
done
|
|
done
|
|
```
|
|
|
|
{% hint style="success" %}
|
|
Learn & practice AWS Hacking:<img src="../../../.gitbook/assets/image (1) (1) (1) (1).png" alt="" data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<img src="../../../.gitbook/assets/image (1) (1) (1) (1).png" alt="" data-size="line">\
|
|
Learn & practice GCP Hacking: <img src="../../../.gitbook/assets/image (2) (1).png" alt="" data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<img src="../../../.gitbook/assets/image (2) (1).png" alt="" data-size="line">](https://training.hacktricks.xyz/courses/grte)
|
|
|
|
<details>
|
|
|
|
<summary>Support HackTricks</summary>
|
|
|
|
* Check the [**subscription plans**](https://github.com/sponsors/carlospolop)!
|
|
* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks\_live**](https://twitter.com/hacktricks_live)**.**
|
|
* **Share hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos.
|
|
|
|
</details>
|
|
{% endhint %}
|