在python3中使用os.system来使用metasploit

时间:2019-02-05 11:45:40

标签: python linux python-3.x metasploit

我想使用metasploit模块

auxiliary/gather/search_email_collector 

在python3中,提供由

类定义的URL
domain

到模块。 整个过程应该单行运行,而无需打开metasploit。

它应该类似于

os.system("msfconsole #Something that uses this tool with the defined URL")

我到目前为止编写的代码如下:

sleeper = 3
file.write("Metasploit findings: \n \n")
print ("Using Metasploit \n")
time.sleep(float(sleeper)) #wait 3 seconds
file.close() #close the file
os.system("missing this."))
file = open('%s' % output, 'a') #open it again
file.write("\n \n")

现在的问题是:如何在一行中获取这些“命令”以在python3中与os.system一起使用?

msfconsole
use auxiliary/gather/search_email_collector 
set domain URL
run

0 个答案:

没有答案
相关问题