🌐 SMB Uploads with WebDAV Twist

Typically, SMB (port TCP/445) is blocked on networks for security πŸš«πŸ›‘οΈ. But when you want to upload files and can’t use traditional SMB... enter WebDAV! πŸ§™β€β™‚οΈ


πŸ” Why WebDAV?

WebDAV (πŸ“„ Web Distributed Authoring and Versioning) is an extension of HTTP (RFC 4918) and lets a web server behave like a file server β€” all over HTTP/HTTPS! It's great for uploads when SMB is blocked, and it works smoothly with Windows’ Mini-Redirector driver.


πŸ› οΈ Step-by-Step: Setting Up WebDAV Uploads

🧱 Step 1: Install WebDAV Python Modules

sudo pip3 install wsgidav cheroot

βš™οΈ Step 2: Start the WebDAV Server

sudo wsgidav --host=0.0.0.0 --port=80 --root=/tmp --auth=anonymous

βœ… This serves /tmp as writable, anonymously-accessible WebDAV root via HTTP!


πŸ’» Step 3: Accessing the Share from Windows

πŸ“ Browse from Windows using a special keyword:

C:\htb> dir \\192.168.49.128\DavWWWRoot

πŸ”Ή DavWWWRoot is not a real folder β€” it's a Windows keyword that says β€œconnect to the WebDAV root”.

🧭 Or, connect directly to a real subfolder:


πŸ“€ Step 4: Upload a File to the Share

🧠 You can also upload directly to a folder:


πŸ“ Notes

  • If your network doesn't block SMB (TCP/445), you can still use impacket-smbserver for uploads as we did in downloads.

  • But if it is blocked, WebDAV is your friend and works on HTTP/HTTPS! πŸšͺ

Last updated