Files
metasploit-gs/docs/using-metasploit/basics/module-documentation.html
T

10 lines
53 KiB
HTML
Raw Normal View History

2026-05-08 17:08:43 +00:00
<!DOCTYPE html><html lang="en-US"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=Edge"><link rel="shortcut icon" href="/assets/images/favicon.png" type="image/x-icon"><link rel="stylesheet" href="/assets/css/just-the-docs-default.css"> <script async src="https://www.googletagmanager.com/gtag/js?id=UA-4622520-7"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-4622520-7', { 'anonymize_ip': true }); </script> <script type="text/javascript" src="/assets/js/vendor/lunr.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/mermaid@10.8.0/dist/mermaid.min.js"></script> <script type="text/javascript" src="/assets/js/just-the-docs.js"></script><meta name="viewport" content="width=device-width, initial-scale=1"><title>Module Documentation | Metasploit Documentation Penetration Testing Software, Pen Testing Security</title><meta name="generator" content="Jekyll v4.3.4" /><meta property="og:title" content="Module Documentation" /><meta property="og:locale" content="en_US" /><meta name="description" content="View Metasploit Framework Documentation" /><meta property="og:description" content="View Metasploit Framework Documentation" /><link rel="canonical" href="https://rapid7.github.io/metasploit-framework/docs/using-metasploit/basics/module-documentation.html" /><meta property="og:url" content="https://rapid7.github.io/metasploit-framework/docs/using-metasploit/basics/module-documentation.html" /><meta property="og:site_name" content="Metasploit Documentation Penetration Testing Software, Pen Testing Security" /><meta property="og:type" content="website" /><meta name="twitter:card" content="summary" /><meta property="twitter:title" content="Module Documentation" /> <script type="application/ld+json"> {"@context":"https://schema.org","@type":"WebPage","description":"View Metasploit Framework Documentation","headline":"Module Documentation","publisher":{"@type":"Organization","logo":{"@type":"ImageObject","url":"https://rapid7.github.io/metasploit-framework/assets/images/favicon.png"}},"url":"https://rapid7.github.io/metasploit-framework/docs/using-metasploit/basics/module-documentation.html"}</script><body> <svg xmlns="http://www.w3.org/2000/svg" style="display: none;"> <symbol id="svg-link" viewBox="0 0 24 24"><title>Link</title><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-link"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path> </svg> </symbol> <symbol id="svg-search" viewBox="0 0 24 24"><title>Search</title><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-search"> <circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line> </svg> </symbol> <symbol id="svg-menu" viewBox="0 0 24 24"><title>Menu</title><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-menu"><line x1="3" y1="12" x2="21" y2="12"></line><line x1="3" y1="6" x2="21" y2="6"></line><line x1="3" y1="18" x2="21" y2="18"></line> </svg> </symbol> <symbol id="svg-arrow-right" viewBox="0 0 24 24"><title>Expand</title><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-right"><polyline points="9 18 15 12 9 6"></polyline> </svg> </symbol> <symbol id="svg-doc" viewBox="0 0 24 24"><title>Document</title><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" strok
<span class="zp">msf</span> <span class="p">(</span><span class="kc">smb_login</span><span class="p">)&gt;</span> info -d
</code></pre></div></div><p>Additionally, if its available, the help page will also include a KB that contains advanced usage information, such as vulnerable target details, caveats, and sample usage. The content in the KB is contained in a markdown file in the <code class="language-plaintext highlighter-rouge">metasploit-framework/documentation/modules</code> directory. Its purpose is to provide supplemental information that is outside of the scope of general documentation.</p><h3 id="add-an-access-token-to-see-pr-history"> <a href="#add-an-access-token-to-see-pr-history" class="anchor-heading" aria-labelledby="add-an-access-token-to-see-pr-history"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> Add an access token to see PR history</h3><p>In order for you to be able to view the PR history for a module, youll need add your GitHub access token to the environment variable <code class="language-plaintext highlighter-rouge">GITHUB_OAUTH_TOKEN="&lt;your token here&gt;"</code> in <code class="language-plaintext highlighter-rouge">.bash_profile</code>.</p><p>To generate a GitHub access token, check out this <a href="https://help.github.com/articles/creating-an-access-token-for-command-line-use/">page</a>. The token will need to have a scope for repos.</p><h3 id="how-you-can-write-kbs"> <a href="#how-you-can-write-kbs" class="anchor-heading" aria-labelledby="how-you-can-write-kbs"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> How you can write KBs</h3><p>Generally, the person who creates the module will write the initial KB for it, but anyone can write or contribute to it.</p><p>Before you write a KB, you should take a look at the sample template, <a href="https://github.com/rapid7/metasploit-framework/blob/master/documentation/modules/module_doc_template.md">module_doc_template.md</a>, or take a look at any of the KBs that are already available.</p><p>To write a KB, youll need to:</p><ol><li>Create an markdown (.md) file.<li>Write the content.<li>Save the file and name it after the module name. For example, the filename for <code class="language-plaintext highlighter-rouge">ms08_067_netapi.rb</code> is called <code class="language-plaintext highlighter-rouge">ms08_067_netapi.md</code>.<li>Place it in the <code class="language-plaintext highlighter-rouge">metasploit-framework/documentation/modules</code> directory as directed below.</ol><h3 id="where-to-put-the-kb-files"> <a href="#where-to-put-the-kb-files" class="anchor-heading" aria-labelledby="where-to-put-the-kb-files"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> Where to put the KB files</h3><p>If you go to <code class="language-plaintext highlighter-rouge">metasploit-framework/documentation/modules</code>, youll see that there are documentation directories for each module type: <code class="language-plaintext highlighter-rouge">auxiliary</code>, <code class="language-plaintext highlighter-rouge">exploit</code>, <code class="language-plaintext highlighter-rouge">payload</code>, and <code class="language-plaintext highlighter-rouge">post</code>. To figure out where you need to put the file, youll need to look at the module name.</p><ol><li>Start msfconsole.<li>Type <code class="language-plaintext highlighter-rouge">use &lt;module name&gt;</code>.<li>Type <code class="language-plaintext highlighter-rouge">info</code>.<li>When the module name appears, look at the Module field. Youll see a file path for the module. Thats the path where the KB needs to be added.</ol><p>For example:</p><div class="language-msf highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="zp">msf</span><span class="p">&gt;</span> use auxiliary/scanner/smb/smb_login
<span class="zp">msf</span> <span class="p">(</span><span class="kc">smb_login</span><span class="p">)&gt;</span> info
Name: SMB Login Check Scanner
Module: auxiliary/scanner/smb/smb_login
....
</code></pre></div></div><p>If you were creating a KB for the smb login scanner, youd add it to <code class="language-plaintext highlighter-rouge">metasploit-framework/documentation/modules/auxiliary/scanner/smb</code>.</p><h3 id="sections-you-should-include-in-the-kb"> <a href="#sections-you-should-include-in-the-kb" class="anchor-heading" aria-labelledby="sections-you-should-include-in-the-kb"><svg viewBox="0 0 16 16" aria-hidden="true"><use xlink:href="#svg-link"></use></svg></a> Sections you should include in the KB</h3><p>These are just suggestions, but itd be nice if the KB had these sections:</p><ul><li><strong>Vulnerable Applications</strong> - Tells users what targets (version numbers) are vulnerable to the module and provides instructions on how to access vulnerable targets for testing. If possible provide a download link and any setup instructions to configure the software appropriately.<li><strong>Verification Steps</strong> - Tells users how to use the module and what the expected results are from running the module.<li><strong>Options</strong> - Provides descriptions of all the options that can be run with the module. Additionally, clearly identify the options that are required.<li><strong>Scenarios</strong> - Provides sample usage and describes caveats that the user may need to be aware of when running the module. Include the version number and OS so that this setup can be replicated at a later date.</ul><hr><footer><p><a href="#top" id="back-to-top">Back to top</a></p><p class="text-small text-grey-dk-000 mb-0"> <a href="https://github.com/rapid7/metasploit-framework/tree/master/docs/metasploit-framework.wiki/Module-Documentation.md" id="edit-this-page">Edit this page on GitHub</a></p></footer></div></div><div class="search-overlay"></div></div><script type="text/javascript" src="/assets/js/toggle_mode.js"></script> <script> var config = { theme: 'default', logLevel: 'fatal', securityLevel: 'strict', startOnLoad: true, arrowMarkerAbsolute: false, er: { diagramPadding: 20, layoutDirection: 'TB', minEntityWidth: 100, minEntityHeight: 75, entityPadding: 15, stroke: 'gray', fill: 'honeydew', fontSize: 12, useMaxWidth: true, }, flowchart:{ diagramPadding: 8, htmlLabels: true, curve: 'basis', }, sequence: { diagramMarginX: 50, diagramMarginY: 10, actorMargin: 50, width: 150, height: 65, boxMargin: 10, boxTextMargin: 5, noteMargin: 10, messageMargin: 35, messageAlign: 'center', mirrorActors: true, bottomMarginAdj: 1, useMaxWidth: true, rightAngles: false, showSequenceNumbers: false, }, gantt: { titleTopMargin: 25, barHeight: 20, barGap: 4, topPadding: 50, leftPadding: 75, fontSize: 11, gridLineStartPadding: 35, fontFamily: '\'Open Sans\', sans-serif', numberSectionStyles: 4, axisFormat: '%Y-%m-%d', topAxis: false, }, }; mermaid.initialize(config); window.mermaid.init(undefined, document.querySelectorAll('.language-mermaid')); </script>