AWS - Glue Privesc
Last updated
Last updated
Learn & practice AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE) Learn & practice GCP Hacking: HackTricks Training GCP Red Team Expert (GRTE)
iam:PassRole
, glue:CreateDevEndpoint
, (glue:GetDevEndpoint
| glue:GetDevEndpoints
)Users with these permissions can set up a new AWS Glue development endpoint, assigning an existing service role assumable by Glue with specific permissions to this endpoint.
After the setup, the attacker can SSH into the endpoint's instance, and steal the IAM credentials of the assigned role:
For stealth purpose, it's recommended to use the IAM credentials from inside the Glue virtual machine.
Potential Impact: Privesc to the glue service role specified.
glue:UpdateDevEndpoint
, (glue:GetDevEndpoint
| glue:GetDevEndpoints
)Users with this permission can alter an existing Glue development endpoint's SSH key, enabling SSH access to it. This allows the attacker to execute commands with the privileges of the endpoint's attached role:
Potential Impact: Privesc to the glue service role used.
iam:PassRole
, (glue:CreateJob
| glue:UpdateJob
), (glue:StartJobRun
| glue:CreateTrigger
)Users with iam:PassRole
combined with either glue:CreateJob
or glue:UpdateJob
, and either glue:StartJobRun
or glue:CreateTrigger
can create or update an AWS Glue job, attaching any Glue service account, and initiate the job's execution. The job's capabilities include running arbitrary Python code, which can be exploited to establish a reverse shell. This reverse shell can then be utilized to exfiltrate the IAM credentials of the role attached to the Glue job, leading to potential unauthorized access or actions based on the permissions of that role:
Potential Impact: Privesc to the glue service role specified.
glue:UpdateJob
Just with the update permission an attacked could steal the IAM Credentials of the already attached role.
Potential Impact: Privesc to the glue service role attached.
Learn & practice AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE) Learn & practice GCP Hacking: HackTricks Training GCP Red Team Expert (GRTE)