Cadaver on Kali Linux Tools: A Guide to WebDAV Exploitation

We will explore Cadaver in detail, covering its installation, usage, and potential security risks associated with WebDAV misconfigurations.

Kali Linux is a powerful penetration testing operating system used by security professionals and ethical hackers to assess vulnerabilities in networks and applications. Among the many tools included in Kali, Cadaver is a command-line client designed to interact with WebDAV (Web Distributed Authoring and Versioning) servers. WebDAV is an extension of HTTP that allows users to manage files on remote web servers, but it can also be exploited if not properly secured.

In this blog post, we will explore Cadaver in detail, covering its installation, usage, and potential security risks associated with WebDAV misconfigurations.

What is WebDAV?

Web Distributed Authoring and Versioning (WebDAV) is an HTTP protocol extension that allows users to collaboratively edit and manage files stored on remote web servers. It enables functionalities such as:

  • File creation, deletion, and modification
  • Directory listing and navigation
  • User authentication and access control

While WebDAV is useful for legitimate file management purposes, improper security configurations can lead to unauthorized access, data leaks, or even full server compromise.

Introduction to Cadaver

Cadaver is a command-line WebDAV client available in Kali Linux that allows users to interact with WebDAV-enabled servers. It provides an FTP-like interface for performing WebDAV operations such as uploading, downloading, deleting, and listing files.

Why Use Cadaver?

Cadaver is a lightweight yet powerful tool for:

  • Testing WebDAV server security
  • Uploading and retrieving files from remote servers
  • Assessing permissions and access control
  • Brute-force and credential testing

Installing Cadaver on Kali Linux

Cadaver is pre-installed in most Kali Linux distributions. However, if it is missing, you can install it using the following command:

sudo apt update && sudo apt install cadaver -y

After installation, you can check whether Cadaver is correctly installed by running:

cadaver --version

How to Use Cadaver

Connecting to a WebDAV Server

To connect to a WebDAV server using Cadaver, use the following command:

cadaver http://example.com/webdav/

If authentication is required, Cadaver will prompt you for a username and password:

Username: admin
Password: ********

If successful, you will enter an interactive mode similar to an FTP client.

Common Cadaver Commands

Here are some useful commands when interacting with a WebDAV server:

CommandDescription
lsList files in the current directory
cd <directory>Change to a different directory
put <file>Upload a file to the WebDAV server
get <file>Download a file from the server
delete <file>Delete a file from the server
mkdir <directory>Create a new directory on the server
rmdir <directory>Remove a directory from the server
quitExit Cadaver

For example, to upload a file named test.txt:

put test.txt

To download a file named document.pdf:

get document.pdf

Automating Cadaver with Scripts

Cadaver can be used in scripting to automate WebDAV interactions. For example, you can create a simple script to upload files:

#!/bin/bash
echo "Uploading files to WebDAV"
(echo "put test.txt"; echo "quit") | cadaver http://example.com/webdav/

This method is useful for penetration testing, automating backups, or managing files in bulk.

Security Risks and Exploitation

Common WebDAV Vulnerabilities

  1. Weak or Default Credentials – Many WebDAV servers use weak passwords, making them vulnerable to brute-force attacks.
  2. Misconfigured Permissions – Some servers allow unauthorized users to upload or modify files.
  3. Directory Traversal Attacks – Poorly configured servers may allow attackers to access restricted directories.
  4. Command Execution via File Upload – If a WebDAV server allows script execution (e.g., PHP, ASP, or JSP), an attacker can upload a malicious script and execute it remotely.

Exploiting WebDAV Misconfigurations with Cadaver

1. Testing for Anonymous Access

To check if a WebDAV server allows anonymous access, try connecting without credentials:

cadaver http://example.com/webdav/

If successful, it indicates a major security flaw.

2. Brute-Forcing Credentials

Use tools like Hydra to brute-force WebDAV login credentials:

hydra -L users.txt -P passwords.txt example.com http-get /webdav/

3. Uploading Malicious Files

If the server allows unrestricted file uploads, an attacker can upload a web shell, such as shell.php:

put shell.php

Once uploaded, accessing http://example.com/webdav/shell.php may provide remote command execution.

Securing WebDAV Servers

To prevent exploitation, administrators should:

  • Disable WebDAV if not needed
  • Enforce strong authentication and disable anonymous access
  • Restrict file upload permissions
  • Disable execution of scripts in WebDAV directories
  • Monitor logs for suspicious activity

Conclusion

Cadaver is a useful tool in Kali Linux for interacting with WebDAV servers, whether for legitimate file management or penetration testing. While WebDAV can be beneficial, it also presents security risks if not properly configured. Ethical hackers and administrators should use Cadaver to identify vulnerabilities and strengthen their WebDAV security measures.

Understanding how WebDAV works and how it can be exploited ensures better protection against unauthorized access and data breaches. Always use penetration testing tools responsibly and with proper authorization.


Disclaimer: This guide is for educational purposes only. Unauthorized access to systems is illegal.


Last modified 20.02.2025: new kotlin and mint content (93a1000)