FTP 用戶端接收整個文件,但總是在完成之前關閉連接

FTP 用戶端接收整個文件,但總是在完成之前關閉連接

在 Windows Server 2008 R2 Standard 電腦上,我在連接到 Windows FTP 伺服器並從其中下載檔案時遇到問題。

文件大小約為 3KB 至 6KB。很少有 ~100KB 到 ~500KB,但伺服器有足夠的磁碟空間。

我嘗試過被動連接:

Response:   220-Microsoft FTP Service
Response:   220 Regal Logistics
Command:    USER ********
Response:   331 Password required for ********.
Command:    PASS ********
Response:   230 User ******** logged in.
Status: Connected
Status: Starting download of /********/PO/201405130227.xml
Command:    CWD /********/PO
Response:   250 CWD command successful.
Command:    TYPE A
Response:   200 Type set to A.
Command:    PASV
Response:   227 Entering Passive Mode (***,***,***,**,19,64)
Command:    RETR 201405130227.xml
Response:   125 Data connection already open; Transfer starting.
Response:   426 Data connection closed. Error scanning content
Error:  File transfer failed after transferring 3,465 bytes in 1 second

奇怪的是,該檔案有 3,465 字節,因此整個檔案都可以通過,只是沒有正確完成。

我嘗試過主動連線:

Response:   220-Microsoft FTP Service
Response:   220 Regal Logistics
Command:    USER ********
Response:   331 Password required for ********.
Command:    PASS ********
Response:   230 User ******** logged in.
Command:    PORT 10,0,0,114,214,65
Response:   200 PORT command successful.
Command:    RETR 201405130227.xml
Response:   150 Opening ASCII mode data connection for 201405130227.xml(3465 bytes).
Response:   426 Data connection closed. Error scanning content

我在同一台伺服器上嘗試了兩個不同的 FTP 用戶端(Filezilla 和 CLI FTP 用戶端),得到了相同的回應:

125 Data connection already open; Transfer starting.
426 Data connection closed. Error scanning content

我嘗試從單獨的網路成功下載文件,因此它對伺服器的位置是唯一的。

我已經聯繫了伺服器所在的系統/網路管理員,並確信 FTP 運行所需的連接埠已開啟。 (我的猜測是他們已經打開了 21,我不確定其他的。)他們的網路上有一個實體防火牆,但不幸的是,我再次無法訪問它。伺服器上的 Windows 防火牆已停用。

我還能看什麼來確定它是否真的失敗了?

這是失敗之前請求的資料包日誌:

No.     Time           Source                Destination                Protocol  Length Info
     39 6.878855000    LOCAL-IP            EXTERNAL-FTP-SERVER-IP        FTP      77     Request: RETR 201405130227.xml

Frame 39: 77 bytes on wire (616 bits), 77 bytes captured (616 bits) on interface 0
Ethernet II, Src: Hewlett-_ab:cd:ef (00:1e:a1:ab:cd:ef), Dst: Watchgua_12:34:56 (ab:cd:7f:12:34:56)
Internet Protocol Version 4, Src: LOCAL-IP (LOCAL-IP), Dst: EXTERNAL-FTP-SERVER-IP (EXTERNAL-FTP-SERVER-IP)
Transmission Control Protocol, Src Port: 56623 (56623), Dst Port: ftp (21), Seq: 55, Ack: 207, Len: 23
File Transfer Protocol (FTP)

No.     Time           Source                Destination                Protocol  Length Info
     40 6.893662000    EXTERNAL-FTP-SERVER-IP        LOCAL-IP            TCP      60     ftp > 56623 [ACK] Seq=207 Ack=78 Win=93362 Len=0

Frame 40: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface 0
Ethernet II, Src: Watchgua_12:34:56 (ab:cd:7f:12:34:56), Dst: Hewlett-_ab:cd:ef (00:1e:a1:ab:cd:ef)
Internet Protocol Version 4, Src: EXTERNAL-FTP-SERVER-IP (EXTERNAL-FTP-SERVER-IP), Dst: LOCAL-IP (LOCAL-IP)
Transmission Control Protocol, Src Port: ftp (21), Dst Port: 56623 (56623), Seq: 207, Ack: 78, Len: 0

