I want upload a file to a ftp server using Tor proxy to comunicate with a Hidden Service. I have seen several ways using stem
and socks
but I could not connect to an FTP yet.
#!/usr/bin/python3.5
import ftplib
import os
def upload(ftp, file):
ext = os.path.splitext(file)[1]
if ext in(".txt", ".htm", ".html"):
internet.ftp.storlines("STOR " + file ,open(file))
else:
internet.ftp.storbinary("STOR " + file, open(file, "rb"), 1024)
ftp = ftplib.FTP('jk5qbvzlgbmss3zh.onion')
ftp.login("proftpd","123123")
upload(ftp, "file.zip.gpg")