NoPac (SamAccountName Spoofing)
Released at the end of 2021.
This vulnerability encompasses two CVEs 2021-42278 and 2021-42287.
Allows privilege escalation from any standard domain user to Domain Admin level access in one single command.
42278 | 42287 |
---|
42278 is a bypass vulnerability with the Security Account Manager (SAM). | 42287 is a vulnerability within the Kerberos Privilege Attribute Certificate (PAC) in ADDS. |
Takes advantage of being able to change the SamAccountName
of a computer account to that of a DC.
By default, authenticated users can add up to 10 computers to a domain and attacker will change the name of the new host to match DC’s SamAccountName.
After that, attacker requests Kerberos tickets causing the service to issue us tickets under the DC’s name instead of the new name.
When a TGS is requested, it will issue the ticket with the closest matching name.
Once done, attacker will have access as that service and can even be provided with SYSTEM shell on a DC.
Read in more details on blog post.
Attack
We can use this tool to perform this attack.
Installation
We need both impacket and nopac.
First install impacket:
Now install nopac:
Scanning for NoPac
Let’s use scanner.py
under NoPac directory to check if the system is vulnerable:
Shell
Now that we have confirmed the vulnerability, let’s get a shell. This can be noisy and might get blocked by AV or EDR:
Above shell is created using smbexec.py
Tickets Saved
TGT tickets are saved in the attack host after the attack and we can use these cache file to perform PtT and DCSync attack if we want.
DCSync
PrintNightmare