dellthinker
October 29th, 2007, 02:56 PM
Hi all. Im trying to create a FTP client. So far i have the first two commands down correct, and thats the USER/PASS commands. However the PORT and PASV commands im having serious trouble with.
Im hoping someone here is skilled enough to answer all my questions and not refer me to pages i've already been to like this (http://faqs.org/rfcs/rfc959.html) one among many many other pages.
Ok so i ran Wireshark to see exactly what was going on in the ftp client when it sends a file. First thing i noticed was that it sent this message:
16 18.419699 10.23.2.2 66.1.499.32 FTP Request: PORT 10,23,2,2,8,85
Then following that it sent the actual file:
18 18.432565 10.23.2.2 67.1.332.34 FTP Request: STOR file.txt
Then a bunch of other messages followed:
19 18.436742 67.1.332.34 10.23.2.2 TCP ftp-data > 2133 [SYN] Seq=0 Len=0 MSS=1460 TSV=5949368 TSER=0 WS=0
Now what im trying to understand is the following...
21 18.439802 67.1.332.34 10.23.2.2 FTP Response: 150 Connecting to port 2115
I know that port 21 is for commands, and port 20 is for sending data. But it says 2115? Is this supposed to be a random port? Reason why i ask is because im trying to make something that falls in line with the FTP rules.
Mind everyone i did this all on MS-DOS FTP client to keep it simple. I also noticed while sniffing that when PORT was sent it looked like this...
PORT 10,23,2,2,8,85
10.23.2.2 is my local IP on my machine i know this. But what does 8,85 represent?
Any help in this matter would be very appreciated. Thanx in advance!
Im hoping someone here is skilled enough to answer all my questions and not refer me to pages i've already been to like this (http://faqs.org/rfcs/rfc959.html) one among many many other pages.
Ok so i ran Wireshark to see exactly what was going on in the ftp client when it sends a file. First thing i noticed was that it sent this message:
16 18.419699 10.23.2.2 66.1.499.32 FTP Request: PORT 10,23,2,2,8,85
Then following that it sent the actual file:
18 18.432565 10.23.2.2 67.1.332.34 FTP Request: STOR file.txt
Then a bunch of other messages followed:
19 18.436742 67.1.332.34 10.23.2.2 TCP ftp-data > 2133 [SYN] Seq=0 Len=0 MSS=1460 TSV=5949368 TSER=0 WS=0
Now what im trying to understand is the following...
21 18.439802 67.1.332.34 10.23.2.2 FTP Response: 150 Connecting to port 2115
I know that port 21 is for commands, and port 20 is for sending data. But it says 2115? Is this supposed to be a random port? Reason why i ask is because im trying to make something that falls in line with the FTP rules.
Mind everyone i did this all on MS-DOS FTP client to keep it simple. I also noticed while sniffing that when PORT was sent it looked like this...
PORT 10,23,2,2,8,85
10.23.2.2 is my local IP on my machine i know this. But what does 8,85 represent?
Any help in this matter would be very appreciated. Thanx in advance!