To exploit printnightmare we will first check if the spooler is active on targets
Check spooler is active
Create Revershell and place it in the smb directory
Setup the listener
No shell.. It gets caught by defender
Lets craft a new dll
Let’s change the payload with another code (source : https://github.com/newsoft/adduser
Good (thing) to know : after some failures the spooler service will be stopped by defender and no more exploit for you until someone restart the server or the spooler service.
with this payload we can bypass defender and add our user as administrator
Compile
relaunch the exploit
dumpy dumpy dumpy love love
cleanup
After the exploitation you will find your dlls inside : C:\Windows\System32\spool\drivers\x64\3
And also inside : C:\Windows\System32\spool\drivers\x64\3\Old\{id}\