RE: FTP with user but no password with FTP -S:filename

From: Tim Greene (TimGreene@online.microsoft.com)
Date: 10/03/02


From: TimGreene@online.microsoft.com (Tim Greene)
Date: Thu, 03 Oct 2002 21:31:04 GMT


You can log into FTP with a blank password using a script, but the login is
all you're going to be able to do in it. I got the login to work by doing
the following:

At a command prompt, type the following:

copy con ftpscript.scr
user test
Alt+13Alt+10
Ctrl+Z
<Press Enter>

Notes: Alt+ means hold down the Alt key while entering in the number, then
releasing it, and you must use the numbers on the keypad. The numbers at
the top of the keyboard will not work. When you hold down the Alt key and
enter in 13, after releasing the Alt key you've specified the escape ASCII
character for a Carriage Return (0D in hex), which is half of what the
Enter key uses. The other half is a Line Feed (0A in hex) which you enter
in by holding down the Alt key and typing 10 at the keypad. Using this
method effectively puts an "Enter" sequence as the password. You should
get output similar to the following:

C:\>ftp -n -s:ftp.scr ComputerName
Connected to ComputerName.
220 ComputerName Microsoft FTP Service (Version 5.0)
ftp> user timmy
331 Password required for timmy.
Error reading password.

230 User timmy logged in.

Even though it says "Error reading password", it still works.
Unfortunately, if any other entries are in the script file after the CRLF,
FTP.EXE will use that as the password. FTP.EXE uses the following format
for the script file when specifying a user name and password

user Username Password

When FTP.EXE parses the script file, it uses the first word after the user
command as the user name, then takes the next word and uses it as the
password. For instance, if we were to use this script...

copy con ftpscript.scr
user timmy
Alt+13Alt+10
dir
put c:\test.txt
bye
Ctrl+Z
<Press Enter>

..FTP will see "dir" as the password since it's the next word in the
script, and won't use the CRLF, resulting in a login failed.

Recommendations:

1. Use a password for your users.
2. Use the script strictly for login purposes only.

Sincerely,

Tim Greene MCSE, MCSA, MCP+I
IIS Newsgroup Support

Please do not send email directly to this alias. This is our online account
name for newsgroup participation only.

If you would like to open a support incident with Microsoft, call
1-800-936-5800

This posting is provided “AS IS” with no warranties, and confers no rights.
You assume all risk for your use. © 2001 Microsoft Corporation.



Relevant Pages

  • Need help sending a password to ftp
    ... I need to create a perl/expect script that will telnet into a system ... then bring up ftp on that system to transfer some files over there. ... 530 Login incorrect. ...
    (comp.lang.perl.misc)
  • Problems getting ftp to take my password
    ... I need to create a perl/expect script that will telnet into a system ... then bring up ftp on that system to transfer some files over there. ... 530 Login incorrect. ...
    (comp.lang.perl.modules)
  • [HPADM] automated ftp with anonymous user id
    ... I have a ftp script which in turns call another script. ... ftp of system1data has started ... Login with USER first. ...
    (HP-UX-Admin)
  • Re: Need help sending a password to ftp
    ... > then bring up ftp on that system to transfer some files over there. ... > can get the telnet session open. ... The script fails with: ... > 530 Login incorrect. ...
    (comp.lang.perl.misc)
  • Re: FTP delete problem
    ... the problem was a lock to a file that the ftp get worked, ... Bernard Cheah ha scritto: ... generate by schedule task. ... If i manually execute the script, the output wrote, but by schedule ...
    (microsoft.public.inetserver.iis.ftp)