How it works
An IAM user can have two independent kinds of credential: access keys for the API, and a password for the AWS Management Console. The password and its settings are stored in an object called the login profile. A user created for a workload normally has keys and no login profile; a user created for a person has a login profile and often no keys.
Two IAM actions write that object for any user the caller is allowed to target:
CreateLoginProfilecreates a password for a user that has none. The user gains console access it never had.UpdateLoginProfilereplaces the password of a user that already has one.
In both calls the caller supplies the password, and can clear the flag that forces a change at next sign-in. The caller then knows a working console password for the target user. If that user has more permissions than the caller, this is privilege escalation; if the attacker already controlled the user through a key, it is a second, independent way in.
Nothing asks the target user to agree, and no old password is needed. The only server-side checks are the account password policy and, at sign-in, MFA if the user has a device enrolled.
The MFA variant closes that last gap and adds persistence. CreateVirtualMFADevice returns the seed of a new virtual device, and EnableMFADevice binds the device to a user after two consecutive codes are supplied. An attacker who registers a device on a user without MFA holds the second factor, satisfies policies that require MFA, and leaves the user looking well protected. A user can hold up to eight MFA devices, so a new device does not replace the ones already enrolled: an attacker with these permissions can also add a device next to the owner's.
Prerequisites
- Valid credentials in the target account.
iam:CreateLoginProfileon a target user that has no login profile, oriam:UpdateLoginProfileon a target user that has one. CallingCreateLoginProfilefor a user that already has a password fails withEntityAlreadyExists.- A password that satisfies the account password policy.
- The target user must not have an MFA device the attacker cannot use, unless the attacker has another way past MFA.
- For the MFA variant:
iam:CreateVirtualMFADeviceandiam:EnableMFADeviceon the target user. - The account id or account alias, to reach the IAM user sign-in page.
Attack steps
For authorized security testing and lab use only. Run these steps against systems you own or have written permission to assess.
1. Find users and their console status
aws iam list-users
# NoSuchEntity means the user has no console password yet
aws iam get-login-profile --user-name deploy-admin
aws iam list-attached-user-policies --user-name deploy-admin
A privileged user without a login profile is the quietest target, because adding a password takes nothing away from anyone.
2a. Create a console password for a user that has none
aws iam create-login-profile --user-name deploy-admin \
--password '<password-that-meets-the-policy>' \
--no-password-reset-required
2b. Or reset the password of a console user
aws iam update-login-profile --user-name bob \
--password '<password-that-meets-the-policy>' \
--no-password-reset-required
Pacu automates the first form across the account: iam__backdoor_users_password adds a password to users that do not have one.
Pacu > run iam__backdoor_users_password
3. Sign in to the console
Open the IAM user sign-in page for account 111122223333, enter the user name and the password from step 2, and work in the console as that user.
4. Register an attacker-controlled MFA device (variant)
# Create a virtual device and save its seed as a QR code
aws iam create-virtual-mfa-device \
--virtual-mfa-device-name deploy-admin-mfa \
--outfile ./qrcode.png \
--bootstrap-method QRCodePNG
# Scan the QR code with an authenticator app, then bind the device with two consecutive codes
aws iam enable-mfa-device --user-name deploy-admin \
--serial-number arn:aws:iam::111122223333:mfa/deploy-admin-mfa \
--authentication-code1 <first-code> \
--authentication-code2 <second-code>
From then on, the console asks for a code at sign-in and the attacker can supply it.
Impact
The attacker has interactive console access as the target user. With an administrator user, that is control of the account: the console exposes every service, and console sessions can do what the user's policies allow.
The access is durable. The password stays valid until someone changes it or deletes the login profile, and an attacker-registered MFA device stays bound until it is deactivated. Responders who rotate the user's access keys but do not look at the login profile leave the console path open. With UpdateLoginProfile, the legitimate owner is also locked out until an administrator resets the password, which the attacker can use as a disruption.
OPSEC and artifacts
- Create instead of reset. Operators prefer
CreateLoginProfileon a programmatic user, because resetting a person's password produces a help desk call. The trace is a login profile on a user that never had one, and a creation date on that profile (GetLoginProfile) that does not match the user's age. - Clearing the reset flag.
--no-password-reset-requiredavoids a forced change at first sign-in. It is also what a careful administrator would not do for a new human user, so a profile created with the reset flag off is worth a look. - Adding MFA to look compliant. A user with a password and no MFA is flagged by most posture checks, so the attacker enrolls a device. The CreateVirtualMFADevice and EnableMFADevice events record who created the device and which user it was bound to. They do not show who holds the seed.
- Console sessions over API calls. Activity in the console is logged with the console's user agent and
sessionCredentialFromConsole, and looks like an administrator at work. The sign-in itself writes a ConsoleLogin event with the source address, the outcome inresponseElements.ConsoleLoginand MFA use inadditionalEventData.MFAUsed. - What always remains: the CreateLoginProfile or UpdateLoginProfile management event with the caller, the target in
requestParameters.userName, the source address and the user agent. IAM events are recorded in the US East (N. Virginia) Region.
Detection
- Login profile written by someone else. Alert on
CreateLoginProfileandUpdateLoginProfilewhere the caller is not the user inrequestParameters.userName. People change their own passwords withChangePassword, which is a different event. The login profile detection rules cover both calls. - Console password on a workload user. Any login profile on a user that is tagged, named or inventoried as a service identity.
- Sign-in after the change. A successful
ConsoleLoginfor the target user shortly after the profile change, from an address or user agent the user has not used before. A sign-in withMFAUsedequal toNois covered by the console sign-in without MFA rules. - MFA device registered by another principal, or registered right after a password change. See the MFA device registration rules.
-- Athena, CloudTrail table: login profile changes and the sign-ins that follow
SELECT eventtime, eventsource, eventname, useridentity.arn AS caller,
json_extract_scalar(requestparameters, '$.userName') AS target_user,
json_extract_scalar(responseelements, '$.ConsoleLogin') AS console_login,
json_extract_scalar(additionaleventdata, '$.MFAUsed') AS mfa_used,
sourceipaddress, errorcode
FROM cloudtrail_logs
WHERE eventtime >= '2026-11-28T00:00:00Z'
AND ((eventsource = 'iam.amazonaws.com'
AND eventname IN ('CreateLoginProfile', 'UpdateLoginProfile',
'CreateVirtualMFADevice', 'EnableMFADevice'))
OR (eventsource = 'signin.amazonaws.com' AND eventname = 'ConsoleLogin'))
ORDER BY eventtime
Console sign-in events are recorded by the sign-in endpoint that handled them, which is not always the Region that records IAM events, so query all Regions when joining the two.
Mitigation
- Move people off IAM users. With federation through IAM Identity Center there are no console passwords in the account to create or reset. The IAM Identity Center guide walks through the setup. Accounts without human IAM users can deny
iam:CreateLoginProfileandiam:UpdateLoginProfilewith a service control policy, except for a break-glass role. - Restrict the two actions to the identity administration role. No workload role and no ordinary user should hold them on other users. Where users reset their own passwords, they use
iam:ChangePassword. - Require MFA for every remaining console user, and enroll the device as part of user creation so that there is no window in which an attacker can add the first one.
- Restrict
iam:CreateVirtualMFADeviceandiam:EnableMFADeviceto the user's own identity with a resource scoped to${aws:username}, and to the identity administration role. - Review login profiles. List users with a password, and remove the profile from every workload user. During incident response, check login profiles and MFA devices in addition to access keys.
- Follow the AWS IAM security best practices: temporary credentials and roles instead of long-lived user credentials.
Detection rules for this attack
Log events to collect
FAQ
What is the difference between CreateLoginProfile and UpdateLoginProfile in this attack?
CreateLoginProfile gives a console password to a user that has none, for example a user that was built for programmatic access only. UpdateLoginProfile replaces the password of a user that already signs in to the console. The first is quieter because nobody is locked out. The second takes the account away from its owner, who will notice at the next sign-in.
Does MFA on the target user stop the attack?
It stops the console sign-in if the user already has an MFA device, because the attacker has the password but not the device. It does not help for users without MFA. An attacker who can also call CreateVirtualMFADevice and EnableMFADevice can register a device of their own on a user that has none, and then passes MFA checks legitimately.
How do you detect a malicious login profile?
CloudTrail records CreateLoginProfile and UpdateLoginProfile as IAM management events that name the target user. Alert when the caller is not the target user, and correlate with the next ConsoleLogin event for that user, especially one from a new address. A login profile on a service user is suspicious on its own.
Is the password visible in CloudTrail?
Do not rely on CloudTrail to recover it. The record names the user and the settings that were sent, and AWS does not document the password being written to the event. Treat the event as proof that a password was set, and reset or delete the login profile.
References
- CreateLoginProfile (AWS IAM API Reference)
- UpdateLoginProfile (AWS IAM API Reference)
- EnableMFADevice (AWS IAM API Reference)
- AWS Management Console sign-in events (AWS CloudTrail User Guide)
- Account Manipulation: Additional Cloud Credentials, T1098.001 (MITRE ATT&CK)
- AWS IAM Privilege Escalation: Methods and Mitigation (Rhino Security Labs)
Techniques, tactics and threat groups: MITRE ATT&CK® Enterprise v20.1. © The MITRE Corporation. This work is reproduced and distributed with the permission of The MITRE Corporation. Last updated 2026-11-29.