Web Application Analysiswebdavpenetration-testingexploitationupload-testing

DAVTest

DAVTest is a testing tool for WebDAV servers that uploads test executable files to determine if enabled DAV services are exploitable. It checks for successful uploads and execution of various file types on the target server.

Description

DAVTest is designed for penetration testers to quickly assess the exploitability of WebDAV enabled servers. The tool uploads test files with different extensions such as .asp, .cgi, .txt, .pl, .jsp, .cfm, .aspx, .jhtml, .php, .html, and .shtml, then verifies if these files can be executed on the server. This helps identify misconfigurations that could allow remote code execution or other malicious actions directly on the target.

Use cases include security assessments of web servers with WebDAV enabled, identifying dangerous file upload permissions, and discovering servers that execute unexpected file types. The tool creates a temporary directory on the target, uploads test files, and optionally cleans up afterwards.

It provides detailed output showing which file types can be uploaded (PUT SUCCEED/FAIL) and which can be executed (EXEC SUCCEED/FAIL), making it easy to spot vulnerabilities.

How It Works

DAVTest establishes a connection to the WebDAV server using the HTTP DAV protocol. It creates a unique temporary directory (e.g., DavTestDir_B0yG9nhdFS8gox) via MKCOL, then attempts to PUT upload test files with various extensions containing harmless content. After uploads, it checks for execution by attempting to access the uploaded files via GET or other methods to see if the server processes them as executables. Results are summarized showing successful PUT and EXEC operations with full URLs.

Installation

bash
sudo apt install davtest

Flags

-auth+Authorization (user:password)
-realm+Auth Realm
-cleanupdelete 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)
-movePUT text files then MOVE to executable
-copyPUT text files then COPY to executable
-nocreatedon't create a directory
-uploadfile+upload this file (requires -uploadloc)
-uploadloc+upload file to this relative location/name (requires -uploadfile)
-url+url of DAV location

Examples

Scan the given WebDAV server at http://192.168.1.209, testing uploads and execution of various file types
davtest -url http://192.168.1.209
Test WebDAV server at http://localhost/davdir as shown in usage example
davtest -url http://localhost/davdir
Test WebDAV server with basic authentication
davtest -url http://192.168.1.209 -auth user:password
Test server and delete all uploaded files when done
davtest -url http://192.168.1.209 -cleanup
Test server with debug level 2, logging requests/responses to /tmp/perldav_debug.txt
davtest -url http://192.168.1.209 -debug 2
PUT text files then MOVE to executable extensions
davtest -url http://192.168.1.209 -move
Test without creating a directory
davtest -url http://192.168.1.209 -nocreate
Updated 2026-04-16kali.org ↗