No.     Time           Source                Destination                Protocol  Length Info
     41 6.957666000    EXTERNAL-FTP-SERVER-IP        LOCAL-IP            FTP      108    Response: 125 Data connection already open; Transfer starting.

Frame 41: 108 bytes on wire (864 bits), 108 bytes captured (864 bits) on interface 0
Ethernet II, Src: Watchgua_12:34:56 (ab:cd:7f:12:34:56), Dst: Hewlett-_ab:cd:ef (00:1e:a1:ab:cd:ef)
Internet Protocol Version 4, Src: EXTERNAL-FTP-SERVER-IP (EXTERNAL-FTP-SERVER-IP), Dst: LOCAL-IP (LOCAL-IP)
Transmission Control Protocol, Src Port: ftp (21), Dst Port: 56623 (56623), Seq: 207, Ack: 78, Len: 54
File Transfer Protocol (FTP)

No.     Time           Source                Destination                Protocol  Length Info
     42 6.986757000    EXTERNAL-FTP-SERVER-IP        LOCAL-IP            FTP      106    Response: 426 Data connection closed. Error scanning content

Frame 42: 106 bytes on wire (848 bits), 106 bytes captured (848 bits) on interface 0
Ethernet II, Src: Watchgua_12:34:56 (ab:cd:7f:12:34:56), Dst: Hewlett-_ab:cd:ef (00:1e:a1:ab:cd:ef)
Internet Protocol Version 4, Src: EXTERNAL-FTP-SERVER-IP (EXTERNAL-FTP-SERVER-IP), Dst: LOCAL-IP (LOCAL-IP)
Transmission Control Protocol, Src Port: ftp (21), Dst Port: 56623 (56623), Seq: 261, Ack: 78, Len: 52
File Transfer Protocol (FTP)

No.     Time           Source                Destination                Protocol  Length Info
     43 6.986768000    LOCAL-IP            EXTERNAL-FTP-SERVER-IP        TCP      54     56623 > ftp [ACK] Seq=78 Ack=313 Win=65280 Len=0

Frame 43: 54 bytes on wire (432 bits), 54 bytes captured (432 bits) on interface 0
Ethernet II, Src: Hewlett-_ab:cd:ef (00:1e:a1:ab:cd:ef), Dst: Watchgua_12:34:56 (ab:cd:7f:12:34:56)
Internet Protocol Version 4, Src: LOCAL-IP (LOCAL-IP), Dst: EXTERNAL-FTP-SERVER-IP (EXTERNAL-FTP-SERVER-IP)
Transmission Control Protocol, Src Port: 56623 (56623), Dst Port: ftp (21), Seq: 78, Ack: 313, Len: 0

我收集了更多日誌 - 這次我觀察的不僅僅是連接埠 21 和 22 - 我觀察了 FTP 連接的 IP:

    No.     Time           Source                Destination           Protocol Length Info
   2607 11.440148000   __REMOTE__IP__        _LOCAL_IP_            FTP      105    Response: 227 Entering Passive Mode (198,104,198,16,17,233)

Frame 2607: 105 bytes on wire (840 bits), 105 bytes captured (840 bits) on interface 0
Ethernet II, Src: Watchgua_LOCALMAC (AA:BB:CC:LOCALMAC), Dst: Hewlett-_SUB_MAC (11:22:33:SUB_MAC)
Internet Protocol Version 4, Src: __REMOTE__IP__ (__REMOTE__IP__), Dst: _LOCAL_IP_ (_LOCAL_IP_)
Transmission Control Protocol, Src Port: ftp (21), Dst Port: 54613 (54613), Seq: 195, Ack: 60, Len: 51
File Transfer Protocol (FTP)

