Skip to content

Commit a454217

Browse files
committed
Update info -d markdown
1 parent 37388ca commit a454217

File tree

2,025 files changed

+6160
-6074
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,025 files changed

+6160
-6074
lines changed

data/markdown_doc/default_template.erb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@
6767
<% description = "Module may cause a noise (Examples: audio output from the speakers or hardware beeps)." %>
6868
<% elsif side_effect == "physical-effects" %>
6969
<% description = "Module may produce physical effects (Examples: the device makes movement or flashes LEDs)." %>
70+
<% elsif side_effect == "unknown-side-effects" %>
71+
<% description = "Module side effects are unknown." %>
7072
<% end %>
7173

7274
* **<%= side_effect %>:** <%= description %>
@@ -85,6 +87,8 @@
8587
<% description = "The module isn't expected to get a shell reliably (such as only once)." %>
8688
<% elsif reliability == "event-dependent" %>
8789
<% description = "The module may not execute the payload until an external event occurs. For instance, a cron job, machine restart, user interaction within a GUI element, etc." %>
90+
<% elsif reliability == "unknown-reliability" %>
91+
<% description = "Module reliability is unknown." %>
8892
<% end %>
8993

9094
* **<%= reliability %>:** <%= description %>
@@ -109,6 +113,8 @@
109113
<% description = "Module may cause a resource (such as a file or data in a database) to be unavailable for the service." %>
110114
<% elsif stability == "os-resource-loss" %>
111115
<% description = "Modules may cause a resource (such as a file) to be unavailable for the OS." %>
116+
<% elsif stability == "unknown-stability" %>
117+
<% description = "Module stability is unknown." %>
112118
<% end %>
113119

114120
* **<%= stability %>:** <%= description %>

lib/msf/core/constants.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ module Msf
5555
# Stability traits
5656
#
5757

58-
# Module stability is unknown.
59-
UNKNOWN_STABILITY = 'unknown-stability'
58+
# Module stability is unknown - this is a sentinel value, and is not a valid stability enum value
59+
UNKNOWN_STABILITY = ['unknown-stability']
6060
# Module should not crash the service.
6161
CRASH_SAFE = 'crash-safe'
6262
# Module may crash the service, but the service restarts.
@@ -76,8 +76,8 @@ module Msf
7676
# Side-effect traits
7777
#
7878

79-
# Module side effects are unknown.
80-
UNKNOWN_SIDE_EFFECTS = 'unknown-side-effects'
79+
# Module side effects is unknown - this is a sentinel value, and is not a valid side effect enum value
80+
UNKNOWN_SIDE_EFFECTS = ['unknown-side-effects']
8181
# Modules leaves a payload or a dropper on the target machine.
8282
ARTIFACTS_ON_DISK = 'artifacts-on-disk'
8383
# Module modifies some configuration setting on the target machine.
@@ -99,8 +99,8 @@ module Msf
9999
# Reliability
100100
#
101101

102-
# Module reliability is unknown.
103-
UNKNOWN_RELIABILITY = 'unknown-reliability'
102+
# Module reliability is unknown - this is a sentinel value, and is not a valid reliability enum value
103+
UNKNOWN_RELIABILITY = ['unknown-reliability']
104104
# The module tends to fail to get a session on the first attempt.
105105
FIRST_ATTEMPT_FAIL = 'first-attempt-fail'
106106
# The module is expected to get a shell every time it runs.

lib/rubocop/cop/lint/module_enforce_notes.rb

Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,19 +46,49 @@ def on_def(node)
4646
private
4747

4848
def insert_notes_autocorrect(corrector, hash)
49+
indent, last_pair = calculate_indent(hash)
50+
corrector.insert_after(last_pair.loc.expression, notes_formatted(indent))
51+
end
52+
53+
# def insert_notes_keys_autocorrect(corrector, hash)
54+
# indent, last_pair = calculate_indent(hash)
55+
# corrector.insert_after(last_pair.loc.expression, notes_formatted(indent))
56+
# end
57+
58+
# def insert_missing_notes_keys(corrector, missing_keys, notes)
59+
# indent, last_pair = calculate_indent(notes)
60+
# corrector.insert_after(last_pair.loc.expression, keys_formatted(indent, missing_keys))
61+
# end
62+
63+
def calculate_indent(hash)
4964
last_pair = hash.pairs.last
5065
indent_width = last_pair.loc.expression.column
51-
indent = ' ' * indent_width
52-
corrector.insert_after(last_pair.loc.expression, notes_formatted(indent))
66+
[' ' * indent_width, last_pair]
5367
end
5468

69+
# def keys_formatted(indent, missing_keys)
70+
# keys_to_insert = []
71+
# missing_keys.each do |key|
72+
# case key
73+
# when 'Reliability'
74+
# keys_to_insert << "#{indent}'Reliability' => UNKNOWN_RELIABILITY"
75+
# when 'Stability'
76+
# keys_to_insert << "#{indent}'Stability' => UNKNOWN_STABILITY"
77+
# when 'SideEffects'
78+
# keys_to_insert << "#{indent}'SideEffects' => UNKNOWN_SIDE_EFFECTS"
79+
# end
80+
# end
81+
#
82+
# ",\n#{keys_to_insert.join(",\n")}"
83+
# end
84+
5585
def notes_formatted(indent)
5686
<<~EOF.strip
5787
,
5888
#{indent}'Notes' => {
59-
#{indent} 'Reliability' => [UNKNOWN_RELIABILITY],
60-
#{indent} 'Stability' => [UNKNOWN_STABILITY],
61-
#{indent} 'SideEffects' => [UNKNOWN_SIDE_EFFECTS]
89+
#{indent} 'Reliability' => UNKNOWN_RELIABILITY,
90+
#{indent} 'Stability' => UNKNOWN_STABILITY,
91+
#{indent} 'SideEffects' => UNKNOWN_SIDE_EFFECTS
6292
#{indent}}
6393
EOF
6494
end
@@ -81,6 +111,10 @@ def check_for_required_keys(notes)
81111
msg = missing_keys[0...-1].join(', ') + ' and ' + missing_keys[-1]
82112
end
83113
add_offense(last_key || notes, message: MISSING_KEY_MSG % msg)
114+
115+
# add_offense(last_key || notes, message: MISSING_KEY_MSG % msg) do |corrector|
116+
# insert_missing_notes_keys(corrector, missing_keys, notes)
117+
# end
84118
end
85119
end
86120

