CPUG

The Check Point User Group

A Resource For The Check Point Community.  Fast.  Useful.  Independent.

1. Come to CPUG CON 2008 EUROPE in Switzerland on September 8th - 9th!
    Two days full of technical content for Check Point administrators in the beautiful Swiss Alps!
    We already have sign-ups from twelve different countries!
2. CCSA/CCSE One-Week Dual-Certification Training Course with CPUG in San Francisco!
    Courses Starting 7/14, 8/25, 10/6, 11/3, 12/8, (2009) 1/19, 2/9, 3/9, 4/6, 5/4, 6/8, 7/6, 8/3, 9/7.
3. Corrent S3500 SecureXL Turbocards For Sale - Last Six Remaining - Get Your Spares!
4. Join Us On LinkedIn - We now have a CPUG group.


Go Back   CPUG: The Check Point User Group > Check Point Firewall-1/VPN-1 And Related Products > Services
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 2005-08-13
BarryStiefel BarryStiefel is offline
Administrator
 
Join Date: 2005-08-11
Location: San Francisco, CA
Posts: 539
Rep Power: 10
BarryStiefel has disabled reputation
Default How does Passive FTP work?

How does Passive FTP work?



Regular FTP works like this:
  • Client connects to FTP Server on Port 21 (the "control" connection)
  • Client initiates a command that requires data (e.g. ls, file xfer)
  • Server opens a TCP session from itself (source port 20) to the Client

Where the client and server are only impeded by packet filters, this works fine. When FTPing through an application proxy, it is usually required that the client initiate the connection to the FTP server, not the other way around. This is also arguably more secure.

Aside from firewalls, some FTP applications (like web browsers) are designed to only use Passive mode FTP because they may use application proxies.

Passive Mode FTP works like this:
  • Client connects to FTP Server on Port 21 (the "control" connection).
  • Client tells FTP Server it wants to perform transfers in PASV mode and issues a PASV command to the remote side.
  • Server sends back the port it is listening on as part of the response.
  • Client initiates a command that requires data to the port specified in the response to the PASV request (e.g. ls, file xfer).

To summarize: the only real difference between regular and passive FTP is who opens the data connection.

Can I see an example of this?



Note: The following came from a usenet post by Brian Wheeler of Raptor Systems. You will need to use two telnet commands to simulate passive FTP,one for the control channel and one for the data channel. 1. In one window, set up the control channel and issue the PASV command to make the server listen on a random port.>>> telnet ftp.company.com 21 Trying 1.2.3.4... Connected to ftp.company.com. Escape character is '^]'. 220 ftp FTP server ready.>>> USER anonymous 331 Guest login ok, send your complete e-mail address as password.>>> PASS shorty@marian.creighton.edu 230 Guest login ok, access restrictions apply.>>> PASV 227 Passive mode entered (1,2,3,4,128,1)2. In a second window, set up the data channel (the port number to use is encoded in the "227 Passive mode entered" response). Take the last two numbers ("128" and "1" in the above example), multiply the first by 256 and add the second (128 * 256 + 1 = 32768 + 1 = 32769).>>> telnet ftp.company.com 32769 Trying 1.2.3.4... Connected to ftp.company.com. Escape character is '^]'.3. Go back to the first window and issue your data transfer command. ... PASS shorty@marian.creighton.edu 230 Guest login ok, access restrictions apply. PASV 227 Passive mode entered (1,2,3,4,128,1)>>> LIST 150 Opening ASCII mode data connection for file list. 226 Transfer complete.4. The second window will receive the data for the command (a list of files in the above example). RETR commands work similarly, as do STOR commands (except that you provide instead of receive the data for a STOR). telnet ftp.company.com 32769 Trying 1.2.3.4... Connected to ftp.company.com. Escape character is '^]'. dr-xr-xr-x 2 root sys 512 Jun 25 20:30 . dr-xr-xr-x 2 root sys 512 Jun 25 20:30 .. dr-x--x--x 2 root sys 512 Jun 25 20:30 bin dr-x--x--x 2 root sys 512 Jun 25 20:30 dev dr-x--x--x 2 root sys 512 Jun 25 20:30 etc dr-xr-xr-x 2 root sys 512 Jun 25 20:30 pub dr-x--x--x 2 root sys 512 Jun 25 20:30 usr Connection closed by foreign host. 5. Close the control channel. ... PASV 227 Passive mode entered (1,2,3,4,128,1) LIST 150 Opening ASCII mode data connection for file list. 226 Transfer complete.>>> QUIT 221 Goodbye. Connection closed by foreign host.Note: The FTP Protocol is defined by RFC 959.



-- PhoneBoy - 11 Jan 2004

FAQForm FAQs.Class: MiscellaneousFAQs FAQs.OS: FAQs.Version:
Reply With Quote
  #2 (permalink)  
Old 2006-04-16
georgethomas georgethomas is offline
Junior Member
 
Join Date: 2006-04-16
Posts: 1
Rep Power: 0
georgethomas has an average reputation (10+)
Default Re: How does Passive FTP work - Non-standard port

I could not get it to work with FTP usning non-standard ports (5555 for control and 5554 for data). I tried it for both Standard and Passive FTP. Any suggestion on how to configure the firewall? I am using Checkpoint NG.
Any help is very much appreciated.
Reply With Quote
  #3 (permalink)  
Old 2006-04-17
kva.kva kva.kva is offline
Senior Member
 
Join Date: 2006-01-26
Location: Moscow, Russia
Posts: 706
Rep Power: 3
kva.kva has an average reputation (10+)
Default Re: How does Passive FTP work?

Select "Protocol Type" FTP or FTP-PASV in properties service of control connection.

http://secureknowledge.checkpoint.co....do?id=skI2754
Reply With Quote
  #4 (permalink)  
Old 2007-06-05
wicked wicked is offline
Junior Member
 
Join Date: 2007-03-09
Location: Singapore
Posts: 19
Rep Power: 0
wicked has an average reputation (10+)
Default Re: How does Passive FTP work?

Thanks for the quick education on this subject. This was very helpful.
__________________
CEH, CCSE, CISSP
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -7. The time now is 14:27.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.0.0