You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/pentesting-cloud/aws-security/aws-post-exploitation/aws-kms-post-exploitation/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -113,7 +113,7 @@ There is another way to perform a global KMS Ransomware, which would involve the
113
113
114
114
### Delete Keys via kms:DeleteImportedKeyMaterial
115
115
116
-
With the `kms:DeleteImportedKeyMaterial` permission, an actor can delete the imported key material from CMKs with `Origin=EXTERNAL` (CMKs that have imperted their key material), making them unable to decrypt data. This action is destructive and irreversible unless compatible material is re-imported, allowing an attacker to effectively cause ransomware-like data loss by rendering encrypted information permanently inaccessible.
116
+
With the `kms:DeleteImportedKeyMaterial` permission, an actor can delete the imported key material from CMKs with `Origin=EXTERNAL` (CMKs that have imported their key material), making them unable to decrypt data. This action is destructive and irreversible unless compatible material is re-imported, allowing an attacker to effectively cause ransomware-like data loss by rendering encrypted information permanently inaccessible.
Enables creating access key ID and secret access key for another user, leading to potential privilege escalation.
41
41
@@ -47,6 +47,29 @@ aws iam create-access-key --user-name <target_user>
47
47
48
48
**Impact:** Direct privilege escalation by assuming another user's extended permissions.
49
49
50
+
Note that a user can only have 2 access keys created, so if a user already has 2 access keys you will need the permission `iam:DeleteAccessKey` to detele one of them to be able to create a new one:
51
+
52
+
```bash
53
+
aws iam delete-access-key --uaccess-key-id <key_id>
If you can create a new virtual MFA device and enable it on another user, you can effectively enroll your own MFA for that user and then request an MFA-backed session for their credentials.
59
+
60
+
**Exploit:**
61
+
62
+
```bash
63
+
# Create a virtual MFA device (this returns the serial and the base32 seed)
64
+
aws iam create-virtual-mfa-device --virtual-mfa-device-name <mfa_name>
65
+
66
+
# Generate 2 consecutive TOTP codes from the seed, then enable it for the user
67
+
aws iam enable-mfa-device --user-name <target_user> --serial-number <serial> \
0 commit comments