Created
March 21, 2024 01:16
-
-
Save charlesroper/2c0ad809005c661ac16785b85bbc286c to your computer and use it in GitHub Desktop.
PowerShell script that starts an ssh SOCKS proxy then starts a browser. When the browser closes, it also closes the ssh proxy.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Start the SSH command in the background | |
$sshProcess = Start-Process -FilePath "ssh" -ArgumentList "-v -D 1080 -N -C <SSH_SERVER>" -PassThru | |
# Wait for the SSH process to start | |
Start-Sleep -Seconds 2 | |
# Start browser | |
Start-Process -FilePath "librewolf" -NoNewWindow | |
# Wait for browser to close | |
Wait-Process -Id (Get-Process librewolf).Id | |
# Terminate the SSH process | |
Stop-Process -Id $sshProcess.Id |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment