HackTheBox - Forest

Easy Windows Machine by HTB

Let's start off with a simple nmap scan for open ports and services.

nmap -sC -sV -oA nmap-forest 10.10.10.161
nmap scan results

We will keep a Nmap all port scan running in the background and start enumerating with what we have.

Enumerating Samba

Incase you don't have smbclient installed on the system.

No shares found on Anonymous login.

Enumerating LDAP

Using query to get results for 'objectClass=Person'

We get a ton of data to look after. Query to get all the users present on the machine.

Creating Custom Passwords using bash knowledge. We will add various common passwords like Autumn, Spring, Password, etc.

Also we will be using hashcat and it's best64 rule to create a unique and promising wordlist.

Scanning with crackmapexec (Pass-Policy Check)

We can also use rpcclient to enumerate bunch of users and their info.

We can use a lot of query options available to enumerate any user. Actually we got a new user named svc-alfresco

As PasswordLockoutThreshold is set to None, we can try bruteforcing the users present.

Getting Shell Access

We will use GetNPUsers.py script by impacket. This script will attempt to list and get TGTs for those users that have the property 'Do not require Kerberos preauthentication' set (UF_DONT_REQUIRE_PREAUTH).

This script is useful for abusing Kerberos against AS-REP Roasting attack.

Make sure to convert the hash into (hashcat) format.

So the password can be cracked using hashcat and rockyou.txt wordlist.

We have read access to NETLOGON and SYSVOL shares.

Here, we can use evil-winrm to get shell on the box as we already have username and password for svc-alfresco service account.

user.txt is presen t in C:\Users\svc-alfresco\Desktop.

Setting Up SMBShare using impacket and using New-PSDrive to mount the share.

First we need to setup a server using smbserver.py from the impacket module.

We need to transfer winPeas.exe into the target machine for Machine Enumeration. So we will transfer it using SMB Share. First keep the file (winPeas.exe) in the share directory and start off the server.

In order to create a PSDrive (Mount share), we need a create a password credential object.

Creating password/credential object:

We can browse the share and can even run the files present in that share as we have successfully authenticated ourself.

Last updated

Was this helpful?