ftp server issue, trying to DL 1.2.7a
Anyone else having this problem?
Connected to ftp.iptables.org (62.128.28.62).
220 ProFTPD 1.2.5rc1 Server (netfilter/iptables FTP site) [kashyyyk] Name (ftp.iptables.org:root): anonymous
331 Anonymous login ok, send your complete email address as your password. Password:
230 Anonymous access granted, restrictions apply.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> dir
227 Entering Passive Mode (62,128,28,62,182,53).
thanks
Rob
I got passed it....DLed on win2k and burned to cdr. After extracting patch-o-matic/2.4.19/1.2.7a...i am running the patch-o-matic script and:
# ./runme pending KERNEL_DIR=/usr/src/linux ERROR: Invalid option KERNEL_DIR=/usr/src/linux
The kernel is extracted to /usr/src/linux, i changed the name from linux-2.4.19 to linux for ease of remembering. I am SSH'ing into my box and i copied the line directly from the README to the commandline via Putty so i know i am not making a typing mistake, also i am using tab to get the directory of the kenel on the line so that isnt a mistake of a path either. Any thoughts?
Rob
Quoted 13 lines · Rob
Anyone else having this problem?
Connected to ftp.iptables.org (62.128.28.62).
220 ProFTPD 1.2.5rc1 Server (netfilter/iptables FTP site) [kashyyyk] Name (ftp.iptables.org:root): anonymous
331 Anonymous login ok, send your complete email address as your password. Password:
230 Anonymous access granted, restrictions apply.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> dir
227 Entering Passive Mode (62,128,28,62,182,53).
Works fine for me in active mode:
drwxr-xr-x 2 ftpuser ftpgroup 4096 Jul 22 14:45 incoming drwxr-xr-x 7 ftpuser ftpgroup 4096 Jul 24 07:36 pub
But like you, I can't get a listing in passive mode.....
Antony.
Signature · 1 line
This email was created using 100% recycled electrons.
Quoted 1 line · Rob
Anyone else having this problem?
Yes. I seem to have the same problem. Passive mode hangs and active mode says "Connection refused".
Definitely a firewalling problem. Did they forget to load the ftp conntrack module?
Ramin
Quoted 16 lines
Connected to ftp.iptables.org (62.128.28.62).
220 ProFTPD 1.2.5rc1 Server (netfilter/iptables FTP site) [kashyyyk] Name (ftp.iptables.org:root): anonymous
331 Anonymous login ok, send your complete email address as your password. Password:
230 Anonymous access granted, restrictions apply.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> dir
227 Entering Passive Mode (62,128,28,62,182,53).thanks
Rob
No go on passive from here either,
set passive off,
transfer is fine...
Quoted 20 lines · On 2002.09.05 13:29 Rob wrote:
Anyone else having this problem?
Connected to ftp.iptables.org (62.128.28.62).
220 ProFTPD 1.2.5rc1 Server (netfilter/iptables FTP site) [kashyyyk] Name (ftp.iptables.org:root): anonymous
331 Anonymous login ok, send your complete email address as your password.
Password:
230 Anonymous access granted, restrictions apply.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> dir
227 Entering Passive Mode (62,128,28,62,182,53).thanks
Rob
I've had this issue back in the ipchains days. :)
Its quite simple. If you make iptables change your destination IP for a certain port (like the module for FTP used to do in 2.2) well passive does not work because it changes your IP address on the fly. If you have made a port work for active, passive will not work on that same port.
I dont think there is any workaround (yet). It is a pain, because if you want to FTP and FXP from a port X, you'll have to stay in passive mode.
-------Original Message-------
From: Antony Stone
Date: Thursday, September 05, 2002 14:56:10
To: [email protected]
Subject: Re: ftp server issue, trying to DL 1.2.7a
Quoted 13 lines · Rob
Anyone else having this problem?
Connected to ftp.iptables.org (62.128.28.62).
220 ProFTPD 1.2.5rc1 Server (netfilter/iptables FTP site) [kashyyyk] Name (ftp.iptables.org:root): anonymous
331 Anonymous login ok, send your complete email address as your password. Password:
230 Anonymous access granted, restrictions apply.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> dir
227 Entering Passive Mode (62,128,28,62,182,53).
Works fine for me in active mode:
drwxr-xr-x 2 ftpuser ftpgroup 4096 Jul 22 14:45 incoming drwxr-xr-x 7 ftpuser ftpgroup 4096 Jul 24 07:36 pub
But like you, I can't get a listing in passive mode.....
Antony.
Signature · 4 lines
This email was created using 100% recycled electrons. .
Quoted 7 lines · Rob
I got passed it....DLed on win2k and burned to cdr. After extracting patch-o-matic/2.4.19/1.2.7a...i am running the patch-o-matic script and:
# ./runme pending KERNEL_DIR=/usr/src/linux ERROR: Invalid option KERNEL_DIR=/usr/src/linux [...] Any thoughts?
Sure,
try
# KERNEL_DIR=/usr/src/linux ./runme pending
or
# export KERNEL_DIR=/usr/src/linux; ./runme pending
Bash isn't quite like make and in your command example it will try to feed KERNEL_DIR=/usr/src/linux to ./runme and not take it as an env variable like it should (-:
Have a nice day,
Fabrice.
--
Fabrice MARIE
Senior R&D Engineer
Celestix Networks
http://www.celestix.com/
"Silly hacker, root is for administrators"
-Unknown
Quoted 3 lines · Rob
ftp> dir
227 Entering Passive Mode (62,128,28,62,182,53).
As alot of others replies the problem is when ftp enters passive mode, the server initiates a dataconnection to your machine.
Fortunatly, is a "port" command is send first over the command channel,
in order to let the client and server know how and where this new connection will be established.
This can be caught by the netfilter code, and netfilter can allow this connection to be accepted from the server in a quite clever way, because netfilter is _statefull_. ipchans was not, and hence this was not possible.
The following gives an example of how netfilter can handle this:
Lets assume that you are sittin behind a iptables firewall doing nat,
and all you want is to allow users from the inside (eth0) to conenct to the internet through the external link (ppp0)
# First load the heper modules for the ftp protocol connection tracking. # Delete these lines, if the modules are compiled statically into the
# kernel. modprobe ip_conntrack_ftp # And the nat part for the ftp protocol. modprobe ip_nat_ftp
# Set default policies.
iptables -P INPUT drop
iptables -P FORWARD drop
iptables -P OUTPUT accept
# NAT all connections
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUEADE
# Allow the mashine to make any kind of connections. iptables -A INPUT -m state --state ESTABLISHED,RELATED \
-j ACCEPT
# Allow the same for machines located behind the firewall. iptables -A FORWARD -i eth0 -o ppp0 -j ACCEPT iptables -A FORWARD -o eth0 -i ppp0 -m state \
--state ESTABLISHED,RELATED -j ACCEPT
And we are all done. The trick is to use the 'state' match. The RELATED
state will match the first packet in the data-connection from the ftp-server in passive mode. Any packets hereafter will be in the ESTABLISHED state.
As you might have noticed, there is no protocol speicifer. So this also works for e.g. DNS lookups (udp) and ICMP packets related to an already esablished connection. Statefull firewalling is just sooo great.
There is no reason for you to patch the kernel in order to do this, this has been possible for a long time.
Regards
Anders Fugmann
Signature · 3 lines
Author of FIAIF FIAIF Is An Intelligent Firewall http://fiaif.fugmann.dhs.org
FTP Issues, round 2.
With further testing, I've noticed that it doesnt quite work. For some unknown reason, it *seems* to work on port 21, but doesnt on other ports. From what I understood in your post, you said it would work on any port. (FTP, of course).
9/7/2002 8:31:12 AM PORT 192,168,0,1,4,131
9/7/2002 8:31:12 AM 200-FXP transfer: from 208.58.49.10 to 192.168.0.1 9/7/2002 8:31:12 AM 200 PORT command successful
9/7/2002 8:31:12 AM LIST
9/7/2002 8:31:13 AM 425 Could not open data connection to port 1155: No route to host
The address does not get filtered (that FTP has automatic FXP detection.. if the IP in the PORT command differs from the IP of the person that connected to the FTP, it assumes its a FXP transfer.)
That was on port 8989.
On the other hand, port 21 is fine:
9/7/2002 8:35:11 AM PORT 192,168,0,1,4,137
9/7/2002 8:35:11 AM 200 PORT command successful.
9/7/2002 8:35:11 AM LIST
9/7/2002 8:35:11 AM Data Connection opened.
9/7/2002 8:35:11 AM 150 Opening ASCII mode data connection for file list. 9/7/2002 8:35:11 AM 226-Transfer complete.
9/7/2002 8:35:11 AM 370 bytes transferred in 00:00:00, 370 bytes/sec
Any ideas?
Charles
-------Original Message-------
From: Anders Fugmann
Date: Friday, September 06, 2002 6:30:59 AM
To: Rob
Cc: [email protected]
Subject: Re: ftp server issue, trying to DL 1.2.7a
Quoted 3 lines · Rob
ftp> dir
227 Entering Passive Mode (62,128,28,62,182,53).
As alot of others replies the problem is when ftp enters passive mode, the server initiates a dataconnection to your machine.
Fortunatly, is a "port" command is send first over the command channel, in order to let the client and server know how and where this new connection will be established.
This can be caught by the netfilter code, and netfilter can allow this connection to be accepted from the server in a quite clever way, because netfilter is _statefull_. ipchans was not, and hence this was not possible.
The following gives an example of how netfilter can handle this:
Lets assume that you are sittin behind a iptables firewall doing nat, and all you want is to allow users from the inside (eth0) to conenct to the internet through the external link (ppp0)
# First load the heper modules for the ftp protocol connection tracking. # Delete these lines, if the modules are compiled statically into the
# kernel. modprobe ip_conntrack_ftp # And the nat part for the ftp protocol. modprobe ip_nat_ftp
# Set default policies.
iptables -P INPUT drop
iptables -P FORWARD drop
iptables -P OUTPUT accept
# NAT all connections
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUEADE
# Allow the mashine to make any kind of connections. iptables -A INPUT -m state --state ESTABLISHED,RELATED \
-j ACCEPT
# Allow the same for machines located behind the firewall. iptables -A FORWARD -i eth0 -o ppp0 -j ACCEPT iptables -A FORWARD -o eth0 -i ppp0 -m state \
--state ESTABLISHED,RELATED -j ACCEPT
And we are all done. The trick is to use the 'state' match. The RELATED state will match the first packet in the data-connection from the ftp-server in passive mode. Any packets hereafter will be in the ESTABLISHED state.
As you might have noticed, there is no protocol speicifer. So this also works for e.g. DNS lookups (udp) and ICMP packets related to an already esablished connection. Statefull firewalling is just sooo great.
There is no reason for you to patch the kernel in order to do this, this has been possible for a long time.
Regards
Anders Fugmann
Signature · 7 lines
Author of FIAIF FIAIF Is An Intelligent Firewall http://fiaif.fugmann.dhs.org .
Quoted 4 lines · wickedsun
FTP Issues, round 2.
With further testing, I've noticed that it doesnt quite work. For some unknown reason, it *seems* to work on port 21, but doesnt on other
Seems or does?
Quoted 3 lines
ports. From what I understood in your post, you said it would work on any port. (FTP, of course).
No. The ftp connection tracking module only monitors on port 21. Because it has to examine all packets beeing send though, it would simple be too much work to monitor any connection made. If you want it to monitor other ports also, you can compile the ftp connection tracking as a module, and then use:
modprobe ip_conntrack_ftp 21,5006
to let it listen on ports 21 and 5006.
I do not know if there is any way to make this work with ftp_connection_tracking statically compiled in the kernel.
Regards
Anders Fugmann
Signature · 3 lines
Author of FIAIF FIAIF Is An Intelligent Firewall http://fiaif.fugmann.dhs.org
Ahh yes, that makes sense. It's behaving like the old ip_masq_ftp module. Thanks for the info, again ;)
Charles
-------Original Message-------
From: Anders Fugmann
Date: Saturday, September 07, 2002 10:27:31 AM
To: wickedsun
Cc: [email protected]
Subject: Re: ftp server issue, trying to DL 1.2.7a
Quoted 5 lines · wickedsun
FTP Issues, round 2.
With further testing, I've noticed that it doesnt quite work. For some unknown reason, it *seems* to work on port 21, but doesnt on other
Seems or does?
Quoted 4 lines
ports. From what I understood in your post, you said it would work on any port. (FTP, of course).
No. The ftp connection tracking module only monitors on port 21. Because it has to examine all packets beeing send though, it would simple be too much work to monitor any connection made. If you want it to monitor other ports also, you can compile the ftp connection tracking as a module, and then use:
modprobe ip_conntrack_ftp 21,5006
to let it listen on ports 21 and 5006.
I do not know if there is any way to make this work with ftp_connection_tracking statically compiled in the kernel.
Regards
Anders Fugmann
Signature · 7 lines
Author of FIAIF FIAIF Is An Intelligent Firewall http://fiaif.fugmann.dhs.org .
You need to add the parameter name:
in this case ports.
modprobe ip_conntrack_ftp ports=21,5006
modprobe ip_nat_ftp ports=21.5006
or if built into the kernel, I don't believe you can pass a port parameter to the the module. (Just a quick glance at the source ... so if I'm wrong someone will hit me over the head I'm sure).
Quoted 25 lines · On 2002.09.07 09:18 Anders Fugmann wrote:
Quoted 3 lines · wickedsun
FTP Issues, round 2.
With further testing, I've noticed that it doesnt quite work. For
some unknown reason, it *seems* to work on port 21, but doesnt on otherSeems or does?
Quoted 3 lines
ports. From what I understood in your post, you said it would work on any port. (FTP, of course).
No. The ftp connection tracking module only monitors on port 21. Because it has to examine all packets beeing send though, it would simple be too much work to monitor any connection made. If you want it to monitor other ports also, you can compile the ftp connection tracking as a module, and then use:
modprobeip_conntrack_ftp21,5006
to let it listen on ports 21 and 5006.I do not know if there is any way to make this work with
ftp_connection_trackingstatically compiled in the kernel.Regards
Anders FugmannSignature · 3 lines
Author of FIAIF FIAIF Is An Intelligent Firewall http://fiaif.fugmann.dhs.org