Now, we have covered enough background about building modules. In this recipe, we will see an example of how we can build our own module and add it to the framework. Building modules can be very handy, as they will give us the power of extending the framework depending on our needs.
Writing a post-exploitation module
Getting ready
Let's build a small post-exploitation module that will enumerate all of the users on the target using WMIC. As it is a post-exploitation module, we will require a compromised target in order to execute the module:
class MetasploitModule < Msf::Post
include Msf::Post::Windows::WMIC
The script starts up with the class that extends the properties of the Msf::Post modules and the include statement to...