Skip to content

Commit 587f1ee

Browse files
committed
Land rapid7#6708, module documentation for msfconsole
2 parents 3d624c0 + c4735bd commit 587f1ee

34 files changed

+3463
-12
lines changed

Gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ group :development do
1818
gem 'yard'
1919
# for development and testing purposes
2020
gem 'pry'
21+
# module documentation
22+
gem 'octokit', '~> 4.0'
2123
# rails-upgrade staging gems
2224
end
2325

Gemfile.lock

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,15 @@ PATH
1818
msgpack
1919
network_interface (~> 0.0.1)
2020
nokogiri
21+
octokit
2122
openssl-ccm (= 1.2.1)
2223
packetfu (= 1.1.11)
2324
pcaprub
2425
pg (>= 0.11)
2526
railties
2627
rb-readline-r7
2728
recog (= 2.0.14)
29+
redcarpet
2830
robots
2931
rubyzip (~> 1.1)
3032
sqlite3
@@ -57,6 +59,7 @@ GEM
5759
multi_json (~> 1.3)
5860
thread_safe (~> 0.1)
5961
tzinfo (~> 0.3.37)
62+
addressable (2.3.8)
6063
arel (4.0.2)
6164
arel-helpers (2.2.0)
6265
activerecord (>= 3.1.0, < 5)
@@ -95,6 +98,8 @@ GEM
9598
factory_girl_rails (4.5.0)
9699
factory_girl (~> 4.5.0)
97100
railties (>= 3.0.0)
101+
faraday (0.9.2)
102+
multipart-post (>= 1.2, < 3)
98103
ffi (1.9.8)
99104
filesize (0.1.1)
100105
fivemat (1.3.2)
@@ -142,9 +147,12 @@ GEM
142147
msgpack (0.7.4)
143148
multi_json (1.11.2)
144149
multi_test (0.1.2)
150+
multipart-post (2.0.0)
145151
network_interface (0.0.1)
146152
nokogiri (1.6.7.2)
147153
mini_portile2 (~> 2.0.0.rc2)
154+
octokit (4.2.0)
155+
sawyer (~> 0.6.0, >= 0.5.3)
148156
openssl-ccm (1.2.1)
149157
packetfu (1.1.11)
150158
network_interface (~> 0.0)
@@ -202,6 +210,9 @@ GEM
202210
rspec-support (3.3.0)
203211
rubyntlm (0.6.0)
204212
rubyzip (1.2.0)
213+
sawyer (0.6.0)
214+
addressable (~> 2.3.5)
215+
faraday (~> 0.8, < 0.10)
205216
shoulda-matchers (2.8.0)
206217
activesupport (>= 3.0.0)
207218
simplecov (0.9.2)
@@ -238,6 +249,7 @@ DEPENDENCIES
238249
factory_girl_rails (~> 4.5.0)
239250
fivemat (~> 1.3.1)
240251
metasploit-framework!
252+
octokit (~> 4.0)
241253
pry
242254
rake (>= 10.0.0)
243255
redcarpet
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
This module is a scanner module, and is capable of testing against multiple hosts.
2+
3+
```
4+
msf > use <%= mod.fullname %>
5+
msf <%= mod.type %>(<%= mod.shortname %>) > show options
6+
... show and set options ...
7+
msf <%= mod.type %>(<%= mod.shortname %>) > set RHOSTS ip-range
8+
msf <%= mod.type %>(<%= mod.shortname %>) > exploit
9+
```
10+
11+
Other examples of setting the RHSOTS option:
12+
13+
Example 1:
14+
15+
```
16+
msf <%= mod.type %>(<%= mod.shortname %>) > set RHOSTS 192.168.1.3-192.168.1.200
17+
```
18+
19+
Example 2:
20+
21+
```
22+
msf <%= mod.type %>(<%= mod.shortname %>) > set RHOSTS 192.168.1.1/24
23+
```
24+
25+
Example 3:
26+
27+
```
28+
msf <%= mod.type %>(<%= mod.shortname %>) > set RHOSTS file:///tmp/ip_list.txt
29+
```
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
```
2+
msf > use <%= mod.fullname %>
3+
msf <%= mod.type %>(<%= mod.shortname %>) > run
4+
```
5+
6+
This module is also supported by Browser Autopwn 2.
7+
8+
To load it from Browser Autopwn 2, here's how:
9+
10+
```
11+
msf > use auxiliary/server/browser_autopwn2
12+
msf auxiliary(browser_autopwn2) > set INCLUDE_PATTERN <%= mod.shortname %>
13+
INCLUDE_PATTERN => <%= mod.shortname %>
14+
msf auxiliary(browser_autopwn2) > exploit
15+
```
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
## <%= items[:mod_name] %>
2+
<p>
3+
<%= normalize_description(items[:mod_description]) %>
4+
</p>
5+
6+
## Module Name
7+
8+
<%= Rex::Text.html_encode(items[:mod_fullname]) %>
9+
10+
## Authors
11+
12+
<%= normalize_authors(items[:mod_authors]) %>
13+
14+
<% unless items[:mod_platforms].empty? %>
15+
## Platforms
16+
<%= normalize_platforms(items[:mod_platforms]) %>
17+
<% end %>
18+
19+
## Reliability
20+
21+
<%= normalize_rank(items[:mod_rank]) %>
22+
23+
## Related Pull Requests
24+
25+
<%= normalize_pull_requests(items[:mod_pull_requests]) %>
26+
27+
<% unless items[:mod_refs].empty? %>
28+
## References
29+
30+
<%= normalize_references(items[:mod_refs]) %>
31+
<% end %>
32+
33+
<% if items[:mod_targets] %>
34+
## Available Targets
35+
36+
<%= normalize_targets(items[:mod_targets]) %>
37+
38+
<% end %>
39+
40+
## Required Options
41+
42+
<% if normalize_options(items[:mod_options]).empty? %>
43+
No options required.
44+
<% else %>
45+
<%= normalize_options(items[:mod_options]) %>
46+
<% end %>
47+
48+
## Basic Usage
49+
50+
<%= normalize_demo_output(items[:mod_demo]) %>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
```
2+
msf > use <%= mod.fullname %>
3+
msf <%= mod.type %>(<%= mod.shortname %>) > show targets
4+
... a list of targets ...
5+
msf <%= mod.type %>(<%= mod.shortname %>) > set TARGET target-id
6+
msf <%= mod.type %>(<%= mod.shortname %>) > show options
7+
... show and set options ...
8+
msf <%= mod.type %>(<%= mod.shortname %>) > exploit
9+
```

