class ExploitRunDescription
Attributes
connection_url[RW]
device_ip_to_scan[RW]
exploit_speed[RW]
limit_sessions[RW]
module_filter[RW]
nexpose_console_name[RW]
port[RW]
raw_device_ip_to_scan[RW]
report_type[RW]
ssl_version[RW]
token[RW]
uri[RW]
use_os_filter[RW]
use_ssl[RW]
whitelist_hosts[RW]
workspace_name[RW]
Public Class Methods
new(options)
click to toggle source
# File lib/metasploit/exploit_run_description.rb, line 29 def initialize(options) if File.file?('config/exploit.yml') options = YAML.load_file('config/exploit.yml') elsif options.instance_of? Array options = CommandLineArgumentParser.parse(options) end self.connection_url = options['connection_url'] @@port_value = options['port'] @@uri_value = options['uri'] @@use_ssl_value = options['use_ssl'] @@ssl_version = options['ssl_version'] self.token = options['token'] self.workspace_name = options['workspace_name'] self.nexpose_console_name = options['nexpose_console_name'] @@device_ip_to_scan_value = options['device_ip_to_scan'] self.raw_device_ip_to_scan = options['device_ip_to_scan'] self.use_os_filter = options['use_os_filter'] self.module_filter = options['module_filter'] self.report_type = options['report_type'] self.whitelist_hosts = options['whitelist_hosts'] self.exploit_speed = options['exploit_speed'] || 5 self.limit_sessions = options['limit_sessions'].nil? ? true : options['limit_sessions'] end
Public Instance Methods
device_ip_to_scan=(value)
click to toggle source
# File lib/metasploit/exploit_run_description.rb, line 71 def device_ip_to_scan=(value) if !@@device_ip_to_scan_value.nil? @@device_ip_to_scan_value = value.strip! end end
get_audit_options()
click to toggle source
# File lib/metasploit/exploit_run_description.rb, line 77 def get_audit_options { "workspace" => self.workspace_name, "DS_URLS" => self.device_ip_to_scan, "DS_MAX_REQUESTS" => 1000, "DS_MAX_MINUTES" => 3, "DS_MAX_THREADS" => 5, "DS_MAX_INSTANCES" => 3} end
get_discover_options()
click to toggle source
# File lib/metasploit/exploit_run_description.rb, line 110 def get_discover_options { 'workspace' => self.workspace_name, 'ips' => [self.raw_device_ip_to_scan] } end
get_exploit_options()
click to toggle source
# File lib/metasploit/exploit_run_description.rb, line 86 def get_exploit_options { "workspace" => self.workspace_name, "DS_WHITELIST_HOSTS" => self.whitelist_hosts, "DS_MinimumRank" => "great", "DS_EXPLOIT_SPEED" => self.exploit_speed, "DS_EXPLOIT_TIMEOUT" => 2, "DS_LimitSessions" => self.limit_sessions, "DS_MATCH_VULNS" => true, "DS_MATCH_PORTS" => true, "DS_FilterByOS" => self.use_os_filter, "DS_ModuleFilter" => self.module_filter} end
get_options()
click to toggle source
# File lib/metasploit/exploit_run_description.rb, line 61 def get_options {:host => self.connection_url, :port => self.port, :token => self.token, :uri => self.uri, :ssl => self.use_ssl, :ssl_version => self.ssl_version } end
get_report_options()
click to toggle source
# File lib/metasploit/exploit_run_description.rb, line 99 def get_report_options { 'workspace' => self.workspace_name, 'name' => self.workspace_name, 'report_type' => self.report_type, 'created_by' => self.workspace_name, 'file_formats' => [:pdf], 'included_addresses' => self.whitelist_hosts } end
get_value(value_to_check, default)
click to toggle source
# File lib/metasploit/exploit_run_description.rb, line 173 def get_value(value_to_check, default) (value_to_check.nil? || value_to_check.empty?) ? default : value_to_check end
port=(value)
click to toggle source
# File lib/metasploit/exploit_run_description.rb, line 132 def port=(value) @@port_value = value end
ssl_version=(value)
click to toggle source
# File lib/metasploit/exploit_run_description.rb, line 156 def ssl_version=(value) @@ssl_version = value end
to_bool(str)
click to toggle source
# File lib/metasploit/exploit_run_description.rb, line 177 def to_bool(str) str == true || str == 'true' end
uri=(value)
click to toggle source
# File lib/metasploit/exploit_run_description.rb, line 140 def uri=(value) @@uri_value = value end
use_os_filter=(value)
click to toggle source
# File lib/metasploit/exploit_run_description.rb, line 164 def use_os_filter=(value) @@use_os_filter_value = value end
use_ssl=(value)
click to toggle source
# File lib/metasploit/exploit_run_description.rb, line 148 def use_ssl=(value) @@use_ssl_value = value end
verify()
click to toggle source
# File lib/metasploit/exploit_run_description.rb, line 54 def verify raise StandardError, CONSTANTS::REQUIRED_TOKEN_MESSAGE if token.nil? || token.empty? raise StandardError, CONSTANTS::REQUIRED_CONNECTION_URL_MESSAGE if connection_url.nil? || connection_url.empty? raise StandardError, CONSTANTS::REQUIRED_DEVICE_IP_TO_SCAN_MESSAGE if device_ip_to_scan.nil? || device_ip_to_scan.empty? raise StandardError, CONSTANTS::REQUIRED_WORKSPACE_MESSAGE if workspace_name.nil? || workspace_name.empty? end