Copy the entire framework to a new directory

cp -r /usr/share/metasploit-framework /opt

Install pry-byebug

gem install pry-byebug

Copy keyboard shortcuts to pryrc

if defined?(PryByebug) Pry.commands.alias_command 'c', 'continue' Pry.commands.alias_command 's', 'step' Pry.commands.alias_command 'n', 'next' Pry.commands.alias_command 'f', 'finish'

end

From <https://github.com/deivid-rodriguez/pry-byebug>

Modify msfconsole file to use pry-byebug

Add line "require 'pry-bybug'" after other require statements

Find the Metasploit module you want to work with

locate {whatever} | grep metasploit | grep exploits

Everything from /modules on except {filename} is {path}

Copy the Metasploit module into a new directory where it will be accessible

mkdir -p ~/.msf4/{path}

cp /usr/share/metasploit-framework/{path}/{filename} ~/.msf4/{path}/{filename}

Set the exploit to run the debugger

At the beginning of the 'def exploit' section of the new file, add

binding.pry

When the debug runs, use the keyboard shortcuts to debug issues.