`
Jony.Hwong
  • 浏览: 114969 次
  • 来自: ...
社区版块
存档分类
最新评论

SSL FTP through the firewall using FileZilla

阅读更多
SSL FTP through the firewall using FileZilla
I've confirmed that the firewall is the issue here. I can make the SSL FTP connection, but when FileZilla tries to do a directory listing, it's blocked because that (random) port isn't open. When I try the connection behind the firewall, everything's hunky dory.

Has anyone else experienced this, and if you did, were you able to get past it?
******************************************************************************

Normally, FTP control connection is on port 21. Though, there's another port that's sometimes used for SSL FTP. (but, not always!)

In active FTP, the "origin" (or "source") port number for data connections should always be 20 -- so if that's allowed through your firewall, you should be okay.

Unfortunately, many people will read my previous statement and assume that I mean something different from what I just said. Whenever you make a TCP connection (regardless of what application protocol you're using) there's always TWO ports involved. There's the origin port (the port used by the program that's originating the connection) and the destination port (the port that it's connecting to.)

Normally, we don't give much thought to the origin port. Usually, the firewalls are configured according to the destination port. That would be port 21 for FTP control channel, port 23 for telnet, port 80 for HTTP, etc. These are the well-known port numbers. Normally the origin port is selected by the operating system at random, and it's not used, certainly never used in a firewall configuration.

However, FTP is one exception. FTP's data channels, when in ACTIVE mode, will always have an ORIGIN of 20, and use a random port for the destiantion. That's backwards of the way everything else works! But, you SHOULD be able to configure your firewall so that anything that's going FROM port 20 on the Internet, to a random port on your network is allowed. (As opposed to the normal circumstance of FROM a random port on your network TO a fixed port on the Internet )

Unfortunately, I only know for sure that plain-text FTP works that way, I don't know for sure that SSL FTP works that way, but I would assume so. (You should be able to tell by looking at the connection statuses)

The more common alternative (which I already suggested) is to allow ALL outgoing connections from your network, but only block incoming ones. In that scenario, passive mode will work just fine.

Note that if you're using NAT, the passive mode solution will work, but the active mode (port 20) solution WON'T because NAT will re-map the IP addresses and ports, which will confuse FTP. A good NAT implementation will sniff the packets looking for the port number being sent, and will change it in the TCP packets as well, but this doesn't work with SSL because of the encryption.

So if you're using NAT, you'll want to use passive mode, and allow all outgoing connections from your firewall.

I guess the final alternative is to figure out the range of ephemeral ports that IBM uses in their FTP software, and open them all through your firewall. I know that FreeBSD (a free variant of Unix, much like Linux) lets you control what the ephemeral port range is -- but as far as I know, IBM doesn't let you control that in i5/OS, nor do they tell you what the range is. So that's hard to work with.

This is one reason why so many people use SSH or HTTP instead of FTP/SSL for sending secure documents. This port number business really messes up firewalls.

******************************************************************************
You might also be interested in the following APAR from IBM:

Abstract
FTP Clear Command Channel

Error Description
With the support of FTP using SSL/TLS, a NAT firewall can no   
longer look at/change the information passed on an FTP control 
connection.                                                   

Problem Summary
With the support of FTP using SSL/TLS, a NAT firewall can no   
longer look at/change the information passed on an FTP control 
connection.                                                   

Problem Conclusion
FTP client subcommand CCC                                     
                                                              
FTP supports two kinds of transmission modes: the clear text   
mode and the encrypted mode. If you use the clear text mode in 
an FTP control connection, you take the risk of exposing your 
sensitive information to an intruder. If you use the encrypted 
mode, the firewall is not able to monitor or change the       
information sent within the FTP control connection. Thus the   
firewall cannot perform some functions such as network address 
translation.                                                   
                                                              
The Clear Command Channel (CCC) subcommand changes the         
transmission mode in a control connection from the encrypted   
mode to the clear text mode. Thus, you can secure sensitive   
information including your user name and password by sending   
them in the encrypted mode in the control connection. Then you 
can use the CCC subcommand to change to clear text mode to     
send the port and IP information.                             
                                                              
Note: After using the CCC subcommand, you will send all your   
information in the clear text mode in the control connection. 
If the names of files or directories on your system contain   
sensitive information, be aware that any names sent on the     
control connection after running the CCC subcommand are not   
protected. However, the data connection transmission mode     
remains intact and the data transfer that happens afterward is 
still secure.                                                 
                                                              
Customers can either allow or disallow an individual user to use
                                                              
CCC by granting the private authority to                       
QIBM_QTMF_CLIENT_REQ_10                                       
via the CHGFCNUSG command or via iSeries Navigator Application 
Administration support.                                       
                                                              
For example:                                                   
CHGFCNUSG FCNID(QIBM_QTMF_CLIENT_10) USER(user) USAGE(*ALLOWED)
                                                              
FTP Server Subcommand CCC                                     
                                                              
When FTP server receives a Clear Command Channel (CCC)         
subcommand,                                                   
it first checks whether or not the current user has the       
authority                                                     
to perform the CCC command. If the user has the authority, it 
then                                                           
accepts the command by sending a confirm message back to the FTP
                                                              
client                                                         
side, then the FTP server changes the transmission mode in a   
control                                                       
connection from the encrypted mode to the clear text mode.     
                                                              
The Clear Command Channel (CCC) subcommand changes the         
transmission mode                                             
in a control connection from the encrypted mode to the clear   
text mode.                                                     
Thus, you can secure sensitive information including your user 
name and                                                       
password by sending them in the encrypted mode in the control 
connection.                                                   
Then you can use the CCC subcommand to change to the clear text
                                                              
mode and                                                       
send the port and IP information.                             
                                                              
Security Concerns:                                             
                                                              
Note that there are potential security/integrity exposures with
                                                              
using the CCC approach as compared to full encryption of the   
control                                                       
connection.                                                   
                                                              
First, this results in file and directory names on the FTP     
server to be subject to interception. It is possible that such 
names                                                         
themselves could contain sensitive or confidential information.
                                                              
Second, IP address/port information transferred on the control 
connection is subject to interception by hackers.             
                                                              
Finally, some other "direct" TCP attacks on an FTP server, or 
using an FTP server to attack other systems, are completely   
eliminated when a secure control connection                   
is used. Some of those are now again possible when the         
control connection                                             
reverts to "clear" mode.                                       
                                                              
Because of these concerns, usage of the CCC subcommand is     
controlled using the i5/OS Function Usage interface, and the   
default setting for                                           
CCC is *DENIED for the FTP server.                             
                                                              
To allow an individual user logged into the FTP server to use 
the CCC subcommand for ending protection of the control       
connection, give *ALLOWED                                     
usage to the QIBM_QTMF_SERVER_REQ_10 function via the CHGFCNUSG
                                                              
command or                                                     
iSeries Navigator Application Administration support. For     
example:                                                       
                                                              
CHGFCNUSG FCNID(QIBM_QTMF_SERVER_REQ_10)  USER(user)           
USAGE(*ALLOWED)                                               
                                                              
To allow all users to perform this function, change the default
                                                              
authority of this function to *ALLOWED.                       
                                                              
RFC 4217 Securing FTP with TLS, talks about Clear Command     
Channel.    


It discusses the CCC FTP Command that can be used to disable encryption so that NAT can see the port numbers and adjust them accordingly. (With the obvious drawback that encryption has been turned off, and therefore the filenames and stuff like that are visible unencrypted).

It provides a PTF for V5R4 that enables this CCC command -- which isn't available in i5/OS, otherwise.

(Though, since you're using FileZilla, you might look to see if FileZilla already supports CCC)
Reply With Quote 
分享到:
评论

相关推荐

    2024华为OD机试D卷 - 最多购买宝石数目 - 免费看解析和代码.html

    私信博主免费获取真题解析以及代码

    华为OD机试D卷 - 小朋友来自多少小区 - 免费看解析和代码.html

    私信博主免费获取真题解析以及代码

    C51单片机的示例-课程实验-LCD1602基础开发库-内含源码和说明书.zip

    C51单片机的示例-课程实验-LCD1602基础开发库-内含源码和说明书.zip

    毕业设计 基于Python+Django+itemCF和userCF算法音乐推荐系统源码+详细文档+全部数据资料 高分项目

    【资源说明】 毕业设计 基于Python+Django+itemCF和userCF算法音乐推荐系统源码+详细文档+全部数据资料 高分项目 【备注】 1、该项目是高分毕业设计项目源码,已获导师指导认可通过,答辩评审分达到95分 2、该资源内项目代码都经过测试运行成功,功能ok的情况下才上传的,请放心下载使用! 3、本项目适合计算机相关专业(如软件工程、计科、人工智能、通信工程、自动化、电子信息等)的在校学生、老师或者企业员工下载使用,也可作为毕业设计、课程设计、作业、项目初期立项演示等,当然也适合小白学习进阶。 4、如果基础还行,可以在此代码基础上进行修改,以实现其他功能,也可直接用于毕设、课设、作业等。 欢迎下载,沟通交流,互相学习,共同进步!

    setuptools-51.3.1-py3-none-any.whl

    Python库是一组预先编写的代码模块,旨在帮助开发者实现特定的编程任务,无需从零开始编写代码。这些库可以包括各种功能,如数学运算、文件操作、数据分析和网络编程等。Python社区提供了大量的第三方库,如NumPy、Pandas和Requests,极大地丰富了Python的应用领域,从数据科学到Web开发。Python库的丰富性是Python成为最受欢迎的编程语言之一的关键原因之一。这些库不仅为初学者提供了快速入门的途径,而且为经验丰富的开发者提供了强大的工具,以高效率、高质量地完成复杂任务。例如,Matplotlib和Seaborn库在数据可视化领域内非常受欢迎,它们提供了广泛的工具和技术,可以创建高度定制化的图表和图形,帮助数据科学家和分析师在数据探索和结果展示中更有效地传达信息。

    基于python实现通过摄像头进行手势识别并进行控制vrep仿真机械臂+源码+文档(高分优秀项目)

    基于python实现通过摄像头进行手势识别并进行控制vrep仿真机械臂+源码+文档,适合毕业设计、课程设计、项目开发。项目源码已经过严格测试,可以放心参考并在此基础上延申使用~ 项目简介: 通过摄像头进行手势识别,控制vrep仿真机械臂 anaconda 环境部署: conda create -n py37 python=3.7 pip install opencv-python conda install tensorflow==1.13.1 conda install keras==2.2.4 conda install matplotlib pip install imutils 程序介绍: label.py 采集,制作标签数据集 model.py 定义模型 train.py 模型训练 test.py 测试手势识别结果 main.py 控制机械臂主程序 vrep.py, vrepConst.py, remoteApi.so : vrep 为 windows 提供的官方接口 puma560.ttt vrep机械臂

    setuptools-42.0.0.zip

    Python库是一组预先编写的代码模块,旨在帮助开发者实现特定的编程任务,无需从零开始编写代码。这些库可以包括各种功能,如数学运算、文件操作、数据分析和网络编程等。Python社区提供了大量的第三方库,如NumPy、Pandas和Requests,极大地丰富了Python的应用领域,从数据科学到Web开发。Python库的丰富性是Python成为最受欢迎的编程语言之一的关键原因之一。这些库不仅为初学者提供了快速入门的途径,而且为经验丰富的开发者提供了强大的工具,以高效率、高质量地完成复杂任务。例如,Matplotlib和Seaborn库在数据可视化领域内非常受欢迎,它们提供了广泛的工具和技术,可以创建高度定制化的图表和图形,帮助数据科学家和分析师在数据探索和结果展示中更有效地传达信息。

    setuptools-1.3.zip

    Python库是一组预先编写的代码模块,旨在帮助开发者实现特定的编程任务,无需从零开始编写代码。这些库可以包括各种功能,如数学运算、文件操作、数据分析和网络编程等。Python社区提供了大量的第三方库,如NumPy、Pandas和Requests,极大地丰富了Python的应用领域,从数据科学到Web开发。Python库的丰富性是Python成为最受欢迎的编程语言之一的关键原因之一。这些库不仅为初学者提供了快速入门的途径,而且为经验丰富的开发者提供了强大的工具,以高效率、高质量地完成复杂任务。例如,Matplotlib和Seaborn库在数据可视化领域内非常受欢迎,它们提供了广泛的工具和技术,可以创建高度定制化的图表和图形,帮助数据科学家和分析师在数据探索和结果展示中更有效地传达信息。

    毕业设计 基于Python+Flask的知识图谱的推荐系统,音乐领域知识图谱3MKG源码+详细文档+全部数据资料 高分项目

    【资源说明】 毕业设计 基于Python+Flask的知识图谱的推荐系统,音乐领域知识图谱3MKG源码+详细文档+全部数据资料 高分项目 【备注】 1、该项目是高分毕业设计项目源码,已获导师指导认可通过,答辩评审分达到95分 2、该资源内项目代码都经过测试运行成功,功能ok的情况下才上传的,请放心下载使用! 3、本项目适合计算机相关专业(如软件工程、计科、人工智能、通信工程、自动化、电子信息等)的在校学生、老师或者企业员工下载使用,也可作为毕业设计、课程设计、作业、项目初期立项演示等,当然也适合小白学习进阶。 4、如果基础还行,可以在此代码基础上进行修改,以实现其他功能,也可直接用于毕设、课设、作业等。 欢迎下载,沟通交流,互相学习,共同进步!

    Python环形数组.docx

    环形数组

    Jira敏捷开发.pdf

    Jira敏捷开发.pdf

    十六进制转浮点数.vi

    十六进制转浮点数.vi

    华为OD机试D卷 - 掌握的单词个数 - 免费看解析和代码.html

    私信博主免费获取真题解析以及代码

    setuptools-32.2.0.zip

    Python库是一组预先编写的代码模块,旨在帮助开发者实现特定的编程任务,无需从零开始编写代码。这些库可以包括各种功能,如数学运算、文件操作、数据分析和网络编程等。Python社区提供了大量的第三方库,如NumPy、Pandas和Requests,极大地丰富了Python的应用领域,从数据科学到Web开发。Python库的丰富性是Python成为最受欢迎的编程语言之一的关键原因之一。这些库不仅为初学者提供了快速入门的途径,而且为经验丰富的开发者提供了强大的工具,以高效率、高质量地完成复杂任务。例如,Matplotlib和Seaborn库在数据可视化领域内非常受欢迎,它们提供了广泛的工具和技术,可以创建高度定制化的图表和图形,帮助数据科学家和分析师在数据探索和结果展示中更有效地传达信息。

    MP4拖入压制,支持多文件拖入,可压缩至原体积的5%-20%基本无损

    MP4拖入压制,支持多文件拖入,可压缩至原体积的5%-20%基本无损,采用GCC编译,可略微增加压缩速度

    setuptools-3.6.tar.gz

    Python库是一组预先编写的代码模块,旨在帮助开发者实现特定的编程任务,无需从零开始编写代码。这些库可以包括各种功能,如数学运算、文件操作、数据分析和网络编程等。Python社区提供了大量的第三方库,如NumPy、Pandas和Requests,极大地丰富了Python的应用领域,从数据科学到Web开发。Python库的丰富性是Python成为最受欢迎的编程语言之一的关键原因之一。这些库不仅为初学者提供了快速入门的途径,而且为经验丰富的开发者提供了强大的工具,以高效率、高质量地完成复杂任务。例如,Matplotlib和Seaborn库在数据可视化领域内非常受欢迎,它们提供了广泛的工具和技术,可以创建高度定制化的图表和图形,帮助数据科学家和分析师在数据探索和结果展示中更有效地传达信息。

    2024华为OD机试D卷 - 最大矩阵和 - 免费看解析和代码.html

    私信博主免费获取真题解析以及代码

    setuptools-50.2.0-py3-none-any.whl

    Python库是一组预先编写的代码模块,旨在帮助开发者实现特定的编程任务,无需从零开始编写代码。这些库可以包括各种功能,如数学运算、文件操作、数据分析和网络编程等。Python社区提供了大量的第三方库,如NumPy、Pandas和Requests,极大地丰富了Python的应用领域,从数据科学到Web开发。Python库的丰富性是Python成为最受欢迎的编程语言之一的关键原因之一。这些库不仅为初学者提供了快速入门的途径,而且为经验丰富的开发者提供了强大的工具,以高效率、高质量地完成复杂任务。例如,Matplotlib和Seaborn库在数据可视化领域内非常受欢迎,它们提供了广泛的工具和技术,可以创建高度定制化的图表和图形,帮助数据科学家和分析师在数据探索和结果展示中更有效地传达信息。

    华为OD机试D卷 - 手机App防沉迷系统 - 免费看解析和代码.html

    私信博主免费获取真题解析以及代码

    卡通海洋0.0.5 凑11

    1,uv偏移 2,海岸线 3,海面透明度设置 4,海岸线噪音纹理(变体Shader) 5,海浪形变

Global site tag (gtag.js) - Google Analytics