No.     Time           Source                Destination           Protocol Length Info
   2608 11.440763000   _LOCAL_IP_            __REMOTE__IP__        FTP      74     Request: RETR testthing.txt

Frame 2608: 74 bytes on wire (592 bits), 74 bytes captured (592 bits) on interface 0
Ethernet II, Src: Hewlett-_SUB_MAC (11:22:33:SUB_MAC), Dst: Watchgua_LOCALMAC (AA:BB:CC:LOCALMAC)
Internet Protocol Version 4, Src: _LOCAL_IP_ (_LOCAL_IP_), Dst: __REMOTE__IP__ (__REMOTE__IP__)
Transmission Control Protocol, Src Port: 54613 (54613), Dst Port: ftp (21), Seq: 60, Ack: 246, Len: 20
File Transfer Protocol (FTP)

No.     Time           Source                Destination           Protocol Length Info
   2609 11.441029000   _LOCAL_IP_            __REMOTE__IP__        TCP      66     54617 > 4585 [SYN] Seq=0 Win=65535 Len=0 MSS=1460 WS=128 SACK_PERM=1

Frame 2609: 66 bytes on wire (528 bits), 66 bytes captured (528 bits) on interface 0
Ethernet II, Src: Hewlett-_SUB_MAC (11:22:33:SUB_MAC), Dst: Watchgua_LOCALMAC (AA:BB:CC:LOCALMAC)
Internet Protocol Version 4, Src: _LOCAL_IP_ (_LOCAL_IP_), Dst: __REMOTE__IP__ (__REMOTE__IP__)
Transmission Control Protocol, Src Port: 54617 (54617), Dst Port: 4585 (4585), Seq: 0, Len: 0

No.     Time           Source                Destination           Protocol Length Info
   2610 11.442013000   __REMOTE__IP__        _LOCAL_IP_            TCP      60     ftp > 54613 [ACK] Seq=246 Ack=80 Win=93360 Len=0

Frame 2610: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface 0
Ethernet II, Src: Watchgua_LOCALMAC (AA:BB:CC:LOCALMAC), Dst: Hewlett-_SUB_MAC (11:22:33:SUB_MAC)
Internet Protocol Version 4, Src: __REMOTE__IP__ (__REMOTE__IP__), Dst: _LOCAL_IP_ (_LOCAL_IP_)
Transmission Control Protocol, Src Port: ftp (21), Dst Port: 54613 (54613), Seq: 246, Ack: 80, Len: 0

No.     Time           Source                Destination           Protocol Length Info
   2622 11.459434000   __REMOTE__IP__        _LOCAL_IP_            TCP      66     4585 > 54617 [SYN, ACK] Seq=0 Ack=1 Win=65535 Len=0 WS=2 MSS=1400 SACK_PERM=1

Frame 2622: 66 bytes on wire (528 bits), 66 bytes captured (528 bits) on interface 0
Ethernet II, Src: Watchgua_LOCALMAC (AA:BB:CC:LOCALMAC), Dst: Hewlett-_SUB_MAC (11:22:33:SUB_MAC)
Internet Protocol Version 4, Src: __REMOTE__IP__ (__REMOTE__IP__), Dst: _LOCAL_IP_ (_LOCAL_IP_)
Transmission Control Protocol, Src Port: 4585 (4585), Dst Port: 54617 (54617), Seq: 0, Ack: 1, Len: 0

No.     Time           Source                Destination           Protocol Length Info
   2623 11.459475000   _LOCAL_IP_            __REMOTE__IP__        TCP      54     54617 > 4585 [ACK] Seq=1 Ack=1 Win=4194304 Len=0

