FTP scriptyness |
FTP scriptyness |
Oct 7 2008, 03:33 PM
Post
#1
|
|
Security and Projects Group: Clan Dogsbody Posts: 4,687 Thank(s): 1098 Points: 2,440 Joined: 31-August 07 From: A Magical Place, with toys in the million, all under one roof Member No.: 1 |
Firstly would it not be easier to script it so that a bunch of files are packaged - zipped or preferably tarred and then upload the one file then untar it on the remote server??
Something like the following run on "Remote server" => "computer where files are kept" (Dirty FTP connections*) On server, create a local ghey.zip and fills it from the FTP request. WebRequest.RegisterPrefix("ftp://", FtpWebRequest.Creator); WebRequest request = WebRequest.Create("ftp://ftp.magik5likesmen.com/ghey.tar.gz"); WebResponse response = request.GetResponse(); Stream stream = response.GetResponseStream(); Stream local = File.Create("ghey.tar.gz"); byte[] buffer = new byte[1024]; int n; do { n = stream.Read(buffer, 0, buffer.Length); local.Write(buffer, 0, n); } while (n > 0); stream.Close(); local.Close(); **then something like.. (I can't remember the syntax )*** gz.UnTarGz("ghey.tar.gz", untarRoot, bNoAbsolute); Obviously this can be rejigged if you want to run as a script on the "computer where files are kept" > "Remote Server" type direction *I do it this way so that a remote secure server never accepts inbound FTP connections, it should always initiate outbound connections by script. This means that the script can run with limited permissions e.g. run under a user to reach the outside world and place files in a given limited directory with no permissions outside of that directory. A separate script with permissions to this directory but no permissions to the outside world can then be run to unpack and palce the files where they belong; this is purely limiting security. -------------------- |
|
|
Oct 9 2008, 08:21 AM
Post
#2
|
|
Security and Projects Group: Clan Dogsbody Posts: 4,687 Thank(s): 1098 Points: 2,440 Joined: 31-August 07 From: A Magical Place, with toys in the million, all under one roof Member No.: 1 |
I did A-level IT - the teacher (now sacked) was an old physics teacher that my school moved across in the 70's to teach computers, since physics/maths were closest to IT at the time.
He decided to split the sets based on score of a big IT test, but rather than taking the top 20 into set 1 etc., he set a hard limit e.g. Top set were people that scored over 90%. This meant my A-level class consisted of 3 people. The only lesson he taught in 2 years was 'how binary works' The rest of the time he went into the staff room and never reappeared. For me IT/IS and computer science were all basically the same thing. I completed my generic spradsheets/relational database coursework and then started learning VB - probably out of boredom. I also learnt a lot about security during this time - there were more computer rooms than computer staff, so certain people were selected as prefects to look after these rooms. My room was H6 in hawkins house - there had been a sudden upsurge in (forbidden) gaming that I was supposed to prohibit (Duke Nukem!) During this 2 year period, the head of IT never figured it was me installing these games. It was a good situation - he kept buying security and snooping software and showing me how it worked, thereby enabling me to bypass it I suspect I learnt more through this than I would have in a traditional taught class -------------------- |
|
|
Lo-Fi Version | Time is now: 24th November 2024 - 11:29 AM |