On this page 20 sections
  1. What WebDAV is
  2. WebDAV is not automatically vulnerable
  3. Initial enumeration
  4. OPTIONS
  5. Common WebDAV methods
  6. PROPFIND
  7. PUT
  8. DELETE
  9. MKCOL
  10. Authentication
  11. DAVTest
  12. What DAVTest tells you
  13. Cadaver
  14. Useful Cadaver commands
  15. Writable WebDAV
  16. IIS considerations
  17. Nmap WebDAV detection
  18. Safe write testing
  19. Enumeration workflow
  20. Quick reference
01

What WebDAV is

WebDAV, or Web Distributed Authoring and Versioning, is an extension of HTTP that allows clients to remotely manage files and directories on a web server. It adds methods for creating, modifying, moving and deleting web resources.

02

WebDAV is not automatically vulnerable

The presence of WebDAV does not by itself indicate a vulnerability. The security impact depends on authentication, enabled methods, filesystem permissions and whether users can create or modify sensitive resources.

03

Initial enumeration

Start by identifying the underlying HTTP service and then determine whether WebDAV methods are enabled.

HTTP service detection
nmap -sC -sV -p 80,443 <TARGET>
Check HTTP methods
nmap -p 80 --script http-methods <TARGET>
Manual OPTIONS request
curl -i -X OPTIONS http://<TARGET>/
04

OPTIONS

OPTIONS can reveal which HTTP methods the server advertises for a resource. WebDAV-enabled servers may expose methods beyond normal GET and POST operations.

Enumerate allowed methods
curl -i -X OPTIONS http://<TARGET>/
05

Common WebDAV methods

WebDAV introduces methods such as PROPFIND, MKCOL, COPY, MOVE, LOCK and UNLOCK. PUT and DELETE are also particularly important when assessing whether a location is writable.

06

PROPFIND

PROPFIND requests metadata about a WebDAV resource and can enumerate files, directories and properties exposed by the server.

Basic PROPFIND request
curl -i -X PROPFIND http://<TARGET>/
Depth 1 enumeration
curl -i -X PROPFIND -H 'Depth: 1' http://<TARGET>/
07

PUT

PUT requests creation or replacement of a resource. If an unauthorised user can successfully upload files into a sensitive web-accessible directory, the configuration may be security-relevant.

Upload harmless test file
curl -X PUT --data "test" http://<TARGET>/test.txt
08

DELETE

DELETE removes a resource when permitted. When testing write permissions, use only harmless files created specifically for the assessment.

Delete test file
curl -X DELETE http://<TARGET>/test.txt
09

MKCOL

MKCOL creates a new collection, which is similar to creating a directory in WebDAV.

Create test collection
curl -X MKCOL http://<TARGET>/testdir/
10

Authentication

WebDAV may be protected by HTTP Basic, Digest, NTLM or other authentication mechanisms. Authentication requirements should be identified before testing write access.

Inspect authentication headers
curl -I http://<TARGET>/
Basic authentication
curl -u <USERNAME>:<PASSWORD> -X PROPFIND http://<TARGET>/
11

DAVTest

DAVTest automates several WebDAV capability checks and can test which file types the server allows to be uploaded or executed in a writable WebDAV location.

Basic DAVTest
davtest -url http://<TARGET>/
Authenticated DAVTest
davtest -url http://<TARGET>/ -auth <USERNAME>:<PASSWORD>
12

What DAVTest tells you

DAVTest can help identify writable resources, supported extensions and whether uploaded test files are accessible. Its output should be interpreted together with server permissions and application behaviour.

13

Cadaver

Cadaver is an interactive command-line WebDAV client. It provides a workflow similar to FTP clients for browsing, uploading, downloading and managing WebDAV resources.

Connect with Cadaver
cadaver http://<TARGET>/
14

Useful Cadaver commands

Once connected, Cadaver can enumerate directories and transfer files when the authenticated account has the required permissions.

List resources
ls
Change directory
cd <DIRECTORY>
Upload file
put <FILE>
Download file
get <FILE>
Create directory
mkcol <DIRECTORY>
15

Writable WebDAV

A writable WebDAV location becomes more important when uploaded files are stored in a web-accessible path or processed by another application. Write access alone does not automatically imply code execution.

16

IIS considerations

WebDAV has historically been deployed with Microsoft IIS, but it is not limited to IIS. During enumeration, identify the underlying web server and determine how WebDAV permissions interact with the web root and authentication configuration.

Identify server
curl -I http://<TARGET>/
17

Nmap WebDAV detection

Nmap includes scripts that can help identify WebDAV functionality and supported HTTP methods.

WebDAV scan
nmap -p 80 --script http-webdav-scan <TARGET>
HTTP methods
nmap -p 80 --script http-methods <TARGET>
18

Safe write testing

When testing write permissions, create a harmless file specifically for the assessment and remove it afterward. Avoid modifying or deleting existing application files.

Create test file
echo test > test.txt
Upload with PUT
curl -T test.txt http://<TARGET>/test.txt
Remove test file
curl -X DELETE http://<TARGET>/test.txt
19

Enumeration workflow

Identify the web service, enumerate supported HTTP methods, test PROPFIND, determine whether authentication is required, inspect accessible resources and then assess read and write permissions using DAVTest, Cadaver or manual requests.

Initial scan
nmap -sC -sV -p 80,443 <TARGET>
Methods
curl -i -X OPTIONS http://<TARGET>/
PROPFIND
curl -i -X PROPFIND -H 'Depth: 1' http://<TARGET>/
DAVTest
davtest -url http://<TARGET>/
Cadaver
cadaver http://<TARGET>/
20

Quick reference

These are the WebDAV commands worth remembering.

OPTIONS
curl -i -X OPTIONS http://<TARGET>/
PROPFIND
curl -i -X PROPFIND -H 'Depth: 1' http://<TARGET>/
PUT
curl -T test.txt http://<TARGET>/test.txt
DELETE
curl -X DELETE http://<TARGET>/test.txt
Nmap
nmap -p 80 --script http-webdav-scan,http-methods <TARGET>
DAVTest
davtest -url http://<TARGET>/
Cadaver
cadaver http://<TARGET>/