data/markdown_doc/html_template.erb

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<html>
2+
<head>
3+
<% unless kb.empty? %>
4+
<script>
5+
function showOverview() {
6+
var overview_info_button = document.getElementById('overview_info_button');
7+
overview_info_button.style.borderColor = "#ccc";
8+
overview_info_button.style.color = "#333";
9+
var knowledge_base_button = document.getElementById('knowledge_base_button');
10+
knowledge_base_button.style.borderColor = "#EEEEEE";
11+
knowledge_base_button.style.color = "#C4C4C4";
12+
document.getElementById('knowledge_base').style.display = "none";
13+
document.getElementById('overview_info').style.display = "inline";
14+
}
15+
16+
function showKnowledge() {
17+
var overview_info_button = document.getElementById('overview_info_button');
18+
overview_info_button.style.borderColor = "#EEEEEE";
19+
overview_info_button.style.color = "#C4C4C4";
20+
var knowledge_base_button = document.getElementById('knowledge_base_button');
21+
knowledge_base_button.style.borderColor = "#ccc";
22+
knowledge_base_button.style.color = "#333";
23+
document.getElementById('overview_info').style.display = "none";
24+
document.getElementById('knowledge_base').style.display = "inline";
25+
}
26+
</script>
27+
<% end %>
28+
<style>
29+
<%= load_css %>
30+
</style>
31+
</head>
32+
<body>
33+
<% unless kb.empty? %>
34+
<table border="0">
35+
<tr>
36+
<th>
37+
<div id="overview_info_button" onClick="showOverview()">Overview</a>
38+
</th>
39+
<th>
40+
<div id="knowledge_base_button" onClick="showKnowledge()">Knowledge Base</a>
41+
</th>
42+
</tr></table>
43+
<p></p>
44+
<% end %>
45+
<div id="overview_info">
46+
<%= r.render(md) %>
47+
</div>
48+
<% unless kb.empty? %>
49+
<div id="knowledge_base">
50+
<%= r.render(kb) %>
51+
</div>
52+
<% end %>
53+
</body>
54+
</html>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
```
2+
msf > use <%= mod.fullname %>
3+
msf <%= mod.type %>(<%= mod.shortname %>) > exploit
4+
```
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Note: To run a local exploit, make sure you are at the msf prompt.
2+
Also, to check the session ID, use the ```sessions``` command.
3+
4+
5+
```
6+
msf > use <%= mod.fullname %>
7+
msf <%= mod.type %>(<%= mod.shortname %>) > show targets
8+
... a list of targets ...
9+
msf <%= mod.type %>(<%= mod.shortname %>) > set TARGET target-id
10+
msf <%= mod.type %>(<%= mod.shortname %>) > show options
11+
... show and set options ...
12+
msf <%= mod.type %>(<%= mod.shortname %>) > set SESSION session-id
13+
msf <%= mod.type %>(<%= mod.shortname %>) > exploit
14+
```

0 commit comments

Comments
 (0)