From e256364d3be9a066d23ac4534c989fbb53fd409b Mon Sep 17 00:00:00 2001 From: Translator Date: Tue, 24 Jun 2025 14:00:26 +0000 Subject: [PATCH] Translated ['src/pentesting-cloud/aws-security/aws-privilege-escalation/ --- .../aws-iam-roles-anywhere-privesc.md | 42 +++++++++++++++++++ theme/ai.js | 2 +- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 src/pentesting-cloud/aws-security/aws-privilege-escalation/aws-iam-roles-anywhere-privesc.md diff --git a/src/pentesting-cloud/aws-security/aws-privilege-escalation/aws-iam-roles-anywhere-privesc.md b/src/pentesting-cloud/aws-security/aws-privilege-escalation/aws-iam-roles-anywhere-privesc.md new file mode 100644 index 000000000..332b7a8de --- /dev/null +++ b/src/pentesting-cloud/aws-security/aws-privilege-escalation/aws-iam-roles-anywhere-privesc.md @@ -0,0 +1,42 @@ +# AWS - IAM Roles Anywhere Privesc + +{{#include ../../../../banners/hacktricks-training.md}} + +AWS IAM RolesAnywhere pozwala na przyjmowanie ról IAM przez obciążenia poza AWS za pomocą certyfikatów X.509. Jednak gdy polityki zaufania nie są odpowiednio ograniczone, mogą być wykorzystywane do eskalacji uprawnień. + +Ta polityka nie ma ograniczeń dotyczących tego, które atrybuty zaufania lub certyfikatu są dozwolone. W rezultacie każdy certyfikat powiązany z dowolnym punktem zaufania w koncie może być użyty do przyjęcia tej roli. +```json +{ +"Version": "2012-10-17", +"Statement": [ +{ +"Effect": "Allow", +"Principal": { +"Service": "rolesanywhere.amazonaws.com" +}, +"Action": [ +"sts:AssumeRole", +"sts:SetSourceIdentity", +"sts:TagSession" +] +} +] +} + +``` +Aby uzyskać privesc, wymagany jest `aws_signing_helper` z https://docs.aws.amazon.com/rolesanywhere/latest/userguide/credential-helper.html + +Następnie, używając ważnego certyfikatu, atakujący może przejść do roli o wyższych uprawnieniach. +```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 +``` +### Odniesienia + +- https://www.ruse.tech/blogs/aws-roles-anywhere-privilege-escalation/ + +{{#include ../../../../banners/hacktricks-training.md}} diff --git a/theme/ai.js b/theme/ai.js index c94992d5f..13337c3f1 100644 --- a/theme/ai.js +++ b/theme/ai.js @@ -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; } }