On this page 20 sections
- What WebDAV is
- WebDAV is not automatically vulnerable
- Initial enumeration
- OPTIONS
- Common WebDAV methods
- PROPFIND
- PUT
- DELETE
- MKCOL
- Authentication
- DAVTest
- What DAVTest tells you
- Cadaver
- Useful Cadaver commands
- Writable WebDAV
- IIS considerations
- Nmap WebDAV detection
- Safe write testing
- Enumeration workflow
- Quick reference
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.
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.
Initial enumeration
Start by identifying the underlying HTTP service and then determine whether WebDAV methods are enabled.
nmap -sC -sV -p 80,443 <TARGET>nmap -p 80 --script http-methods <TARGET>curl -i -X OPTIONS http://<TARGET>/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.
curl -i -X OPTIONS http://<TARGET>/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.
PROPFIND
PROPFIND requests metadata about a WebDAV resource and can enumerate files, directories and properties exposed by the server.
curl -i -X PROPFIND http://<TARGET>/curl -i -X PROPFIND -H 'Depth: 1' http://<TARGET>/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.
curl -X PUT --data "test" http://<TARGET>/test.txtDELETE
DELETE removes a resource when permitted. When testing write permissions, use only harmless files created specifically for the assessment.
curl -X DELETE http://<TARGET>/test.txtMKCOL
MKCOL creates a new collection, which is similar to creating a directory in WebDAV.
curl -X MKCOL http://<TARGET>/testdir/Authentication
WebDAV may be protected by HTTP Basic, Digest, NTLM or other authentication mechanisms. Authentication requirements should be identified before testing write access.
curl -I http://<TARGET>/curl -u <USERNAME>:<PASSWORD> -X PROPFIND http://<TARGET>/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.
davtest -url http://<TARGET>/davtest -url http://<TARGET>/ -auth <USERNAME>:<PASSWORD>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.
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.
cadaver http://<TARGET>/Useful Cadaver commands
Once connected, Cadaver can enumerate directories and transfer files when the authenticated account has the required permissions.
lscd <DIRECTORY>put <FILE>get <FILE>mkcol <DIRECTORY>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.
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.
curl -I http://<TARGET>/Nmap WebDAV detection
Nmap includes scripts that can help identify WebDAV functionality and supported HTTP methods.
nmap -p 80 --script http-webdav-scan <TARGET>nmap -p 80 --script http-methods <TARGET>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.
echo test > test.txtcurl -T test.txt http://<TARGET>/test.txtcurl -X DELETE http://<TARGET>/test.txtEnumeration 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.
nmap -sC -sV -p 80,443 <TARGET>curl -i -X OPTIONS http://<TARGET>/curl -i -X PROPFIND -H 'Depth: 1' http://<TARGET>/davtest -url http://<TARGET>/cadaver http://<TARGET>/Quick reference
These are the WebDAV commands worth remembering.
curl -i -X OPTIONS http://<TARGET>/curl -i -X PROPFIND -H 'Depth: 1' http://<TARGET>/curl -T test.txt http://<TARGET>/test.txtcurl -X DELETE http://<TARGET>/test.txtnmap -p 80 --script http-webdav-scan,http-methods <TARGET>davtest -url http://<TARGET>/cadaver http://<TARGET>/