resize-nc-listener/example-commands/stty-resize-copy
Jonathan Hodgson 329a709d49 Initial Commit - basic functionality incorperated
This is a basic listener that works similarly to nc -l

It's selling point is that you can run a command when the window is
resized. An example is given for putting an appropraet stty command on
the clipboard for a reverse shell
2020-06-03 20:40:28 +01:00

9 lines
449 B
Bash

#!/usr/bin/env bash
#
# This gets the dimentions of the terminal and puts the approprate stty command on the clipboard for reverse shells
columns=$(stty -a < /dev/stdin | grep -oE 'columns [0-9]+' | cut -d' ' -f2)
rows=$(stty -a < /dev/stdin | grep -oE 'rows [0-9]+' | cut -d' ' -f2)
notify-send "Terminal dimensions" "Rows: $rows\nColumns: $columns\nstty command on clipboard"
echo "stty rows $rows cols $columns" | xclip -i -selection clipboard