> For the complete documentation index, see [llms.txt](https://cajac.gitbook.io/ctf-notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cajac.gitbook.io/ctf-notes/web/miscellaneous/webdav.md).

# WebDAV

## Cadaver

`cadaver` is a command-line WebDAV client, with support for file upload, download, on-screen display, in-place editing, namespace operations (move/copy), collection creation and deletion, property manipulation, and resource locking.

## Davtest

`davtest` tests WebDAV enabled servers by uploading test executable files, and then (optionally) uploading files which allow for command execution or other actions directly on the target. It is meant for penetration testers to quickly and easily determine if enabled DAV services are exploitable.

Example usage:

```bash
davtest -auth wampp:xampp -url http://10.10.13.109/webdav/ 
```

## Usage information

<details>

<summary>cadaver -h</summary>

```
┌──(kali㉿kali)-[~]
└─$ cadaver -h
Usage: cadaver [OPTIONS] http://hostname[:port]/path
  Port defaults to 80, path defaults to '/'
Options:
  -t, --tolerant            Allow cd/open into non-WebDAV enabled collection.
  -r, --rcfile=FILE         Read script from FILE instead of ~/.cadaverrc.
  -p, --proxy=PROXY[:PORT]  Use proxy host PROXY and optional proxy port PORT.
  -V, --version             Display version information.
  -h, --help                Display this help message.
Please send bug reports and feature requests via <https://github.com/notroj/cadaver>

```

</details>

<details>

<summary>davtest</summary>

```
┌──(kali㉿kali)-[/mnt/…/TryHackMe/CTFs/Easy/Dav]
└─$ davtest   

ERROR: Missing -url

/usr/bin/davtest -url <url> [options]

 -auth+         Authorization (user:password)
 -cleanup       delete everything uploaded when done
 -directory+    postfix portion of directory to create
 -debug+        DAV debug level 1-3 (2 & 3 log req/resp to /tmp/perldav_debug.txt)
 -move          PUT text files then MOVE to executable
 -nocreate      don't create a directory
 -quiet         only print out summary
 -rand+         use this instead of a random string for filenames
 -sendbd+       send backdoors:
                        auto - for any succeeded test
                        ext - extension matching file name(s) in backdoors/ dir
 -uploadfile+   upload this file (requires -uploadloc)
 -uploadloc+    upload file to this location/name (requires -uploadfile)
 -url+          url of DAV location

Example: /usr/bin/davtest -url http://localhost/davdir

```

</details>

## Reources

cadaver - Github: <https://github.com/notroj/cadaver>

cadaver - Kali Tools: <https://www.kali.org/tools/cadaver/>

davtest - Github: <https://github.com/cldrn/davtest>

davtest - Kali Tools: <https://www.kali.org/tools/davtest/>

helper: webdav xampp <= 1.7.3 default credentials: <https://xforeveryman.blogspot.com/2012/01/helper-webdav-xampp-173-default.html>

WebDav - HackTricks: <https://book.hacktricks.xyz/network-services-pentesting/pentesting-web/put-method-webdav>

WebDAV - Wikipedia: <https://en.wikipedia.org/wiki/WebDAV>
