Service (THM)
At your service.
Into
Hello Every one today i want to do a windows machine as a part of my way to master AD (Active Directory) SHALL WE ??
Enumeration
Port scanning
There are a lot of things Running there but there are few important ones.
HTTP : 80
DNS : 53
SSH : 22
kerberos-sec : 88
RDP : 3389
LDAP : 389
SMB : 139 , 445
Let's start with the simplest which is the HTTP server.
HTTP
After Enumerate for a bit i notice this.
There are few things we can notice.
There are few users which appear to be
We can see how they would set the names for Joanne Doe should be j.doe@services.local
So we can deduce the rest right.
My user file will look like this initially
Validate the users
We can use multiple tools to validate the users via kerberos we can use https://github.com/ropnop/kerbrute a good tool to attack Active directory.
Using Kerbrute we were able to find a hash of one of the users which is Jack. Now let's try to crack it via hash cat.
After try with hashcat i was not able to crack it because the algorith used here was kinda strong to crack as we can see
$18
.
And there i used impacket tool called GetNPUsers which suppose to give us the same thing but with weaker hash.
And as we can see here this hash should be weaker let's give that a shot and crack it.
hashcat -m 18200 -a 0 ./hash ../../Downloads/rockyou.txt
And indeed we was able to crack it.j.rock : Serviceworks1
As we get valid creds now we can see what does SMB have for us.
SMB
We can use tools like smbmap or smbclient to see what shares do we have.
In my case i will use smbclient.
First i will check the C$ share.
We can find our flag there :)
Getting Shell as j.rock
I though that we maybe able to access the machine via evil-Winrm and indeed we can.
Getting Administrator access
The first thing i review when i access the machine was the permission.
The server Operators Group is interesting group since it allow use to configure some aspect of the AD. https://www.hackingarticles.in/windows-privilege-escalation-server-operator-group/
Using the above resource i was able to get administrator access The process went as follow.
I create this payload using msfvenom.
Then i setup the listener from metasploit.
And now from the hacked machine we need to set the service and allow our shell to be executed as NT\Authority.
Using the
services
command we see the running commands. You can choose one to execute the same steps but the only one that works with me wascfn-hub
.Now we can start the service again.
And now we are the super user.
And here we have our flag.
Conclusion.
This machine was quite fun and easy as am not that good with Windows not AD. :)
Last updated