FTP port stays open after disconnect and termination of TCMD

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
Bjorn
Junior Member
Junior Member
Posts: 12
Joined: 2003-04-21, 15:25 UTC
Location: Norway

FTP port stays open after disconnect and termination of TCMD

Post by *Bjorn »

Hi. My OS is Win2k Pro SP3, TCMD ver 5.51 - 18.02.03. Personal licence.

I notice a minor FTP issue that might or might not be worthy of your
concern, I simply don't know. Not sure if this is a problem or a
feature: After disconnecting from a FTP server, and even after
shutting down TCMD completely, my firewall (Outpost PRO) tells me TCMD
still keeps an open port (although no data is transferred!).

I have tried this with more than one connection, and the same happens.
I don't know if this is a possible security risk or not, or if it can
cause problems for other applications, or if it is meant to be that
way? Copy below of log from Outpost Pro, notice uptime 15 hours...

Application: TOTALCMD.EXE
Local Port: 1670
LocalAdress: LocalHost
Protocol: TCP
Start time: 04/23/2003 05:21:41
Remote port: FTPDATA
Remote Host ftp.rfc-editor.org
uptime: 15:21:51
sendt: 0 bytes
Received: 0 bytes 0
bps: 0


I have loop-back set to "allowed" in Outpost, so everything is OK as
far as that goes. And as said, no data seems to leave my computer after
I disconnect the FTP session in TCMD - so no problem there either.
But... to the best of my knowledge (I am not a programmer!) shouldn't
TCMD release the local port after session is terminated?

Notice: After I shut down TCMD Outpost still reports the port open,
but when I click the application (TCMD) in Outpost, it reports:
"Application for this connection can not be found. Unable to create a
rule." Only when I log off my user account on my Win2k system - or reboot, does the port release.

Again thank you for a truly wonderful program! I recommended it
where ever I go :-)...

All the best,
Bjorn
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

I checked my code - I don't leave any ports open! This can happen, however, if a server doesn't reply, or if the firewall is blocking the FIN package. Then the port will stay open until the time_wait timeout runs out.
Author of Total Commander
https://www.ghisler.com
Bjorn
Junior Member
Junior Member
Posts: 12
Joined: 2003-04-21, 15:25 UTC
Location: Norway

Post by *Bjorn »

[quote="ghisler(Author)"]I checked my code - I don't leave any ports open! This can happen, however, if a server doesn't reply, or if the firewall is blocking the FIN package. Then the port will stay open until the time_wait timeout runs out.[/quote]


You are probably right - I don't speak TCP my self, to me a FIN is a guy from Finland! :-). I did a search on FIN package and TCP;

<http://www.freesoft.org/CIE/Course/Section4/11.htm>

1) The user initiates by telling the TCP to CLOSE the connection
2) The remote TCP initiates by sending a FIN control signal
3) Both users CLOSE simultaneous

Ah I see. I performed several connections with the same result the other day, after logging off my system account in between to release the port again, so I guess it must have been my connection/router/system/firewall that for some reason was unable to receive the FIN(s) from the remote FTP host. I retried some of those connections (same remote hosts) now, and no problem, port closed the moment I disconnected in TCMD. I verfired this both visa firwall log and doing a NETSTAT -AN before, during and after the connect.

All the best,
Bjorn
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Sometimes when a connection is bad you may be losing a lot of packets - try pinging the other host, and you may get 50% packet loss or so. In such a case the final package may never arrive, so the connection will 'hang' until a timeout occurs, and then the port will be closed. The port will also be closed when TC is closed by the user.
Author of Total Commander
https://www.ghisler.com
Post Reply