So far, we have seen how useful modules are and the power that they can add to the framework. In order to master the framework, it is essential to understand building and working with modules. This will help us quickly extend the framework according to our needs. In the next few recipes, we will see how we can use Ruby scripting to build our own modules and import them into the framework.
Let's start with some of the basics of module building:
- In the first line, the
require
method specifies which libraries this module needs to load:
require 'msf/core/post/windows/powershell'
- The following line defines the class which inherits the properties of the post family. The
post
module can import several functionalities, such as accessing the filesystem, using the registry, WMI, LDAP, and so on:
class MetasploitModule < Msf::Post
- The
include
statement can be used to include a particular functionality of the framework into our own module. For...