dumb to interactive shell

When spawning new web shell, it is commonly just nothing but the dumb terminal. To explorer target system better, it is mandatory to use fully interactive shell. There are few ways to make it, but I believe those two options were the best.

Python pty module

target$python -c 'import pty; pty.spawn("/bin/bash")'  
target$ctrl+z
host$stty raw -echo
host$fg
target$enter * 2

more accurate

target$python -c 'import pty;pty.spawn("/bin/bash")'
target$ctrl+z
host$echo $TERM // write down 
host$stty -a // write down rows, columns numbers
host$stty raw -echo
host$fg
target$reset
target$export TERM='something' //same as host
target$stty rows 'number' columns 'number' //same as host

other options

https://blog.ropnop.com/upgrading-simple-shells-to-fully-interactive-ttys/

Leave a Reply

Your email address will not be published. Required fields are marked *