[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Iptable + ftp + ssh



On Wed, Jul 25, 2001 at 01:36:53PM -0300, Eduardo Damato wrote:
> 
> Bonjour à tous,
> Salut,
> 
> Ce truc est très interressant, mais je crois qu'il ne va pas fonctioner,
> pour le ftp, même si vouz ajoutez une régle pour la port 20. Le problème
> du ftp est qu'il emploi la port 20 pour obtenir les requisitions et aussi
> le login, mais pour faire la transf. il utilise la port 21. Donc le
> serveur fait SYN avec -sport 21 dans votre ordinateur, et ce SYN ne sera
> pas accepté. La mieux sortie est avoir un "stateful filter", mais n'est-ce
> pas le cas de IPTABLES. malheuresement.

Et bien:
root@tass:igor:-> iptables -L
Chain INPUT (policy DROP)
target     prot opt source               destination         
ACCEPT     all  --  anywhere             anywhere           
ACCEPT     icmp --  anywhere             anywhere           
ACCEPT     tcp  --  anywhere             anywhere           tcp flags:!SYN,RST,ACK/SYN 
ACCEPT     tcp  --  anywhere             anywhere           tcp spt:domain 
ACCEPT     udp  --  anywhere             anywhere           udp spt:domain 
ACCEPT     tcp  --  anywhere             anywhere           tcp dpt:ssh 
ACCEPT     tcp  --  anywhere             anywhere           tcp dpt:smtp 
ACCEPT     igmp --  anywhere             anywhere           
block      all  --  anywhere             anywhere           
LOG        all  --  anywhere             anywhere           LOG level warning 

Chain FORWARD (policy DROP)
target     prot opt source               destination         

Chain OUTPUT (policy DROP)
target     prot opt source               destination         
ACCEPT     all  --  anywhere             anywhere           
ACCEPT     all  --  anywhere             anywhere           

Chain block (1 references)
target     prot opt source               destination         
ACCEPT     all  --  anywhere             anywhere           state RELATED,ESTABLISHED 
ACCEPT     all  --  anywhere             anywhere           state NEW 
DROP       all  --  anywhere             anywhere           
root@tass:igor:-> ncftp
NcFTP 3.0.3 (April 15, 2001) by Mike Gleason (ncftp@ncftp.com).
ncftp> show all
anon-password                  NcFTP@
auto-ascii                     |.txt|.asc|.html|.htm|.css|.xml|.ini|.sh|.pl|.hqx|.cfg|.c|.h|.cpp|.hpp|.bat|.m3u|.pls|
auto-resume                    no
autosave-bookmark-changes      no
confirm-close                  yes
connect-timeout                20
control-timeout                135
logsize                        10240
pager                          more
passive                        off
progress-meter                 2 (statbar)
redial-delay                   20
save-passwords                 ask
show-status-in-xterm-titlebar  no
so-bufsize                     0 (use system default)
xfer-timeout                   3600
yes-i-know-about-NcFTPd        no
ncftp> o ftp.uk.debian.org
Connecting to 195.224.53.39...                                                  
ProFTPD 1.2.0pre10 Server (ProFTPD) [open.hands.com]
Logging in...                                                                   
Anonymous access granted, restrictions apply.
Logged in to ftp.uk.debian.org.                                                 
ncftp / > ls
debian/            ftp.gnu.org/       upload/
debian-pkgpool/    pub/
ncftp / > show passive
passive                        off
ncftp / > 


Donc ça marche ;-) 
Et je pense que l'option --state d'iptables permet de faire du stateful
filter

> Pardon pour mon français très pauvre.

Ho non, merci à vous de faire l'effort de parler en français

-- 
Igor Genibel -- http://www.genibel.org -- http://people.debian.org/~igenibel
Debian: igenibel@debian.org		       Tuxfamily: igor@tuxfamily.org
			   Freedom For Everyone
 08:03:20 up 5 days, 12:23,  8 users,  load average: 0.05, 0.04, 0.00



Reply to: