Add compatible session types to post module info

bug/bundler_fix
William Vu 2017-10-11 16:12:39 -05:00
parent 8cfd4928ed
commit f556a5f805
2 changed files with 23 additions and 5 deletions

View File

@ -165,6 +165,7 @@ class ReadableText
output << " Name: #{mod.name}\n"
output << " Module: #{mod.fullname}\n"
output << " Platform: #{mod.platform_to_s}\n"
output << " Arch: #{mod.arch_to_s}\n"
output << " Privileged: " + (mod.privileged? ? "Yes" : "No") + "\n"
output << " License: #{mod.license}\n"
output << " Rank: #{mod.rank_to_s.capitalize}\n"
@ -275,11 +276,20 @@ class ReadableText
# Authors
output << "Provided by:\n"
mod.each_author { |author|
mod.each_author.each do |author|
output << indent + author.to_s + "\n"
}
end
output << "\n"
# Compatible session types
if mod.session_types
output << "Compatible session types:\n"
mod.session_types.sort.each do |type|
output << indent + type.capitalize + "\n"
end
output << "\n"
end
# Actions
if mod.action
output << "Available actions:\n"

View File

@ -20,7 +20,8 @@ module Msf::PostMixin
] , Msf::Post)
# Default stance is active
self.passive = (info['Passive'] and info['Passive'] == true) || false
self.passive = info['Passive'] || false
self.session_types = info['SessionTypes'] || []
end
#
@ -161,8 +162,8 @@ module Msf::PostMixin
return false if s.nil?
# Can't be compatible if it's the wrong type
if self.module_info["SessionTypes"]
return false unless self.module_info["SessionTypes"].include?(s.type)
if session_types
return false unless session_types.include?(s.type)
end
# Types are okay, now check the platform.
@ -189,9 +190,16 @@ module Msf::PostMixin
# @see passive?
attr_reader :passive
#
# A list of compatible session types
#
# @return [Array]
attr_reader :session_types
protected
attr_writer :passive
attr_writer :session_types
def session_changed?
@ds_session ||= datastore["SESSION"]