原文地址:
netsec.ws/?p=337
Often during pen tests you may obtain a shell without having tty, yet wish to interact further with the system. Here are some commands which will allow you to spawn a tty shell. Obviously some of this will depend on the system environment and installed packages.
Shell Spawning
若已经安装python
python -c 'import pty; pty.spawn("/bin/sh")'
在python的交互式命令行中
>>> import os; os.system('/bin/bash')
进入sh交互式命令行
/bin/sh -i
这前三个最常见!!!