将shell切换为TTY
python
python -c 'import pty; pty.spawn("/bin/bash")' #python2
python3 -c 'import pty;pty.spawn("/bin/bash")' #python3
stty
获取到shell后,先切换交互式shell,再Ctrl+z放到后台
stty -a # 以可读性较好的方式输出全部当前设置
stty raw -echo ; fg # 这里按两次Enter
stty rows 28 cols 112
export TERM=xterm
script
当目标机上没有python时,可以使用script升级shell
script /dev/null -c bash
此方法适用于如下shell
本文作者:Cx330Lm
版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。
安全声明:⽂中所涉及的技术、思路和⼯具仅供以安全为⽬的的学习交流使⽤,任何⼈不得将其⽤于⾮法⽤途以及盈利等⽬的,否则后果⾃⾏承担。所有渗透都需获取授权!