metasploit 找不到我新创建的模块

问题描述

我首先创建了一个新文件夹调用 ~/.msf6/modules/auxiliary/scanner/mssql,然后我创建了一个新的 ruby​​ 文件调用 ihaz_sql.rb 这是代码

require 'msf/core'

class MetasploitModule < Msf::Auxiliary 
  include Msf::Exploit::Remote::MSSQL
  include Msf::Auxiliary::Scanner

  def initialize
    super(
      'Name' => 'I HAZ SQL Utility','Version' => '$Revision: 7243 $','Description' => 'This just prints some funny stuff.','Author' => 'TESTs security','License' => MSF_LICENSE
    )

    deregister_options('RPORT','PHOST')
  end

  def run_host(ip)
    begin
      puts 'I HAZ SQL!!!!'
    end
  end
end

然后我使用 msfconsole

打开 metasploit

并执行search ihazsearch ihaz_sql,但以上所有结果都显示 [-] No results from search

这是我正在关注的教程https://www.offensive-security.com/metasploit-unleashed/building-module/

解决方法

我自己对 Metasploit 还很陌生,所以这个答案可能对你有帮助,也可能没有。

我之前遇到过这样的问题,它的“修复”只是运行命令: use <full pathname to the ruby script>。例如添加~/.msf6/modules/exploits/cgi/webapps/example.rb ruby​​ 脚本文件后,运行updatedb命令,直接运行use exploit/cgi/webapps/example.rb命令即可​​使用漏洞利用。

希望这能解决您的问题。

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...