In the previous recipe, we learned how to write an exploit module for Metasploit, using an available PoC. In this recipe, we will save the module in an appropriate location and then test it to see whether everything goes well.
It is essential to store our exploit module in the proper place. This helps us to keep track of different modules and understand the basic module usage. Now that you have the complete module, let's find out an appropriate location to save 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...