The best way to start learning about module development is to delve deeper into the existing Metasploit modules and see how they work. Let's look at some modules to find out what happens when we run these modules.
The skeleton for Metasploit modules is relatively simple. We can see the universal header section in the following code:
require 'msf/core' class MetasploitModule < Msf::Auxiliary def initialize(info = {}) super(update_info(info, 'Name' => 'Module name', 'Description' => %q{ Say something that the user might want to know. }, 'Author' => [ 'Name' ], 'License' => MSF_LICENSE )) end def run # Main function end end
A module starts by including the necessary libraries with the required keyword, which in the preceding code is followed by the msf/core
libraries. Thus, it includes the core
libraries from the msf
directory...