|
| 1 | +--- |
| 2 | +title: Change IAM user password |
| 3 | +--- |
| 4 | + |
| 5 | +# Change IAM user password |
| 6 | + |
| 7 | + |
| 8 | + <span class="smallcaps w3-badge w3-blue w3-round w3-text-white" title="This attack technique can be detonated multiple times">idempotent</span> |
| 9 | + |
| 10 | +Platform: AWS |
| 11 | + |
| 12 | +## MITRE ATT&CK Tactics |
| 13 | + |
| 14 | + |
| 15 | +- Privilege Escalation |
| 16 | + |
| 17 | +## Description |
| 18 | + |
| 19 | + |
| 20 | +Establishes persistence by updating a Login Profile on an existing IAM user to change its password. This allows an attacker to hijack |
| 21 | +an IAM user with an existing login profile. |
| 22 | + |
| 23 | +<span style="font-variant: small-caps;">Warm-up</span>: |
| 24 | + |
| 25 | +- Create an IAM user with a login profile |
| 26 | + |
| 27 | +<span style="font-variant: small-caps;">Detonation</span>: |
| 28 | + |
| 29 | +- Update the user's login profile to change its password |
| 30 | + |
| 31 | +References: |
| 32 | + |
| 33 | +- https://www.invictus-ir.com/news/the-curious-case-of-dangerdev-protonmail-me |
| 34 | +- https://expel.com/blog/incident-report-from-cli-to-console-chasing-an-attacker-in-aws/ |
| 35 | +- https://permiso.io/blog/lucr-3-scattered-spider-getting-saas-y-in-the-cloud |
| 36 | + |
| 37 | + |
| 38 | +## Instructions |
| 39 | + |
| 40 | +```bash title="Detonate with Stratus Red Team" |
| 41 | +stratus detonate aws.privilege-escalation.iam-update-user-login-profile |
| 42 | +``` |
| 43 | +## Detection |
| 44 | + |
| 45 | + |
| 46 | +Through CloudTrail's <code>UpdateLoginProfile</code> events. |
| 47 | + |
| 48 | + |
| 49 | + |
| 50 | +## Detonation logs <span class="smallcaps w3-badge w3-light-green w3-round w3-text-sand">new!</span> |
| 51 | + |
| 52 | +The following CloudTrail events are generated when this technique is detonated[^1]: |
| 53 | + |
| 54 | + |
| 55 | +- `iam:UpdateLoginProfile` |
| 56 | + |
| 57 | + |
| 58 | +??? "View raw detonation logs" |
| 59 | + |
| 60 | + ```json hl_lines="6" |
| 61 | + |
| 62 | + [ |
| 63 | + { |
| 64 | + "awsRegion": "megov-southcentral-3r", |
| 65 | + "eventCategory": "Management", |
| 66 | + "eventID": "a46a1a42-9ef1-48d4-9c61-507eb6d4019f", |
| 67 | + "eventName": "UpdateLoginProfile", |
| 68 | + "eventSource": "iam.amazonaws.com", |
| 69 | + "eventTime": "2024-08-28T09:54:40Z", |
| 70 | + "eventType": "AwsApiCall", |
| 71 | + "eventVersion": "1.09", |
| 72 | + "managementEvent": true, |
| 73 | + "readOnly": false, |
| 74 | + "recipientAccountId": "763751499319", |
| 75 | + "requestID": "bd8967e5-b80d-48cd-b8b5-45c9905a4a7f", |
| 76 | + "requestParameters": { |
| 77 | + "userName": "stratus-red-team-update-login-profile-user" |
| 78 | + }, |
| 79 | + "responseElements": null, |
| 80 | + "sourceIPAddress": "212.3.253.233", |
| 81 | + "tlsDetails": { |
| 82 | + "cipherSuite": "TLS_AES_128_GCM_SHA256", |
| 83 | + "clientProvidedHostHeader": "iam.amazonaws.com", |
| 84 | + "tlsVersion": "TLSv1.3" |
| 85 | + }, |
| 86 | + "userAgent": "stratus-red-team_33d1bcd6-0716-4e7f-a145-8a75625cf180", |
| 87 | + "userIdentity": { |
| 88 | + "accessKeyId": "AKIAV1MIS7NGMDMR83FC", |
| 89 | + "accountId": "763751499319", |
| 90 | + "arn": "arn:aws:iam::763751499319:user/christophe", |
| 91 | + "principalId": "AIDAXYBG3LDVX65FGD9O", |
| 92 | + "type": "IAMUser", |
| 93 | + "userName": "christophe" |
| 94 | + } |
| 95 | + } |
| 96 | + ] |
| 97 | + ``` |
| 98 | + |
| 99 | +[^1]: These logs have been gathered from a real detonation of this technique in a test environment using [Grimoire](https://github.com/DataDog/grimoire), and anonymized using [LogLicker](https://github.com/Permiso-io-tools/LogLicker). |
0 commit comments