File tree Expand file tree Collapse file tree 3 files changed +27
-7
lines changed Expand file tree Collapse file tree 3 files changed +27
-7
lines changed Original file line number Diff line number Diff line change @@ -165,6 +165,7 @@ def self.dump_exploit_module(mod, indent = '')
165
165
output << " Name: #{ mod . name } \n "
166
166
output << " Module: #{ mod . fullname } \n "
167
167
output << " Platform: #{ mod . platform_to_s } \n "
168
+ output << " Arch: #{ mod . arch_to_s } \n "
168
169
output << " Privileged: " + ( mod . privileged? ? "Yes" : "No" ) + "\n "
169
170
output << " License: #{ mod . license } \n "
170
171
output << " Rank: #{ mod . rank_to_s . capitalize } \n "
@@ -275,11 +276,20 @@ def self.dump_post_module(mod, indent = '')
275
276
276
277
# Authors
277
278
output << "Provided by:\n "
278
- mod . each_author { |author |
279
+ mod . each_author . each do |author |
279
280
output << indent + author . to_s + "\n "
280
- }
281
+ end
281
282
output << "\n "
282
283
284
+ # Compatible session types
285
+ if mod . session_types
286
+ output << "Compatible session types:\n "
287
+ mod . session_types . sort . each do |type |
288
+ output << indent + type . capitalize + "\n "
289
+ end
290
+ output << "\n "
291
+ end
292
+
283
293
# Actions
284
294
if mod . action
285
295
output << "Available actions:\n "
Original file line number Diff line number Diff line change @@ -29,9 +29,13 @@ class Failed < RuntimeError
29
29
30
30
def setup
31
31
m = replicant
32
+
32
33
if m . actions . length > 0 && !m . action
33
34
raise Msf ::MissingActionError , "Please use: #{ m . actions . collect { |e | e . name } * ", " } "
34
35
end
36
+
37
+ # PostMixin
38
+ super
35
39
end
36
40
37
41
def type
Original file line number Diff line number Diff line change @@ -20,7 +20,8 @@ def initialize(info={})
20
20
] , Msf ::Post )
21
21
22
22
# Default stance is active
23
- self . passive = ( info [ 'Passive' ] and info [ 'Passive' ] == true ) || false
23
+ self . passive = info [ 'Passive' ] || false
24
+ self . session_types = info [ 'SessionTypes' ] || [ ]
24
25
end
25
26
26
27
#
@@ -38,8 +39,6 @@ def setup
38
39
print_warning ( 'SESSION may not be compatible with this module.' )
39
40
end
40
41
41
- super
42
-
43
42
check_for_session_readiness ( ) if session . type == "meterpreter"
44
43
45
44
@session . init_ui ( self . user_input , self . user_output )
@@ -161,8 +160,8 @@ def session_compatible?(sess_or_sid)
161
160
return false if s . nil?
162
161
163
162
# Can't be compatible if it's the wrong type
164
- if self . module_info [ "SessionTypes" ]
165
- return false unless self . module_info [ "SessionTypes" ] . include? ( s . type )
163
+ if session_types
164
+ return false unless session_types . include? ( s . type )
166
165
end
167
166
168
167
# Types are okay, now check the platform.
@@ -189,9 +188,16 @@ def session_compatible?(sess_or_sid)
189
188
# @see passive?
190
189
attr_reader :passive
191
190
191
+ #
192
+ # A list of compatible session types
193
+ #
194
+ # @return [Array]
195
+ attr_reader :session_types
196
+
192
197
protected
193
198
194
199
attr_writer :passive
200
+ attr_writer :session_types
195
201
196
202
def session_changed?
197
203
@ds_session ||= datastore [ "SESSION" ]
You can’t perform that action at this time.
0 commit comments