LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 01-11-2006, 04:10 AM   #1
Sir_Limpalot
LQ Newbie
 
Registered: Jan 2006
Location: Norway
Distribution: Debian
Posts: 18

Rep: Reputation: 0
ftp from msdos


Hello all.
I'm having a problem with ftp from a custom system at a client that uses ftp to get som files from suppliers.
The new firewall is obviously stopping it as it wasn't a problem before.
I've tried ftp-connections with firefox, msie, smartftp and lftp and they all work, the only place I can replicate the problem is with the ftp-client in dos (or windows cmd).
I've allso tried purging all rules and setting policy to accept on all chains, still the same problem...
Anyone have any good ideas?

If you do: Thanx a lot, I'm stuck...

Sturla

ps. ip_conntrack_ftp is loaded, allthough I don't think it should matter when defaulting to ACCEPT
 
Old 01-11-2006, 05:03 AM   #2
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
Ftp.exe is not a real ftp client, it only does a subset of the ftp protocol : It uses Active Mode , while IE uses PASSIVE mode.
It can't switch to passive mode.

If your side is well configured (Firewall+NAT+Ftp_conntrack) then Passive will work.

If they HAVE to use active ftp then they need a clean configuration like you. I guess they are using NAT and/or a FW and that they are not Active-FTP-aware.

What is happening could be:
-> They send you their internal IP adress (192.168.... for example.. security leak) and obviously you can't connect to it.
-> They send you their real IP ( their internal is internet-global or they have a NAT that understands FTP) BUT they don't open the port.

Can they make a dir on ftp.oreilly.com for example, using ftp.exe? I guess not, so its not your fault, its their..

They have to correct their configuration OR use a command line FTP client that does PASSIVE mode.

Last edited by nx5000; 01-11-2006 at 05:10 AM.
 
Old 01-11-2006, 05:05 AM   #3
live_dont_exist
Member
 
Registered: Aug 2004
Location: India
Distribution: Redhat 9.0,FC3,FC5,FC10
Posts: 257

Rep: Reputation: 30
So..if its working in all other places why do you want to ftp through DOS??
I mean surely if the FTP server's accepting connections through browsers the port is open ; so its not a firewall problem at all either on the client or the server or the firewall its something to do with CMD.

What I fail to understand is if you can connect through a FTP client which already has GUI's inbuilt you can get/put files through it ..cant you?...why do u need CMD at all?

Maybe Im missing something...can you please clarify?

Cheers
Arvind
p.s...I know theres a graphical frontend for ssh which allows you get and put files..u might want to try googling on those lines if thats what you mean

Wait ..here it is : http://winscp.net/eng/download.php

Last edited by live_dont_exist; 01-11-2006 at 05:10 AM.
 
Old 01-11-2006, 05:09 AM   #4
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
Quote:
Originally Posted by live_dont_exist
So..if its working in all other places why do you want to ftp through DOS??
"The client (customer) is the king" but you're right, they should use a REAL ftp program.
 
Old 01-11-2006, 05:40 AM   #5
live_dont_exist
Member
 
Registered: Aug 2004
Location: India
Distribution: Redhat 9.0,FC3,FC5,FC10
Posts: 257

Rep: Reputation: 30
Quote:
Originally Posted by nx5000
What is happening could be:
-> They send you their internal IP adress (192.168.... for example.. security leak) and obviously you can't connect to it.
-> They send you their real IP ( their internal is internet-global or they have a NAT that understands FTP) BUT they don't open the port.
So firstly ..Is there any way to force FTP to happen in Passive mode??...

Secondly r u saying that if A is sitting on Client 192.168.0.1 and wants to FTP to 202.x.x.x he will do something like ftp>open 202.x.x.x , the firewall NAT rules take over and the 202.x.x.x IP will now be Xlated to a 192.x.x.x ...thus allowing the connection to proceed...so since Client A and the remote machine are on the same 192.x.x.x network shouldnt it work??

And since the browser is able to connect though ftp doesnt it mean ftp (21) is open on the Firewall or is it that FTP(Active) and FTP(Passive) are assigned 20 and 21 ..I remember 2 ports assigned for FTP in that list.

Can u clarify my doubts?
Cheers
Arvind
 
Old 01-11-2006, 06:37 AM   #6
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
Quote:
Originally Posted by live_dont_exist
So firstly ..Is there any way to force FTP to happen in Passive mode??...
Should be
Code:
quote pasv
to put the server in passive mode (and the client who interprets the "Entering PASV" should know that it has to switch to passive)
But does not work... ftp.exe for me is a toy, it uses active only while passive is the most common.

