Issue
The curl
application is a command line tool that is used to transfer data with support for many different protocols. Since curl supports SSL connections, it is an efficient way to download files from an FTP server running over SSL.
Resolution
FTP servers can run in implicit or explicit mode.
- In
implicitmode, the client connects to a dedicated port where SSL connections are always provided without being requested. - In
explicitmode, the client initially connects via the traditional insecure port of 21 and then requests the secured SSL connection from the server.
List the files if the FTP server is running in implicit mode:
curl --verbose --ftp-ssl --user 'stark' --cipher 'DEFAULT:!DH' ftps://example.com:990
Download files if the FTP server is running in implicit mode:
curl --verbose --ftp-ssl --user 'stark' --cipher 'DEFAULT:!DH' ftps://example.com:990/auditd.md -o ~/audit.md
List the files if the FTP server is running in explicit mode:
curl --verbose --ftp-ssl --user 'bella' --cipher 'DEFAULT:!DH' ftp://example.com
Download files if the FTP server is running in explicit mode:
curl --verbose --ftp-ssl --user 'bella' --cipher 'DEFAULT:!DH' ftp://example.com/image.png -o ~/image.png
NOTE: You will be prompted to enter the host password for the user.