modules/auxiliary/fileformat/badpdf.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ def initialize(info = {})
2929
['URL', 'https://research.checkpoint.com/ntlm-credentials-theft-via-pdf-files/']
3030
],
3131
'Notes' => {
32-
'Reliability' => [UNKNOWN_RELIABILITY],
33-
'Stability' => [UNKNOWN_STABILITY],
34-
'SideEffects' => [UNKNOWN_SIDE_EFFECTS]
32+
'Reliability' => UNKNOWN_RELIABILITY,
33+
'Stability' => UNKNOWN_STABILITY,
34+
'SideEffects' => UNKNOWN_SIDE_EFFECTS
3535
}
3636
)
3737
)

modules/auxiliary/gather/advantech_webaccess_creds.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ def initialize(info = {})
2828
],
2929
'DisclosureDate' => '2017-01-21',
3030
'Notes' => {
31-
'Reliability' => [UNKNOWN_RELIABILITY],
32-
'Stability' => [UNKNOWN_STABILITY],
33-
'SideEffects' => [UNKNOWN_SIDE_EFFECTS]
31+
'Reliability' => UNKNOWN_RELIABILITY,
32+
'Stability' => UNKNOWN_STABILITY,
33+
'SideEffects' => UNKNOWN_SIDE_EFFECTS
3434
}
3535
)
3636
)

modules/auxiliary/gather/alienvault_iso27001_sqli.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ def initialize(info = {})
3131
'Privileged' => false,
3232
'DisclosureDate' => '2014-03-30',
3333
'Notes' => {
34-
'Reliability' => [UNKNOWN_RELIABILITY],
35-
'Stability' => [UNKNOWN_STABILITY],
36-
'SideEffects' => [UNKNOWN_SIDE_EFFECTS]
34+
'Reliability' => UNKNOWN_RELIABILITY,
35+
'Stability' => UNKNOWN_STABILITY,
36+
'SideEffects' => UNKNOWN_SIDE_EFFECTS
3737
}
3838
)
3939
)

modules/auxiliary/gather/alienvault_newpolicyform_sqli.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ def initialize(info = {})
3333
'Privileged' => false,
3434
'DisclosureDate' => '2014-05-09',
3535
'Notes' => {
36-
'Reliability' => [UNKNOWN_RELIABILITY],
37-
'Stability' => [UNKNOWN_STABILITY],
38-
'SideEffects' => [UNKNOWN_SIDE_EFFECTS]
36+
'Reliability' => UNKNOWN_RELIABILITY,
37+
'Stability' => UNKNOWN_STABILITY,
38+
'SideEffects' => UNKNOWN_SIDE_EFFECTS
3939
}
4040
)
4141
)

modules/auxiliary/gather/android_browser_file_theft.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ def initialize(info = {})
3131
],
3232
'DefaultAction' => 'WebServer',
3333
'Notes' => {
34-
'Reliability' => [UNKNOWN_RELIABILITY],
35-
'Stability' => [UNKNOWN_STABILITY],
36-
'SideEffects' => [UNKNOWN_SIDE_EFFECTS]
34+
'Reliability' => UNKNOWN_RELIABILITY,
35+
'Stability' => UNKNOWN_STABILITY,
36+
'SideEffects' => UNKNOWN_SIDE_EFFECTS
3737
}
3838
)
3939
)

modules/auxiliary/gather/android_browser_new_tab_cookie_theft.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ def initialize(info = {})
3636
],
3737
'DefaultAction' => 'WebServer',
3838
'Notes' => {
39-
'Reliability' => [UNKNOWN_RELIABILITY],
40-
'Stability' => [UNKNOWN_STABILITY],
41-
'SideEffects' => [UNKNOWN_SIDE_EFFECTS]
39+
'Reliability' => UNKNOWN_RELIABILITY,
40+
'Stability' => UNKNOWN_STABILITY,
41+
'SideEffects' => UNKNOWN_SIDE_EFFECTS
4242
}
4343
)
4444
)

modules/auxiliary/gather/android_htmlfileprovider.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ def initialize(info = {})
3333
],
3434
'DefaultAction' => 'WebServer',
3535
'Notes' => {
36-
'Reliability' => [UNKNOWN_RELIABILITY],
37-
'Stability' => [UNKNOWN_STABILITY],
38-
'SideEffects' => [UNKNOWN_SIDE_EFFECTS]
36+
'Reliability' => UNKNOWN_RELIABILITY,
37+
'Stability' => UNKNOWN_STABILITY,
38+
'SideEffects' => UNKNOWN_SIDE_EFFECTS
3939
}
4040
)
4141
)

0 commit comments

Comments
 (0)