Skip to content

Commit 1077cf6

Browse files
authored
Update AWS KMS post-exploitation documentation
Clarified KMS policy restrictions and updated ransomware sections.
1 parent 29e379d commit 1077cf6

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

src/pentesting-cloud/aws-security/aws-post-exploitation/aws-kms-post-exploitation.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -98,23 +98,22 @@ aws kms put-key-policy --key-id mrk-c10357313a644d69b4b28b88523ef20c \
9898
```
9999

100100
> [!CAUTION]
101-
> Note that if you change that policy and only give access to an external account, and then from this external account you try to set a new policy to **give the access back to original account, you won't be able cause the Put Polocy action cannot be perfoemed from a cross account**.
101+
> Note that if you change that policy and only give access to an external account, and then from this external account you try to set a new policy to **give the access back to original account, you won't be able cause the Put Polocy action cannot be performed from a cross account**.
102102
103103
<figure><img src="../../../images/image (77).png" alt=""><figcaption></figcaption></figure>
104104

105105
### Generic KMS Ransomware
106106

107-
#### Global KMS Ransomware
108-
109107
There is another way to perform a global KMS Ransomware, which would involve the following steps:
110108

111109
- Create a new **key with a key material** imported by the attacker
112-
- **Re-encrypt older data** encrypted with the previous version with the new one.
110+
- **Re-encrypt older data** of the victim encrypted with the previous version with the new one.
113111
- **Delete the KMS key**
114112
- Now only the attacker, who has the original key material could be able to decrypt the encrypted data
115113

116-
#### Ransomware via kms:DeleteImportedKeyMaterial
117-
With the `kms:DeleteImportedKeyMaterial` permission, an actor can delete the imported key material from CMKs with Origin=EXTERNAL, 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.
114+
### Delete Keys via kms:DeleteImportedKeyMaterial
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.
118117

119118
```bash
120119
aws kms delete-imported-key-material --key-id <Key_ID>
@@ -123,10 +122,9 @@ aws kms delete-imported-key-material --key-id <Key_ID>
123122

124123
### Destroy keys
125124

126-
```bash
127-
# Destoy they key material previously imported making the key useless
128-
aws kms delete-imported-key-material --key-id 1234abcd-12ab-34cd-56ef-1234567890ab
125+
Destroying keys it's possible to perform a DoS.
129126

127+
```bash
130128
# Schedule the destoy of a key (min wait time is 7 days)
131129
aws kms schedule-key-deletion \
132130
--key-id arn:aws:kms:us-west-2:123456789012:key/1234abcd-12ab-34cd-56ef-1234567890ab \

0 commit comments

Comments
 (0)