Windows Firewall and secure FTP (FTPS) traffic

SSL traffic will not get any help from the firewall filter for FTP. As a matter of fact it will (most likely) prevent SSL from working. So we have to look for other options on how to enable it.

 

The easiest way to configure Windows Firewall to allow FTPS traffic is to put the NT service for FTP7 on the inbound exception list. The NT Service name is "Microsoft FTP Service" or "ftpsvc". This service is hosted in generic service process host called svchost.exe so it is not possible to put it on the exception list thought the program exception.

 

Warning: FTPSVC service doesn’t listen to any ports other than configured endpoints for ftp sites and data connection ports that are setup for data transfers. But you should double check the listening endpoints for FTPSVC by using netstat –n –a –o. The –o switch allows listing the process ID (or PID) of the listening process. Find out the PID for FTPSVC and check the listening endpoints.

 

The following 4 steps will allow both non-secure and SSL FTP traffic through firewall.

 

1) FTPSVC service has to get tagged with FTPSVC service SID. It is new security feature introduced for Vista / Windows 2008. "Microsoft FTP Publishing Service for IIS 7.0 RC0" doesn’t have service SID enabled by default so the following command line has to be run to enable service SID.

 

sc sidtype ftpsvc unrestricted

 

Note: Changing of sidtype will not be necessary in future releases of Microsoft FTP Publishing Service for IIS 7.0 after RC0 release

 

2) Restart ftpsvc service for the previous step to take effect

 

net stop ftpsvc & net start ftpsvc

 

3) Setup Windows Firewall to allow "ftpsvc" service to listen on all ports it opens.

 

netsh advfirewall firewall add rule name="FTP for IIS7" service=ftpsvc action=allow protocol=TCP dir=in

 

4) Make sure that FTP filter for Windows Firewall is disabled

 

netsh advfirewall set global Statefulftp disable

 

Warning: Do not use active FTP connections with SSL if client is behind NAT. It will not work.

 

参考地址:http://blogs.iis.net/jaroslad/archive/2007/09/29/windows-firewall-setup-for-microsoft-ftp-publishing-service-for-iis-7-0.aspx

 

修改时间 2018-08-28

真诚赞赏,手留余香
赞赏
随机推荐
PHP网页授权获取用户基本信息
一文看懂npm、yarn、pnpm之间的区别
FTP over TLS加密传输 Filezilla
使用Keytools生成安卓证书
PM2 负载均衡
Javascript检测字符串是否为汉字
Windows 下 Apache 添加多个PHP版本
ThinkPHP 5.0 原生查询分页
PHP 如何防止 CSRF 跨站域请求伪造
npm install sharp 安装太卡