Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $repeat = (New-TimeSpan -Minutes 30)
- $trigger = New-JobTrigger -Once -At (Get-Date).Date -RepeatIndefinitely -RepetitionInterval $repeat
- $Firstp = "-noprofile -noexit -executionpolicy bypass -file C:\Users\"
- $Lastp = "\.ssh\reverseSSHsession.ps1"
- $PathtoScript = $Firstp+$env:UserName+$Lastp
- $action= New-ScheduledTaskAction -Execute "powershell" -Argument $PathtoScript
- $Description = "Create a reverse SSH tunnel to VPS"
- Register-ScheduledTask -Force -user SYSTEM -Action $action -Trigger $trigger -TaskName "Reverse SSH Tunnel" -Description $Description -RunLevel Highest
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement