FTPでのデータ転送について(vsFTPd)

前回のvsFTPd版です。


-環境-
Server:10.0.0.100/24 (Window7 IIS7.5-FTP7.5)
HostA :10.0.0.10/24
HostB :10.0.1.10/24

PORTコマンドに対する、デフォルトの設定でのvsFTPd 2.3.0の動作(HostA→Server)


PORT 10,0,0,10,0,80
500 Illegal PORT command.

PORT 10,0,0,10,3,255
500 Illegal PORT command.

PORT 10,0,0,10,4,0
200 PORT command successful. Consider using PASV.
NLST
150 Here comes the directory listing.
226 Directory send OK.

PORT 10,0,0,10,255,255
200 PORT command successful. Consider using PASV.
NLST
150 Here comes the directory listing.
226 Directory send OK.


PORT 10,0,1,10,0,80
500 Illegal PORT command.

PORT 10,0,1,10,3,255
500 Illegal PORT command.

PORT 10,0,1,10,4,0
500 Illegal PORT command.

PORT 10,0,1,10,255,255
500 Illegal PORT command.


IIS-FTPと同じ動作ですね。(レスポンスコードは違いますが・・)


Manpage of VSFTPD_CONF

このページを見ると、port_promiscuousをYESにするとPORTコマンドのセキュリティチェックを無効にできる、
とあるので、試しにvsftpd.confにport_promiscuous=YESを追加。

port_promiscuous=YES時のvsFTPdの動作


PORT 10,0,0,10,0,80
200 PORT command successful. Consider using PASV.
NLST
500 OOPS: Illegal port request
500 OOPS: priv_sock_get_cmd

PORT 10,0,0,10,3,255
200 PORT command successful. Consider using PASV.
NLST
500 OOPS: Illegal port request
500 OOPS: child died

PORT 10,0,0,10,4,0
200 PORT command successful. Consider using PASV.
NLST
500 OOPS: vsf_sysutil_bind
500 OOPS: child died

PORT 10,0,0,10,255,255
200 PORT command successful. Consider using PASV.
NLST
500 OOPS: vsf_sysutil_bind
500 OOPS: child died


PORT 10,0,1,10,0,80
200 PORT command successful. Consider using PASV.
NLST
500 OOPS: Illegal port request
500 OOPS: priv_sock_get_cmd

PORT 10,0,1,10,3,255
200 PORT command successful. Consider using PASV.
NLST
500 OOPS: Illegal port request
500 OOPS: child died

PORT 10,0,1,10,4,0
200 PORT command successful. Consider using PASV.
NLST
500 OOPS: vsf_sysutil_bind
500 OOPS: child died

PORT 10,0,1,10,255,255
200 PORT command successful. Consider using PASV.
NLST
500 OOPS: vsf_sysutil_bind
500 OOPS: child died


こんな風に上で弾かれていたPORTコマンドは通るのですが、
データ転送の時に
500 OOPS:
が返ってきてコネクションが切断されます。
色々と調べても解決できなかったので今回は断念・・


このPORTコマンドのように、FTPサーバの実装にあたっての諸注意ってあるのかなーと思ってたら、
RFC2577で触れられているんですね。

IPAの和訳もありました。
FTP Security Considerations