TTY

To generate a fully TTY, we can execute CTRL+C, have command history and move between them.

  • $ : Victim machine

  • > : Attacker machine

Once we get a reverse shell, we do this:

$ script /dev/null -c bash
CTRL + Z
> stty raw -echo; fg
> reset
> xterm
$ export TERM=xterm
$ export SHELL=bash

Open a new terminal and execute:

> stty -a
# Take values and go back to victim machine
$ stty rows value_rows columns value_columns

If we want change terminal color:

$ PS1="\e[0;34m\u@\h:\w\$ \e[m"
# We get something like this with color 34 (blue)
root@hola:~$

Last updated