【2014-06-05】某《魔鬼训练营》读书笔记:metasploit自定义模块的编写
[历史归档]本文原发布于 cstriker1407.info 个人博客内容为历史存档仅供参考。发布时间2014-06-05 标题某《魔鬼训练营》读书笔记metasploit自定义模块的编写分类操作系统 / 安全 标签metasploit·ruby·自定义模块某《魔鬼训练营》读书笔记metasploit自定义模块的编写笔记仅供学习交流使用请勿进行其他用途首先看下已有模块的位置rootkali:/usr/share/metasploit-framework/modules# pwd/usr/share/metasploit-framework/modules rootkali:/usr/share/metasploit-framework/modules# lsauxiliary encoders exploits nops payloads post这里我们在auxiliary目录下新建一个文件夹名称为cstriker1407里面新建一个rb文件名称为【 cstriker1407_hello.rb 】如下rootkali:/usr/share/metasploit-framework/modules/auxiliary/cstriker1407# pwd/usr/share/metasploit-framework/modules/auxiliary/cstriker1407 rootkali:/usr/share/metasploit-framework/modules/auxiliary/cstriker1407# lscstriker1407_hello.rbcstriker1407_hello.rb的内容为### This module requires Metasploit: http//metasploit.com/download# Current source: https://github.com/rapid7/metasploit-framework##requiremsf/coreclassMetasploit3Msf::AuxiliaryincludeMsf::Auxiliary::Reportdefinitializesuper(Namecstriker1407 hello module,DescriptionA demo module to learn metasploit modules.,References[[URL,http://116.62.110.235/blog],],Author[cstriker1407],LicenseMSF_LICENSE)enddefrunprint_status(Hello Metasploit Modules)endend文件建立好之后重新启动下Metasploit然后就可以使用了如下msfsearch cstriker1407#搜索这个模块Matching ModulesName Disclosure Date Rank Description ---- --------------- ---- ----------- auxiliary/cstriker1407/cstriker1407_hello normal cstriker1407 hello module msfuse auxiliary/cstriker1407/cstriker1407_hello msf auxiliary(cstriker1407_hello)info Name: cstriker1407 hello module Module: auxiliary/cstriker1407/cstriker1407_hello License: Metasploit Framework License(BSD)Rank: Normal Provided by: cstriker1407 Description: A demo module to learn metasploit modules. References: http://116.62.110.235/blog msf auxiliary(cstriker1407_hello)show options Module options(auxiliary/cstriker1407/cstriker1407_hello): Name Current Setting Required Description ---- --------------- -------- ----------- msf auxiliary(cstriker1407_hello)exploit[*]Hello Metasploit Modules#执行了run方法[*]Auxiliary module execution completed msf auxiliary(cstriker1407_hello)