Batch Beta
Please Login to get full access and to disable ads.

Thanks to awestom for removing those ads!

Staff Selections are closed! Thanks for participating!
Welcome to the new admins and mods!
About the ads, yeah. We reached our 250'th post and the ads kicked on. In order to disable them I need to purchase a ad removal feature. Now, I don't have credits and in order to get one I need donations. Thanks

You are not connected. Please login or register

Quick FTP Tut

Go down  Message [Page 1 of 1]

1 Quick FTP Tut on Thu Jan 13, 2011 2:33 pm

-xPloit

avatar
Moderators
Moderators
FTP stands for File Transfer Protocol and it is a very handy tool that can be used to send and receive files.

Typing ftp /? into cmd we get this:

Transfers files to and from a computer running an FTP server service (sometimes called a daemon). FTP can be used interactively.

FTP [-v] [-d] [-i] [-n] [-g] [-s:filename] [-a] [-A] [-x:sendbuffer] [-r:recvbuffer] [-b:asyncbuffers] [-wwindowsize] [host]

-v Suppresses display of remote server responses
-n Suppresses auto-login upon initial connection
-i Turns off interactive prompting during multiple file transfers.
-d Enables debugging
-g Disables filename globbing (see LOB command)
-s:filename Specifies a text file containing FTP commands; the commands will automatically run after FTP starts
-a Use any local interface when binding data connection
-A Login as anonymous
-x:send sockbuf Overrides the default SO_SNDBUF size of 8192
-r:recv sockbuf Overrides the default SO_RCVBUF size of 8192
-b:async count Overrides the default async count of 3
-w:windowsize Overrides the default transfer buffer size of 65536
hose specifies the host name or IP address of the remote host to connect to

Notes:
- mget and mput commands take y/n/q for yes/no/qui
- Use control-C to abort commands

As you can see, FTP can get complicated...but it doesn't need to be. The only switches that I use are [-v] [-s] and [host]. And they are very easy to use, so that's what this tut will be about.

First, you need to get an FTP host. The two that I use are XtreemHost (http://www.xtreemhost.com) and DriveHQ (http://www.drivehq.com). Both of these are free and it takes only a few minutes to sign up. There are lots of others out there, and they all work the same, so it doens't matter what you have. I will be using DHQ in this example.

-v is the first switch I said I used. It doesn't really need any explaining. All is does is hide the feedback/messages that the server gives you. It reduces clutter and let me stay focused on what I'm doing, so that's why I use it. But it's completely up to you if you want to use it or not.

-s:filename is a great way to do this automatically, rather than making yourself have to repeat the process multiple times. Basically, what you do with this switch is, you write all of the instructions into a .txt file and then point CMD to that txt file.

Example:
Code:

echo open ftp.drivehq.com>ftp.txt
echo *UsernameGoesHere*>>ftp.txt
echo *PasswordGoesHere*>>ftp.txt
echo binary>>ftp.txt
echo cd BBTest>>ftp.txt
echo get testFile.exe>>ftp.txt
echo bye>>ftp.txt
ftp -s:ftp.txt

I'll break each line in the above example down and explain what it does.

open ftp.drivehq.com -- tells the computer to open an ftp connection with drivehq.com

The *username* and *password* lines login to your account, each line seperated

Binary is a method of data transfer in the FTP. I'm not exactly sure what it does differently than the standard method, but I've noticed a few corrupt files (mainly when they are .exe) if I don't turn binary on. So, I have gotten into the habit of using binary.

CD stands for current directory and that's exactly what it does. It moves into the dir I put after it (in this case, BBTest\)

Get is another self-explanitory command. It will download the file you tell it to. The thing to remember with this is that it will download the file to wherever the CD of the CMD is. For example, if I am on the CMD (before going to FTP) and my CD is the desktop, when I use "get" it will put the file on my desktop.

Bye is the 'exit' of FTP. It closes the connection with the FTP. If you dont use this and have too many connections (without closing them) in too short of a time, the server will not allow you to connect. So it's best to make sure you always end with bye.

-s is the automatic version of FTP, but you can, of course, do it manually. All of the commands are the exact same except for one, and that is how you open the connection. Starting with a new CMD window, you type in "ftp ftp.drivehq.com" instead of "open ftp.drivehq.com" Then it will ask you for your username, and then your password.

I hope this tutorial made sense and shed some light on FTP. If you have any questions or comments, please feel free to ask! I don't do tutorials very often XD

2 Re: Quick FTP Tut on Thu Jan 13, 2011 3:49 pm

Forum_Reader

avatar
Jr Admin
Jr Admin
DriveHQ doesn't support CMD.EXE, or more specifically, CMD does not support Passive Mode, which DriveHQ requires.
What is the No.1 technical advice that users should know?

When accessing behind a NAT/firewall, please set FTP access mode to PASSIVE(PASV). Since Microsoft command-line FTP doesn't support passive mode, please use the FTP clients mentioned above.

3 Re: Quick FTP Tut on Thu Jan 13, 2011 4:41 pm

-xPloit

avatar
Moderators
Moderators
well I use DHQ for lots of things and I have no issues with it...doing it manually or -s both work 100% perfectly for me. Guess it's just you Canadians that have issues with it Razz


_________________
00101101011110000101000001101100011011110110100101110100

C# \ VB Coder for hire


Click the banner to join!

4 Re: Quick FTP Tut on Thu Jan 13, 2011 4:43 pm

Forum_Reader

avatar
Jr Admin
Jr Admin
-xPloit wrote:well I use DHQ for lots of things and I have no issues with it...doing it manually or -s both work 100% perfectly for me. Guess it's just you Canadians that have issues with it Razz
They even say in their FAQ that it doesn't work...

5 Re: Quick FTP Tut on Thu Jan 13, 2011 4:49 pm

-xPloit

avatar
Moderators
Moderators
well their FAQ sucks then. Do you need me to make you a vid or something to prove it?


_________________
00101101011110000101000001101100011011110110100101110100

C# \ VB Coder for hire


Click the banner to join!

Sponsored content


Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum