Introduction to HackTheBox APT

In this article, we covered various aspects of Active Directory Penetration Testing using many techniques through this insane-level box.

The article also walks through hacking the retired “APT” machine on Hack The Box, which is rated insanely hard. The attack involves:
Enumerating MSRPC and SMB
Extracting Active Directory hashes
Performing Kerberos attacks
Exploiting NTLM leaks
Gaining administrator access

HackTheBox APT Description

APT is an insane difficulty Windows machine where RPC and HTTP services are only exposed. Enumeration of existing RPC interfaces provides an interesting object that can be used to disclose the IPv6 address. The box is found to be protected by a firewall exemption that over IPv6 can give access to a backup share. User enumeration and bruteforce attacks can give us access to the registry which contains login credentials. The machine is configured to allow authentication via the NTLMv1 protocol, which can be leveraged to gain system access.

Walkthrough

1️⃣ Enumerating Microsoft RPC (MSRPC) on Port 135

MSRPC (Microsoft Remote Procedure Call) is used for Windows services.

Using rpcmap to list available mappings and interfaces.

The output reveals an IPv6 address, used for further attacks.

2️⃣ SMB Enumeration & Extracting Active Directory Database

Scanning SMB shares on port 445 using smbclient.

Finding & downloading backup.zip, which contains:
🔹 ntds.dit (Active Directory database)
🔹 SYSTEM (Registry file)

Cracking the zip password with john:

  • Password found: "iloveyousomuch"

Extracting user hashes from Active Directory database:

This provides usernames and password hashes.

3️⃣ Identifying Active Users with Kerberos

Using kerbrute to find active users:

  • This identifies “Henry Vincent” as an active user.

Testing the extracted hashes with crackmapexec:

Login fails, so brute-forcing is needed.

4️⃣ Exploiting Kerberos Authentication

Using GetTGT.py to request a Kerberos Ticket Granting Ticket (TGT):

This retrieves a Kerberos ticket, meaning the password hash is valid.

Extracting stored plaintext credentials from the registry using:

Finds a plaintext admin password! 🔥

5️⃣ Gaining Initial Access with Evil-WinRM

Logging in using Evil-WinRM:

First shell obtained! 🎉

6️⃣ Privilege Escalation – NTLM Hash Leak

Checking PowerShell history for misconfigurations:

  • Finds a misconfiguration in NTLM authentication settings.
  • The admin disabled NTLMv2, making NTLM hashes leakable.

Forcing NTLM hash leak via Windows Defender scan:

  • Host a malicious file on an SMB server:

Trigger a scan on the target:

The admin’s NTLM hash is captured in Responder.

7️⃣ Cracking NTLM Hash & DC Sync Attack

  • Cracking the NTLM hash using CrackStation.
  • Using secretsdump.py for DC Sync attack:
  • Dumps all Active Directory passwords.

Logging in as Administrator:

Root access achieved! 🎉🎉

Key Takeaways

MSRPC enumeration can reveal network interfaces & IPv6 targets.
Backup files often store sensitive data (Active Directory hashes, registry keys, etc.).
NTLM misconfigurations can lead to severe leaks.
Responder + Windows Defender scan can capture NTLM hashes remotely.
DC Sync allows full Active Directory takeover once an admin hash is obtained.

HackTheBox APT Video Walkthrough

About the Author

Mastermind Study Notes is a group of talented authors and writers who are experienced and well-versed across different fields. The group is led by, Motasem Hamdan, who is a Cybersecurity content creator and YouTuber.

View Articles