GCP - सामान्य दिलचस्प अनुमतियाँ Privesc

Tip

AWS हैकिंग सीखें और अभ्यास करें:HackTricks Training AWS Red Team Expert (ARTE)
GCP हैकिंग सीखें और अभ्यास करें: HackTricks Training GCP Red Team Expert (GRTE) Azure हैकिंग सीखें और अभ्यास करें: HackTricks Training Azure Red Team Expert (AzRTE)

HackTricks का समर्थन करें

Generic Interesting Permissions

*.setIamPolicy

If you owns a user that has the setIamPolicy permission in a resource you can escalate privileges in that resource because you will be able to change the IAM policy of that resource and give you more privileges over it.
यदि आपके पास ऐसा user है जिसे किसी resource में setIamPolicy permission है, तो आप उस resource में अपने privileges को बढ़ा सकते हैं क्योंकि आप उस resource की IAM policy बदलकर अपने लिए अधिक अधिकार दे सकते हैं.
This permission can also allow to escalate to other principals if the resource allow to execute code and the iam.ServiceAccounts.actAs is not necessary.
यदि वह resource कोड चलाने की अनुमति देता है और iam.ServiceAccounts.actAs आवश्यक नहीं है, तो यह permission आपको अन्य principals पर escalate करने की भी अनुमति दे सकती है.

  • cloudfunctions.functions.setIamPolicy
  • Modify the policy of a Cloud Function to allow yourself to invoke it.
    Cloud Function की policy modify करके खुद को उसे invoke करने की अनुमति दें.

There are tens of resources types with this kind of permission, you can find all of them in https://cloud.google.com/iam/docs/permissions-reference searching for setIamPolicy.
ऐसे permission वाले कई resource types हैं; आप https://cloud.google.com/iam/docs/permissions-reference में setIamPolicy खोजकर सब उन्हें पा सकते हैं.

*.create, *.update

These permissions can be very useful to try to escalate privileges in resources by creating a new one or updating a new one. These can of permissions are specially useful if you also has the permission iam.serviceAccounts.actAs over a Service Account and the resource you have .create/.update over can attach a service account.
ये permissions resource में privileges escalate करने के लिए उपयोगी हो सकते हैं, खासकर जब आप कोई नया resource create करें या किसी existing को update करें। ये permissions विशेष रूप से तब फायदेमंद होते हैं जब आपके पास किसी Service Account पर iam.serviceAccounts.actAs permission भी है और जिस resource पर आपकी .create/.update अनुमति है वह Service Account attach कर सकता है।

*ServiceAccount*

This permission will usually let you access or modify a Service Account in some resource (e.g.: compute.instances.setServiceAccount). This could lead to a privilege escalation vector, but it will depend on each case.
यह permission आमतौर पर आपको किसी resource में एक Service Account तक पहुँचने या उसे बदलने की अनुमति देता है (उदा.: compute.instances.setServiceAccount). यह privilege escalation का एक vector बन सकता है, पर यह हर मामले पर निर्भर करेगा।

iam.ServiceAccounts.actAs

This permission will let you attach a Service Account to a resource that supports it (e.g.: Compute Engine VM, Cloud Function, Cloud Run, etc).
यह permission आपको उस resource पर एक Service Account attach करने की अनुमति देता है जो इसे सपोर्ट करता है (उदा.: Compute Engine VM, Cloud Function, Cloud Run, आदि).
If you can attach a Service Account that has more privileges than your user to a resource that can execute code, you will be able to escalate your privileges by executing code with that Service Account.
यदि आप किसी ऐसे Service Account को attach कर सकें जिसके पास आपके user से अधिक privileges हों और वह resource कोड चला सकता हो, तो आप उस Service Account के साथ कोड चलाकर अपने privileges escalate कर सकेंगे.

Search in Cloud Hacktricks for iam.ServiceAccounts.actAs to find several examples of how to escalate privileges with this permission.
Cloud Hacktricks में iam.ServiceAccounts.actAs खोजें ताकि इस permission के साथ privileges escalate करने के कई उदाहरण मिलें.

Tip

AWS हैकिंग सीखें और अभ्यास करें:HackTricks Training AWS Red Team Expert (ARTE)
GCP हैकिंग सीखें और अभ्यास करें: HackTricks Training GCP Red Team Expert (GRTE) Azure हैकिंग सीखें और अभ्यास करें: HackTricks Training Azure Red Team Expert (AzRTE)

HackTricks का समर्थन करें