1import argparse as ap
2import configparser as cp
3import ftplib as ftp 4import hashlib as hl
5import json
6import logging as lg
A FTP-related module is being imported. FTP is considered insecure. Use SSH/SFTP/SCP or some other encrypted protocol. Consider the following points when using Telnet protocol:
There are several common approaches to addressing these challenges and securing FTP usage. FTPS is an extension of FTP that can encrypt connections at the client’s request. Transport Layer Security (TLS), Secure Socket Layer (SSL), and SSH File Transfer Protocol (also known as Secure File Transfer Protocol or SFTP) are often used as more secure alternatives to FTP because they use encrypted connections.
pysftp
is an easy to use sftp module that utilizes paramiko and pycrypto. It provides a simple interface to sftp. It is recommended to use pysftp
over ftblib
.
import ftplib
url = "ftp://[email protected]"
connection = ftplib.FTP(url) # Sensitive, Using FTP protocol
import pysftp
url = "ftp://[email protected]"
connection = pysftp.Connection(host=url, username=username, password=password)