- Community Home
- >
- Servers and Operating Systems
- >
- Legacy
- >
- Networking
- >
- FTP literal port command getting changed
Networking
1753946
Members
7827
Online
108811
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2006 08:45 AM
12-20-2006 08:45 AM
FTP literal port command getting changed
I am trying to write my own ftp client, and I discovered the following idiosyncrasy on Windows.
First, a digression on the FTP protocol. For an "active" type ftp session, which is the default, for transferring data the ftp client sends a port address to the FTP server, and the server opens a socket back to the client at the specified address. The format of the command is
PORT aa,bb,cc,dd,ee,dd
where aa,bb,cc,dd are the octets of the IP address and ee,dd are the octets of the port. So, if my client was 192.168.124.1 and the port I was using was 2561, I would send
PORT 192,168,124,1,10,1
With a windows FTP client, this command can be sent manually by using the "literal" keyword, as
--
ftp> literal PORT 192,168,124,1,10,1
200 PORT command successful
--
Here's the problem: on certain Windows 2003 systems, the value of the PORT argument is getting changed. If I do a network sniff of the FTP session, I see the following:
--
PORT ww,xx,yy,zz,19,137
PORT ww,xx,yy,zz,19,138
PORT ww,xx,yy,zz,19,139
--
No matter what ports I specify, or what interface I use to specify them (FTP client or custom program) the values that get sent over the network start at 5001 and increment upwards. Sometimes it will skip a value if the port seems to be in use. I cannot find any documentation of this behavior anywhere. There is no proxy software installed on this system that I can find.
The only system that I have observed this on is a Windows 2003 server (32-bit) running IIS 6, with updates as of about October '06. I've tried it on Win2k systems, Win2k3 systems without IIS, and one Win2k3 system with IIS6 but older updates.
This breaks my FTP client, because I have to open a socket and do a bind() on a port, then tell the remote FTP server about it. If the port address that I am sending gets changed in transit, then it will come back on a different port and the connection will fail.
First, a digression on the FTP protocol. For an "active" type ftp session, which is the default, for transferring data the ftp client sends a port address to the FTP server, and the server opens a socket back to the client at the specified address. The format of the command is
PORT aa,bb,cc,dd,ee,dd
where aa,bb,cc,dd are the octets of the IP address and ee,dd are the octets of the port. So, if my client was 192.168.124.1 and the port I was using was 2561, I would send
PORT 192,168,124,1,10,1
With a windows FTP client, this command can be sent manually by using the "literal" keyword, as
--
ftp> literal PORT 192,168,124,1,10,1
200 PORT command successful
--
Here's the problem: on certain Windows 2003 systems, the value of the PORT argument is getting changed. If I do a network sniff of the FTP session, I see the following:
--
PORT ww,xx,yy,zz,19,137
PORT ww,xx,yy,zz,19,138
PORT ww,xx,yy,zz,19,139
--
No matter what ports I specify, or what interface I use to specify them (FTP client or custom program) the values that get sent over the network start at 5001 and increment upwards. Sometimes it will skip a value if the port seems to be in use. I cannot find any documentation of this behavior anywhere. There is no proxy software installed on this system that I can find.
The only system that I have observed this on is a Windows 2003 server (32-bit) running IIS 6, with updates as of about October '06. I've tried it on Win2k systems, Win2k3 systems without IIS, and one Win2k3 system with IIS6 but older updates.
This breaks my FTP client, because I have to open a socket and do a bind() on a port, then tell the remote FTP server about it. If the port address that I am sending gets changed in transit, then it will come back on a different port and the connection will fail.
Trust me, I know what I'm doing
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP