Skip to content

Instantly share code, notes, and snippets.

@bohops
Created October 17, 2018 16:42
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bohops/2f9d745bbc3e83d6c5b25b22834c13a2 to your computer and use it in GitHub Desktop.
Save bohops/2f9d745bbc3e83d6c5b25b22834c13a2 to your computer and use it in GitHub Desktop.
while ($true) {
$(Get-Date).ToUniversalTime()
$Runspace = [runspacefactory]::CreateRunspace()
$PowerShell = [powershell]::Create()
$PowerShell.runspace = $Runspace
$Runspace.Open()
[void]$PowerShell.AddScript({
$tcpConnection = New-Object System.Net.Sockets.TcpClient('1.1.1.1', 80)
$tcpStream = $tcpConnection.GetStream()
$tcpConnection.close()
})
$PowerShell.Invoke()
start-sleep -s 10
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment