User-initiated reverse support shell via OpenSSL from a host user behind a firewall to the guest.
- Both parties run:
| #!/bin/bash | |
| exec {times}> times {typescript}> typescript < "${1-/dev/stdin}" | |
| while read -r; do [[ $REPLY = ' "stdout": [' ]] && break; done # skip to this line | |
| LANG=C | |
| printf "Script started on %(%c)T\n" -1 >&"$typescript" # dummy | |
| while read -r open; [[ $open = '[' ]]; do | |
| read -r elapsed; read -r string; read -r close | |
| eval printf %b%n "$string" characters >&"$typescript" # put count in $characters | |
| printf "%s %s\n" "${elapsed%,}" "$characters" >&"$times" | |
| done |
| #!/bin/bash | |
| # Tom Hale, 2016. MIT Licence. | |
| # Print out 256 colours, with each number printed in its corresponding colour | |
| # See http://askubuntu.com/questions/821157/print-a-256-color-test-pattern-in-the-terminal/821163#821163 | |
| set -eu # Fail on errors or undeclared variables | |
| printable_colours=256 |