How to do it...

Private modules sets are located in the ~/.msf4/modules/ folder. So we will use the mkdir command to create a folder structure to hold our module. As this is an exploit module targeting the Windows operating system, which affects the HTTP protocol, we will have to set the module's location accordingly:

root@kali:~# mkdir -p .msf4/modules/exploits/windows/http

Now, save the ported module as disksorter.rb and check whether it is working, launch Metasploit, load the module, and try to exploit the target:

Looking at the output, we can see that the module worked and we have a new session with system privileges.

Get Metasploit Penetration Testing Cookbook - Third Edition 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.