Building your own post-exploitation module
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 give us the power to extend the framework depending on our needs.
Getting ready
Let's build a small post-exploitation module that will enumerate all the users in a domain using PowerShell. We already know how to run PowerShell scripts using the Windows Powershell Execution Post Module; however, typing PowerShell commands or having to maintain separate files with scripts for common tasks can be daunting and prone to errors.
How to do it...
Post modules are categorized based on their behavior, as shown in the following list from the official documentation:
Category | Description |
| Modules that involve data gathering/collecting/enumeration. |
| Modules that steal credentials. |
| Modules that involve forensics data gathering... |