RECON#2
SMB
I used smbmap for enumerating the SMB shares with the credentials found with the Redis exploit. See below for the output:
smbmap -H VULNNET -u enterprise-security -p sand_0873959498

So, it looks like Enterprise-Share has read and write access, so I tried seeing what’s in there. But I had a difficult time connecting to the actual SMB
service by using SMBCLIENT,
it would not connect for some reason.
I used Netexec with this payload:
netexec smb 10.66.141.81 -u enterprise-security -p sand_0873959498 -d VULNNET --shares
and then,
smbclient //10.66.141.81/Enterprise-Share -U 'VULNNET\enterprise-security%sand_0873959498'
And presto, I got a SMB prompt!
Uploading a new script
To upload a file in the SMB server, you can use functions like put.
See below:
smb: \> put PurgeIrrelevantData_1826.ps1
But first you must modify the file on your kali machine and upload a reverse shell script into the SMB share.
I used a script in the built in Kali file folder at /usr/share/set/src/powershell
There is a file called reverse_powershell (this is a function that creates a reverse shell with powershell commands).
Login to smbclient again and use the put command to copy the file into the SMB share.
The put function has copied an exact copy in you current folder on your Kali machine.
Script modifications: ***I also added the IP and the PORT, IMPORTANT*** place the IP of the tunnel or VPN that you are using to connect to
the TryHackMe box. You can ip a, to find the Tun0 IP address.

This what your reverse shell will look like at first. With the command “whoami”, you will see enterprise-security.

But we need to be root to get the 2nd flag. So we need to elevate privileges or access to get the 2nd Flag.
To check what privileges this user might have, we can use the command:
Whoami /priv
And the below will show the privileges of enterprise-security

The setImpersonatePrivilege is enabled and will help us elevate our privilege.
According to grok: “Having SetImpersonatePrivilege enabled in your token allows you to:
• Take an impersonation token from a higher-privileged process (especially SYSTEM) that authenticates to something you control.
• Create a new process running as that higher-privileged account.
This is the foundation for many local privilege escalation techniques on Windows,
especially when you have code execution as a service account but not as Administrator/SYSTEM. “
Also, we can enumerate some information about the system we are on: systeminfo
Which gives you the Microsoft version 2019 Windows Server.