Quote:
Secondly r u saying that if A is sitting on Client 192.168.0.1 and wants to FTP to 202.x.x.x he will do something like ftp>open 202.x.x.x , the firewall NAT rules take over and the 202.x.x.x IP will now be Xlated to a 192.x.x.x ...thus allowing the connection to proceed...so since Client A and the remote machine are on the same 192.x.x.x network shouldnt it work??
I think here your are mixing things : There are two different things
-> The IP header of a packet . Source IP and Destination IP.
-> The Data part of a packet . In active mode, the client will send PORT 192,168,0,1,4,1. Which means, hey you, connect on me (192.168.0.1) on port 4*256+1=1025.
So the Network packet will be:
Code:
Source IP:192.168.0.1
Destination IP:202.1.1.1
Source port: we don't care say 2000
Destination port:21
Data : Port 192,168,0,1,4,1
When the NAT device on the client sees an FTP packet (it recognizes it because destination port is 21), it looks in THE DATA of the packet, it sees 192,168,0,1,4,1 and translates it to the REAL (accessible from Internet) IP adress.
becomes:

Code:
Source IP:IP of the NAT device , ex : 201.1.1.1
Destination IP:202.1.1.1
Source port: 2000
Destination port:21
Data : Port 201,1,1,1,4,1
The server will acknowledge the packet to 201.1.1.1:2000 and then open a connection to 201.1.1.1 :1025

I'm very bad at explaining things
Have a look here (this guy should give me some money I've given his link hundred of times)
http://slacksite.com/other/ftp.html

Now you may wonder why we put in the DATA part the IP of the client.
This is because FTP can be used to do FXP (and nasty stealth scanning or Denial of Service also): The client A ask server B to send the data to client C.
www.faqs.org/rfcs/rfc959.html

Maybe begin to understand how NAT works, then how FTP works and then how both works.

Happy
 
Old 01-11-2006, 08:21 AM   #7
Sir_Limpalot
LQ Newbie
 
Registered: Jan 2006
Location: Norway
Distribution: Debian
Posts: 18

Original Poster
Rep: Reputation: 0
Hi folks and thanks for all suggestions...
Just to clarify: I don't use ftp.exe, neither would I ever make a system that does, but the client has a server-app that does, closed source... So there's nothing I can do about that....
I'll try to google a litte more for active ftp...
 
Old 01-11-2006, 08:27 AM   #8
Sir_Limpalot
LQ Newbie
 
Registered: Jan 2006
Location: Norway
Distribution: Debian
Posts: 18

Original Poster
Rep: Reputation: 0
Hmmmm, I feel kinda stupid right now, I just needed to

modprobe ip_nat_ftp

Thought I just needed ip_conntrack_ftp, oh well, we live and learn don't we?

Thanx again for all suggestions and sollutions
 
Old 01-11-2006, 09:19 AM   #9
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
Quote:
Originally Posted by Sir_Limpalot
Hmmmm, I feel kinda stupid right now, I just needed to

No problem, I'm also here to learn. Anyway it also helped someone else.
 
Old 01-13-2006, 12:54 AM   #10
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 69
Sir_Limpalot
Please do not post your question more than once in the forums. As a new LQer, I suggest you check the site rules:
http://www.linuxquestions.org/linux/rules.html
 
Old 01-13-2006, 05:37 AM   #11
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,292

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
It just might be you can grab a copy of arachne (the dos browser - don't laugh) and that
might get your customer in with an interface he can manage.

Those were the days... nobody knew what multitasking was, '640k was enough memory for anyone- ever'
according to Bill Gates ...etc.
 
Old 01-13-2006, 07:47 AM   #12
Sir_Limpalot
LQ Newbie
 
Registered: Jan 2006
Location: Norway
Distribution: Debian
Posts: 18

Original Poster
Rep: Reputation: 0
About cross-posting: Sorry, won't happen again
 
  


Reply



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 On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
msdos/vfat Rum Linux - General 5 11-05-2014 09:02 AM
ftp from msdos Sir_Limpalot Linux - Networking 3 01-17-2006 02:16 PM
Can't read msdos floppy Oh Cisco Debian 7 01-18-2005 03:07 PM
booting linux via msdos linuxmandrake Linux - Newbie 3 11-15-2004 06:13 PM
MSDOS, Samba, Printing John Lenin Linux - Software 3 04-05-2004 04:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 03:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration