Translated ['src/pentesting-cloud/gcp-security/gcp-privilege-escalation/

This commit is contained in:
Translator
2025-08-18 14:20:53 +00:00
parent 24b659d9de
commit 2f7425aba8
2 changed files with 46 additions and 0 deletions
+1
View File
@@ -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)
@@ -0,0 +1,45 @@
# GCP - Cloud Tasks Privesc
{{#include ../../../banners/hacktricks-training.md}}
## Cloud Tasks
### `cloudtasks.tasks.create`, `iam.serviceAccounts.actAs`
Ένας επιτιθέμενος με αυτές τις άδειες μπορεί να **παριστάνει άλλους λογαριασμούς υπηρεσιών** δημιουργώντας εργασίες που εκτελούνται με την ταυτότητα του καθορισμένου λογαριασμού υπηρεσίας. Αυτό επιτρέπει την αποστολή **επαληθευμένων HTTP αιτημάτων σε υπηρεσίες Cloud Run ή Cloud Functions που προστατεύονται από IAM**.
```bash
gcloud tasks create-http-task \
task-$(date '+%Y%m%d%H%M%S') \
--location us-central1 \
--queue <queue_name> \
--url 'https://<service_name>.us-central1.run.app' \
--method POST \
--header 'X-Hello: world' \
--body-content '{"hello":"world"}' \
--oidc-service-account-email <account>@<project_id>.iam.gserviceaccount.com
```
### `cloudtasks.tasks.run`, `cloudtasks.tasks.list`
Ένας επιτιθέμενος με αυτές τις άδειες μπορεί να **εκτελεί υπάρχουσες προγραμματισμένες εργασίες** χωρίς να έχει άδειες στον λογαριασμό υπηρεσίας που σχετίζεται με την εργασία. Αυτό επιτρέπει την εκτέλεση εργασιών που δημιουργήθηκαν προηγουμένως με λογαριασμούς υπηρεσίας υψηλότερης εξουσίας.
```bash
gcloud tasks run projects/<project_id>/locations/us-central1/queues/<queue_name>/tasks/<task_id>
```
Ο κύριος που εκτελεί αυτή την εντολή **δεν χρειάζεται άδεια `iam.serviceAccounts.actAs`** στον λογαριασμό υπηρεσίας της εργασίας. Ωστόσο, αυτό επιτρέπει μόνο την εκτέλεση υπαρχουσών εργασιών - δεν παρέχει τη δυνατότητα δημιουργίας ή τροποποίησης εργασιών.
### `cloudtasks.queues.setIamPolicy`
Ένας επιτιθέμενος με αυτή την άδεια μπορεί **να παραχωρήσει στον εαυτό του ή σε άλλους κύριους ρόλους Cloud Tasks** σε συγκεκριμένες ουρές, ενδεχομένως κλιμακώνοντας σε `roles/cloudtasks.admin` που περιλαμβάνει τη δυνατότητα δημιουργίας και εκτέλεσης εργασιών.
```bash
gcloud tasks queues add-iam-policy-binding \
<queue_name> \
--location us-central1 \
--member serviceAccount:<account>@<project_id>.iam.gserviceaccount.com \
--role roles/cloudtasks.admin
```
Αυτό επιτρέπει στον επιτιθέμενο να παραχωρήσει πλήρη δικαιώματα διαχειριστή Cloud Tasks στην ουρά σε οποιονδήποτε λογαριασμό υπηρεσίας ελέγχει.
## Αναφορές
- [Google Cloud Tasks Documentation](https://cloud.google.com/tasks/docs)
{{#include ../../../banners/hacktricks-training.md}}