Security and Cryptography
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationSecurity and Cryptography

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 10th, 2005, 04:34 PM
danworld danworld is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 13 danworld User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 56 m 19 sec
Reputation Power: 0
Question Anon FTP on an IPFW Firewall?

Hey,

I'm trying to get an anonymous ftp server (wu-ftp) to work with an IPFW Firewall.

I enabled port 21, but that only enables access if you directly specify port 21 when connecting, but when you try to access ftp anonymously from a web browser, it is blocked because wu-ftp seems to be using random server ports to connect.

Do anyone know how to get around this or to configure wu-ftp correctly so that it only uses port 21 even for anonymous ftp?

Any help would be greatly appreciated.

Dan

Reply With Quote
  #2  
Old May 11th, 2005, 07:00 AM
mitakeet's Avatar
mitakeet mitakeet is offline
Last Day: May 28, 2005
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Jul 2003
Location: Maryland
Posts: 4,575 mitakeet User rank is Sergeant (500 - 2000 Reputation Level)mitakeet User rank is Sergeant (500 - 2000 Reputation Level)mitakeet User rank is Sergeant (500 - 2000 Reputation Level)mitakeet User rank is Sergeant (500 - 2000 Reputation Level)mitakeet User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 9 h 51 m 4 sec
Reputation Power: 21
I am sure the problem is in setting up the actual data stream. The browser is NOT going to try to connect on a random port, it will only attempt to connect on the standard FTP port unless otherwise configured. However, in the standard FTP protocol, the DATA is transmitted on a separate port specific to that particular connection which is basically chosen at random from a range of high ports; the control communication remains on the original connection. If you have all other ports blocked then naturally it will be unable to transmit data and will drop the connection. There are several work-arounds for this, though the specifics escape me. There is a command clients can give to most FTP servers to specify a particular port, I suspect you can configure the server to respond with a particular port as opposed to a random port and configure your firewall to handle that port. You may also be able to specify a range and free that range up in the firewall. Check your server documentation.
__________________

Left DevShed May 28, 2005. Reason: Unresponsive administrators.
Free code: http://sol-biotech.com/code/.
Secure Programming: http://sol-biotech.com/code/SecProgFAQ.html.
Performance Programming: http://sol-biotech.com/code/PerformanceProgramming.html.

It is not that old programmers are any smarter or code better, it is just that they have made the same stupid mistake so many times that it is second nature to fix it.
--Me, I just made it up

The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man.
--George Bernard Shaw

Reply With Quote
  #3  
Old May 11th, 2005, 08:43 AM
juniperr juniperr is offline
network dude
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Dec 2003
Posts: 1,679 juniperr User rank is Second Lieutenant (5000 - 10000 Reputation Level)juniperr User rank is Second Lieutenant (5000 - 10000 Reputation Level)juniperr User rank is Second Lieutenant (5000 - 10000 Reputation Level)juniperr User rank is Second Lieutenant (5000 - 10000 Reputation Level)juniperr User rank is Second Lieutenant (5000 - 10000 Reputation Level)juniperr User rank is Second Lieutenant (5000 - 10000 Reputation Level)juniperr User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 21 h 55 m 2 sec
Reputation Power: 85
Quote:
it will only attempt to connect on the standard FTP port unless otherwise configured.


By default web browsers are enabled for passive FTP which meens if the FTP server is passive it will go to random ports by deafualt starting at 1024+n. This is to bypass firewalls. turn off passive mode in the browser and open ports 20 FTP data port and 21 set the ftp server for active FTP.

read my responses to this post http://forums.devshed.com/t248493/s.html

and especialy look at the link I gave for active vurses passive FTP.

which is here FTP MODES

Last edited by juniperr : May 11th, 2005 at 08:47 AM.

Reply With Quote
  #4  
Old May 11th, 2005, 05:27 PM
danworld danworld is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 13 danworld User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 56 m 19 sec
Reputation Power: 0
Thanks for all your help.

I was able to fix the issue that I mentioned by adding these lines to my ipfw.conf:

allow tcp from any to any 21 keep-state setup
allow tcp from any to any 2000-2099 keep-state setup


And by adding this line to wu-ftp's ftpaccess file:

passive ports 0.0.0.0/0 2000 2099

Since I'm running an anonymous file upload server, do I really need to have active ftp enabled? Most of our users upload through the web and some through ftp clients, which all/most use passive ftp.

The strange thing is even though port 20 isn't enabled. I'm still able to connect using an ftp client using the active mode. How is this possible? How can I test if it's truly active mode?

Dan

Reply With Quote
  #5  
Old May 12th, 2005, 08:25 AM
juniperr juniperr is offline
network dude
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Dec 2003
Posts: 1,679 juniperr User rank is Second Lieutenant (5000 - 10000 Reputation Level)juniperr User rank is Second Lieutenant (5000 - 10000 Reputation Level)juniperr User rank is Second Lieutenant (5000 - 10000 Reputation Level)juniperr User rank is Second Lieutenant (5000 - 10000 Reputation Level)juniperr User rank is Second Lieutenant (5000 - 10000 Reputation Level)juniperr User rank is Second Lieutenant (5000 - 10000 Reputation Level)juniperr User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 21 h 55 m 2 sec
Reputation Power: 85
port 20 is just a data port you should be able to connect but error during file transfers. you should see when you connect in the ftp client what ports you have connections on.

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationSecurity and Cryptography > Anon FTP on an IPFW Firewall?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT