【发布时间】:2017-09-19 16:13:20
【问题描述】:
我正在编写一个脚本来自动化 metasploit 现在我的脚本工作正常,直到我需要在终端上运行的命令但是当我尝试运行我必须在 metasploit 控制台内执行的命令时,脚本会停止,直到我手动退出控制台,然后从下一行继续。
当您运行 metasploit 时,它会在终端内打开一个控制台 (msfconsole),您可以在其中运行您的命令。
如何在我的脚本中添加特定命令以在控制台中运行??
这些是我要运行的命令:
msfconsole (this command starts the metasploit console, this command works fine in the script)
search netapi (This searches the exploit i want to use, now this command is to be entered inside the console which my script cannot do)
在此之后需要在控制台中输入所有命令,控制台看起来像这样:msf >
【问题讨论】:
-
你的脚本是什么,shell脚本还是python还是ruby?
-
它是一个 shell 脚本
-
你问如何在shell脚本中运行特定的命令,什么样的命令,你的意思是
ls, cat, ps? -
更新帖子
标签: linux scripting metasploit