Frame 2623: 54 bytes on wire (432 bits), 54 bytes captured (432 bits) on interface 0
Ethernet II, Src: Hewlett-_SUB_MAC (11:22:33:SUB_MAC), Dst: Watchgua_LOCALMAC (AA:BB:CC:LOCALMAC)
Internet Protocol Version 4, Src: _LOCAL_IP_ (_LOCAL_IP_), Dst: __REMOTE__IP__ (__REMOTE__IP__)
Transmission Control Protocol, Src Port: 54617 (54617), Dst Port: 4585 (4585), Seq: 1, Ack: 1, Len: 0

No.     Time           Source                Destination           Protocol Length Info
   2634 11.482207000   __REMOTE__IP__        _LOCAL_IP_            FTP      108    Response: 125 Data connection already open; Transfer starting.

Frame 2634: 108 bytes on wire (864 bits), 108 bytes captured (864 bits) on interface 0
Ethernet II, Src: Watchgua_LOCALMAC (AA:BB:CC:LOCALMAC), Dst: Hewlett-_SUB_MAC (11:22:33:SUB_MAC)
Internet Protocol Version 4, Src: __REMOTE__IP__ (__REMOTE__IP__), Dst: _LOCAL_IP_ (_LOCAL_IP_)
Transmission Control Protocol, Src Port: ftp (21), Dst Port: 54613 (54613), Seq: 246, Ack: 80, Len: 54
File Transfer Protocol (FTP)

No.     Time           Source                Destination           Protocol Length Info
   2635 11.483996000   __REMOTE__IP__        _LOCAL_IP_            FTP-DATA 60     FTP Data: 4 bytes

Frame 2635: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface 0
Ethernet II, Src: Watchgua_LOCALMAC (AA:BB:CC:LOCALMAC), Dst: Hewlett-_SUB_MAC (11:22:33:SUB_MAC)
Internet Protocol Version 4, Src: __REMOTE__IP__ (__REMOTE__IP__), Dst: _LOCAL_IP_ (_LOCAL_IP_)
Transmission Control Protocol, Src Port: 4585 (4585), Dst Port: 54617 (54617), Seq: 1, Ack: 1, Len: 4
FTP Data (test)

No.     Time           Source                Destination           Protocol Length Info
   2636 11.484173000   __REMOTE__IP__        _LOCAL_IP_            FTP      106    Response: 426 Data connection closed. Error scanning content

Frame 2636: 106 bytes on wire (848 bits), 106 bytes captured (848 bits) on interface 0
Ethernet II, Src: Watchgua_LOCALMAC (AA:BB:CC:LOCALMAC), Dst: Hewlett-_SUB_MAC (11:22:33:SUB_MAC)
Internet Protocol Version 4, Src: __REMOTE__IP__ (__REMOTE__IP__), Dst: _LOCAL_IP_ (_LOCAL_IP_)
Transmission Control Protocol, Src Port: ftp (21), Dst Port: 54613 (54613), Seq: 300, Ack: 80, Len: 52
File Transfer Protocol (FTP)

啊 - 所以我們測試了連接到使用非標準控制連接埠的 FTP 伺服器,並且檔案傳輸工作正常。

只有當我們連接到使用標準控制連接埠21的FTP伺服器時,傳輸才會出現問題。


我們清除了防火牆的設置,重建並重置了防火牆上的設置。該問題隨後得到解決。

應用的設定與先前存在的設定相同。防火牆上的設定不​​知何故損壞了。這就是她寫的,真的。

答案1

回應:426 資料連線已關閉。掃描內容出錯

確實其間的防火牆攔截 FTP 流量。據我所知,Microsoft FTP 不支援掃描內容。

需要明確的是:這更多的是中央防火牆比一個東西視窗防火牆事物。

此外,該理論非標準連接埠-工作支持這一點。 (中央防火牆似乎只檢查連接埠 21 的流量)

與您的網路管理員一起解決這個問題。

答案2

基於您收到的「426 資料連線已關閉。掃描內容時發生錯誤」訊息。這看起來可能是網路防火牆掃描病毒。

http://forums.iis.net/t/1105801.aspx?故障排除+FTP+426+錯誤+連線+關閉+傳輸+中止+

相關內容