Re: Active FTP PORT command - port number



Barry,

The question was regarding PORT command in ACTIVE FTP mode.

In active mode FTP the client connects from a random unprivileged port
(N > 1023) to the FTP server's command port, port 21. Then, the client
starts listening to port N+1 and sends the FTP command PORT N+1 to the
FTP server. The server will then connect back to the client's
specified data port from its local data port, which is port 20.

Where does the number of a random unprivileged port come from?

Thanks,
Alona

On Jan 28, 9:42 am, Barry Margolin <bar...@xxxxxxxxxxxx> wrote:
In article <1169954472.299107.148...@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,

a...@xxxxxxxxxxxx wrote:
Hello All,

The PORT request has a parameter in the form

h1,h2,h3,h4,p1,p2

meaning that the client is listening for connections on TCP port
p1*256+p2 at IP address h1.h2.h3.h4.

Where p1 and p2 numbers are coming from? Are there any ftp
configuration files?The FTP server normally asks the stack to find an unused port number and
bind the socket to it. It will change from connection to connection.

--
Barry Margolin, bar...@xxxxxxxxxxxx
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***

.



Relevant Pages

  • RE: Telnet/ftp problems SBS2000
    ... Please make sure your client computers are configured as both Firewall ... will find two options "Enable folder view for FTP sites" and "Use Passive ... that the control connection has been successfully established, ... (other than port 21) ...
    (microsoft.public.windows.server.sbs)
  • FTP transfer port
    ... FTP transfer port ... the FTP server "listens" for client connections on its port 21. ... it will establish a separate control connection and data connection with ...
    (bit.listserv.ibm-main)
  • Re: Hacked? External address knocks on internal private address...
    ... The important part of your message is that FTP is allowed out... ... You open a connection to an FTP Server and logon. ... When you ask the server for a file the server issues a "PORT" command ... so it can open a port on the firewall to allow the incoming Data ...
    (comp.security.firewalls)
  • Re: Question: FTP via alternate port
    ... The problem with FTP is that it requires two ports to operate. ... FTP command stream in order to dynamically open that port for the data ... Ideally the attacker would want to upload another tool onto the ...
    (Pen-Test)
  • Re: Internet Explorer Keeps Timing out on FTP
    ... > This is a problem with the FTP client. ... When the PORT command is used, the FTP client is asking the FTP server to ...
    (microsoft.public.inetserver.iis.ftp)