Adding and reviewing module documentation is a great way to contribute to the Metasploit Framework.
Before you write any module documentation, you should take a look at the sample template, module_doc_template.md, or take a look at any of the KBs that are already available.
To write a KB, you'll need to:
modules/exploits/windows/smb/ms08_067_netapi.rb
, so its documentation is documentation/modules/exploits/windows/smb/ms08_067_netapi.md
.If you go to metasploit-framework/documentation/modules, you'll see that there are documentation directories for each module type: auxiliary, exploit, payload, and post. To figure out where you need to put the file, you'll need to look at the module's path.
use <module name>
.info -d
.For example:
msf> use auxiliary/scanner/smb/smb_login
msf (smb_login)> info
Name: SMB Login Check Scanner
Module: auxiliary/scanner/smb/smb_login
....
If you were creating a KB for the smb login scanner, you'd add it to metasploit-framework/documentation/modules/auxiliary/smb.md
.
These are just suggestions, but it'd be nice if the KB had these sections:
A documentation file can be passed as a positional argument to metasploit-framework/tools/dev/msftidy_docs.rb
and will
highlight formatting errors the docs file might contain. Once all the errors and warnings thrown by msftidy_docs.rb
have
been resolved, the documentation file is ready for submission.
➜ metasploit-framework git:(upstream-master) ✗ ruby tools/dev/msftidy_docs.rb documentation/modules/exploit/linux/http/panos_op_cmd_exec.md
documentation/modules/exploit/linux/http/panos_op_cmd_exec.md - [INFO] Missing Section: ## Options
documentation/modules/exploit/linux/http/panos_op_cmd_exec.md - [WARNING] Please add a newline at the end of the file
documentation/modules/exploit/linux/http/panos_op_cmd_exec.md - [WARNING] H2 headings in incorrect order. Should be: Vulnerable Application, Verification Steps/Module usage, Options, Scenarios
documentation/modules/exploit/linux/http/panos_op_cmd_exec.md:50 - [WARNING] Should use single backquotes (`) for single line literals instead of triple backquotes (```)
documentation/modules/exploit/linux/http/panos_op_cmd_exec.md:53 - [WARNING] Spaces at EOL