Last active
January 25, 2024 09:10
-
-
Save latsku/c5a6f14a2b95e0a602606a021fd43c3e to your computer and use it in GitHub Desktop.
Powershell TCP server
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
$endpoint = New-Object System.Net.IPEndPoint ([System.Net.IPAddress]::any, 1600) | |
$Listener = New-Object System.Net.Sockets.TcpListener $endpoint | |
$Listener.Start() | |
$client = $Listener.AcceptTcpClient() | |
$stream = $client.GetStream() | |
$stream.Write([text.Encoding]::Ascii.GetBytes("Hello Telnet World"), 0, 18) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment