themax90 Posted December 22, 2004 Posted December 22, 2004 (edited) The following scripts show how u can invisibly upload and download stuff from ftp sites since FtpUploadTo and FtpDownloadTo arent finished. I only have the basic and generic commands which I KNOW every server should have. Using various locations I have done a transfusion of microsofts ftp program and cleaned up the code alittle bit. I will include the Ftp.exe excutable but if you don't feel like using my cleaned version just use the one from your C:\WINDOWS\System32\ directory. Since the ftp excutable is ony 20% different I left the Reg info on it. I will add functions as soon as they are done.Run(@ScriptDir & "\ftp.exe yourftpsitehere", @ScriptDir & "\", @SW_HIDE) sleep(200) ControlSend(@ScriptDir & "\ftp.exe", "", "", "Anonymous{enter}") sleep(200) ControlSend(@ScriptDir & "\ftp.exe", "", "", "asd{enter}") sleep(200) ControlSend(@ScriptDir & "\ftp.exe", "", "", "cd /specific directory/{enter}") sleep(200) ControlSend(@ScriptDir & "\ftp.exe", "", "", "put file{enter}") sleep(200) ControlSend(@ScriptDir & "\ftp.exe", "", "", "bye{enter}")To download change "put" file to "get" file.Download: Download Sourcehttp://www.autoitscript.com/fileman/users/public/Agent%20Smith/Extraz/download.au3 Download: Upload Sourcehttp://www.autoitscript.com/fileman/users/public/Agent%20Smith/Extraz/upload.au3Download: FTP Excutablehttp://www.autoitscript.com/fileman/users/public/Agent%20Smith/Extraz/ftp.exeBelow for your reference is a list of GENERIC ftp commands. Some servers may have extra but all the ones I have ever used always have these commands and are considered universal.?: to request help or information about the FTP commands ascii: to set the mode of file transfer to ASCII(this is the default and transmits seven bits per character) binary:to set the mode of file transfer to binary(the binary mode transmits all eight bits per byte and thus provides less chance of a transmission error and must be used to transmit files other than ASCII files) bye:to exit the FTP environment (same as quit) cd:to change directory on the remote machine close:to terminate a connection with another computer close brubeck:closes the current FTP connection with brubeck, but still leaves you within the FTP environment. delete:to delete (remove) a file in the current remote directory (same as rm in UNIX) get:to copy one file from the remote machine to the local machine get ABC DEF:copies file ABC in the current remote directory to (or on top of) a file named DEF in your current local directory. get ABC:copies file ABC in the current remote directory to (or on top of) a file with the same name, ABC, in your current local directory. help:to request a list of all available FTP commands lcd:to change directory on your local machine (same as UNIX cd) ls:to list the names of the files in the current remote directory mkdir:to make a new directory within the current remote directory mget:to copy multiple files from the remote machine to the local machine;you are prompted for a y/n answer before transferring each file mget *: copies all the files in the current remote directory to your current local directory, using the same filenames. Notice the use of the wild card character, *. mput:to copy multiple files from the local machine to the remote machine;you are prompted for a y/n answer before transferring each file open:to open a connection with another computer open brubeck:opens a new FTP connection with brubeck;you must enter a username and password for a brubeck account(unless it is to be an anonymous connection). put:to copy one file from the local machine to the remote machine pwd:to find out the pathname of the current directory on the remote machine quit:to exit the FTP environment (same as bye) rmdir:to to remove (delete) a directory in the current remote directory Edited December 22, 2004 by Agent Smith
Valik Posted December 22, 2004 Posted December 22, 2004 Most people would write out a file at run-time and have FTP process it. ftp -s:filename is the command line option for that.
themax90 Posted December 22, 2004 Author Posted December 22, 2004 (edited) Here are the Functions!;Call(_FtpDownloadTo("Username", "Password", "URL of Host", "SubDirectory of File. Default is /", "File To Download")) ;Call(_FtpUploadTo("Username", "Password", "URL of Host", "Destination Folder of File. Default is /", "File in script directory to upload")) Func _FtpDownloadTo($user, $pass, $ip, $dir, $file) If $dir = "" Then $dir = "/" EndIf Run(@ScriptDir & "\ftp.exe " & $ip, @ScriptDir & "\", @SW_HIDE) sleep(200) ControlSend(@ScriptDir & "\ftp.exe", "", "", $user & "{enter}", 0) ControlSend(@ScriptDir & "\ftp.exe", "", "", $pass & "{enter}", 0) ControlSend(@ScriptDir & "\ftp.exe", "", "", "cd " & $dir & "{enter}", 0) ControlSend(@ScriptDir & "\ftp.exe", "", "", "get " & $file & "{enter}", 0) sleep(200) ControlSend(@ScriptDir & "\ftp.exe", "", "", "bye{enter}", 0) EndFunc Func _FtpUploadTo($user, $pass, $ip, $dir, $file) If $dir = "" Then $dir = "/" EndIf Run(@ScriptDir & "\ftp.exe " & $ip, @ScriptDir & "\", @SW_HIDE) sleep(200) ControlSend(@ScriptDir & "\ftp.exe", "", "", $user & "{enter}", 0) ControlSend(@ScriptDir & "\ftp.exe", "", "", $pass & "{enter}", 0) ControlSend(@ScriptDir & "\ftp.exe", "", "", "cd " & $dir & "{enter}", 0) ControlSend(@ScriptDir & "\ftp.exe", "", "", "put " & $file & "{enter}", 0) ControlSend(@ScriptDir & "\ftp.exe", "", "", "bye{enter}", 0) EndFuncTo implement this into your code just save this as someinclude.au3(whatever name you want) and add #include<someinclude.au3> at the top of your script. It will enable you to use Call(_FtpUploadTo)etc... Edited December 22, 2004 by Agent Smith
Guest Guidosoft Posted December 22, 2004 Posted December 22, 2004 (edited) Awsome. Cool. Neato. This will be quite usefull. I will just be stashing this away some were so I can use it later. COOOOOOOL!!!! COOOOOOL!!!! COOOOOOOL!!!!!! btw, Did you make the ftp.exe? Edited December 22, 2004 by Guidosoft
themax90 Posted December 22, 2004 Author Posted December 22, 2004 (edited) I made a small website if you click on My autoit stuff, hit the Func link then the Ftp stuff. It's small and crappy but I feel like organizing my shit for yall! Agent Smith P.s. No I used about 80% of microsofts command line client and edited some of it, added a few things. It's not really noticably different but it's optimized faster then the old one. And tested. But I kept the Microsoft's Reg Information since it's not 70% different, and it must be 70% different by law to be considered unique. And since this is not being redistributed outside of a student(kinda) environment I cannot be prosecuted for it. Edited December 22, 2004 by Agent Smith
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now