如何在metasploit中加入第三方脚本(CVE-2019-0708可批量检测)

msf具有很高的开放性,可以加入第三方脚本毋庸置疑

本文目的:解决自己添加的rb脚本在msf中不能用的问题

【文末附有poc脚本下载地址】rdp rce

首先把下载的脚本放入msf对应的目录之下,之后msfconle下reload_all

 放入脚本之后满心欢喜的等待使用,结果返回下面一大堆错我信息,看了上网上的教程并没有找到解决方法

msf > reload_all 
[*] Reloading modules from all module paths...
[-] Error while running command reload_all: uninitialized constant Msf::Modules::Mod6578706c6f69742f77696e646f77732f7264702f6376655f323031395f30373038::MetasploitModule::CRASH_SAFE

Call stack:
/usr/share/metasploit-framework/modules/exploits/windows/rdp/cve_2019_0708.rb:35:in `initialize'
/usr/share/metasploit-framework/lib/msf/core/module_set.rb:54:in `new'
/usr/share/metasploit-framework/lib/msf/core/module_set.rb:54:in `create'
/usr/share/metasploit-framework/lib/msf/core/db_manager/module_cache.rb:318:in `block (3 levels) in update_all_module_details'
/usr/share/metasploit-framework/lib/msf/core/db_manager/module_cache.rb:316:in `each'
/usr/share/metasploit-framework/lib/msf/core/db_manager/module_cache.rb:316:in `block (2 levels) in update_all_module_details'
/usr/share/metasploit-framework/lib/msf/core/db_manager/module_cache.rb:313:in `each'
/usr/share/metasploit-framework/lib/msf/core/db_manager/module_cache.rb:313:in `block in update_all_module_details'
/usr/share/metasploit-framework/vendor/bundle/ruby/2.5.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract/connection_pool.rb:292:in `with_connection'
/usr/share/metasploit-framework/lib/msf/core/db_manager/module_cache.rb:276:in `update_all_module_details'
/usr/share/metasploit-framework/lib/msf/core/module_manager/cache.rb:114:in `refresh_cache_from_module_files'
/usr/share/metasploit-framework/lib/msf/core/module_manager/reloading.rb:42:in `reload_modules'
/usr/share/metasploit-framework/lib/msf/ui/console/command_dispatcher/modules.rb:754:in `cmd_reload_all'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:501:in `run_command'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:453:in `block in run_single'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:447:in `each'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:447:in `run_single'
/usr/share/metasploit-framework/lib/rex/ui/text/shell.rb:151:in `run'
/usr/share/metasploit-framework/lib/metasploit/framework/command/console.rb:48:in `start'
/usr/share/metasploit-framework/lib/metasploit/framework/command/base.rb:82:in `start'
/usr/bin/msfconsole:49:in `<main>'

只能自己摸索了

网上已有教程并没有对msf的环境信息进行描述

大致分析思路:其实msf v4--> v5发生了很大的变化,由于cve-2019-0708的脚本比较新,只兼容新版本的msf(也就是v5)

升级前的环境:v4.17.18

msf升级很简单,下面两条命令即可

root@kk:~/scan# apt-get update
命中:1 http://mirrors.neusoft.edu.cn/kali kali-rolling InRelease
正在读取软件包列表... 完成   
root@kk:~/scan# apt-get install metasploit-framework

升级之后的环境:v5.0.22   【话说msf的图标还是很帅的】

不用执行reload_all,先搜索一下目标脚本

发现直接可以找到对应的脚本(目测脚本放错目录了 ,这里需要修改一下,删除掉当前脚本及目录,移动到auxiliary下,新建对应的目录)

不移动,直接使用会报错

移动之后的目录结构

重新reload_all之后,对目标脚本进行搜索(可以正常使用cve-2019-0708)

这个脚本的使用也很简单(直接看下图,设置rhosts之后直接运行即可)

很容易发现一枚带漏洞的服务器

同时此脚本具备批量检测的功能

批量检测效果如下图

 

附上文中cve-2019-0708批量检测脚本地址:https://download.csdn.net/download/helloexp/11200026

如何修复cve-2019-0708 可以参考helloexp 的另外一篇文章:https://blog.csdn.net/helloexp/article/details/90515136

此漏洞对应的补丁下载地址:https://portal.msrc.microsoft.com/zh-cn/security-guidance/advisory/CVE-2019-0708

以上

BR

 

 

 

  • 3
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

阿雷由

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值