Blackfield
Blackfield
Status Completed
URL https://www.youtube.com/watch?v=IfCysW0Od8w&t
Nmap Scan
Blackfield 1
135/tcp open msrpc syn-ack ttl 127 Microsoft Windows RPC
389/tcp open ldap syn-ack ttl 127 Microsoft Windows Active Directory
LDAP (Domain: BLACKFIELD.local0., Site: Default-First-Site-Name)
445/tcp open microsoft-ds? syn-ack ttl 127
593/tcp open ncacn_http syn-ack ttl 127 Microsoft Windows RPC over HTT
P 1.0
3268/tcp open ldap syn-ack ttl 127 Microsoft Windows Active Directory
LDAP (Domain: BLACKFIELD.local0., Site: Default-First-Site-Name)
5985/tcp open http syn-ack ttl 127 Microsoft HTTPAPI httpd 2.0 (SSDP/
UPnP)
|_http-server-header: Microsoft-HTTPAPI/2.0
|_http-title: Not Found
Service Info: Host: DC01; OS: Windows; CPE: cpe:/o:microsoft:windows
These are the info we can find from the nmpa scan, we can add the domain name
to the /etc/hosts
nano /etc/hosts
10.10.10.192 BLACKFIELD.local BLACKFIELD.local.htb
Another thing we noticed in the machine was there was time difference
Since ldap and kerberos are present its likely it’s the DC
Let’s first enumerate the shares
Blackfield 2
[~] - hak101> netexec smb 10.10.10.192 -u '.' -p '' --shares
We can see that when we try to get guest user shares there’s a profiles directory,
we can enumerate it further using smbclient tool
We can see a bunch of users files, we can copy all the usernames and make a list
Blackfield 3
Now we have made a list of usernames we can try to check for valid ones using
the kerbrute too
Blackfield 4
We can see that we got a hash for the Kerberos user, next we can try to crack it
#00^BlackKnight
Didn’t find anything new here, we can try to winrm to the machine
Blackfield 5
We cannot access the box with winrm, the next option is running bloodhound with
the credentials
bloodhound
Blackfield 6
Now drag and drop all the files
Blackfield 7
When we check node info for the support user we can see that there’s one First
Blackfield 8
We can see that we can force change the password to another user, we can do
this using rpcclient or AD tool called bloodyAD
Blackfield 9
[~] - hak101> bloodyAD --host "10.10.10.192" -d "blackfield.local" -u "support"
-p "#00^BlackKnight" set password "audit2020" "Abc@123#"
We can see that the new credentials that we set worked, we can try winrm
authentication too
Unfortunately it didn’t work so we still don’t have access to the machine, next
thing we can do is check for shares
Blackfield 10
We can see there’s a new directory named forensic, we can check what it
contains, we can use the smbget tool to get all the files from the forensic directory
The tool took quite a bit of time to download all the .zip files from the
memory_analysis and we can see an interesting file named lsass.zip
We can dump plaintext credentials using mimikatz as it is used for dumping hashes
from lsass.exe , lets first unzip the file
We got a file named lsass.dmp , now we can extract the contents of the file using
pypykatz
Blackfield 11
We can see that we got the svc_backup user hash, we can check if we can
authenticate using this to the machine
We can see that the hashes worked, next we can try to use with winrm
We can see that it is pawned! so we can use the evil-winrm tool to log in as the user
User Flag
Privilege Escalation
https://www.youtube.com/watch?v=pWkWIa2dfHY&t=925s
When we check the user for privileges we can see the user has SeBackupPrivilege
Blackfield 12
*Evil-WinRM* PS C:\Users\svc_backup\Documents> whoami /priv
This is the other case where we will need SeRestorePrivilege in order to work. As we
can see here we have both
Firstly, in the C:\ Directory, let's make a temp directory
Blackfield 13
https://github.com/giuliano108/SeBackupPrivilege
Blackfield 14
Copy-FileSeBackupPrivilege C:\Windows\ntds\ntds.dit C:\temp\ntds.dit
It didn’t work because we need to create a shadow copy, for this, we have a little
script in the kali machine
Save it as copy.txt , and run this command on the file to fix spacing and syntax
errors
Now let's upload this file to the victim's machine with the evil-winrm access
Blackfield 15
Now we can execute
Now we have successfully copied everything from the C drive to the X drive
Now we can copy the ntds.dit file from the X drive and save it to the C drive
Blackfield 16
reg save hklm\system C:\temp\system.back
Now doing dir, these are the files that u will see in the /temp directory that we
created
Once we have downloaded both the files onto our Kali machine ,we can use
secretsdump.py to extract the hashes
Blackfield 17
Now we have got all the users’ hashes, all the users in the domain! including the
DC hash
Now we can do pass the hash attack using the administrator hash to get root
Root Flag
Blackfield 18