CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!
CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!
Path: blob/master/lib/metasploit/framework/parsed_options/console.rb
Views: 1904
# Parsed options for {Metasploit::Framework::Command::Console}1class Metasploit::Framework::ParsedOptions::Console < Metasploit::Framework::ParsedOptions::Base2# Options parsed from msfconsole command-line.3#4# @return [ActiveSupport::OrderedOptions]5def options6unless @options7super.tap { |options|8options.console = ActiveSupport::OrderedOptions.new910options.console.commands = []11options.console.confirm_exit = false12options.console.histfile = nil13options.console.logger = nil14options.console.local_output = nil15options.console.plugins = []16options.console.quiet = false17options.console.readline = true18options.console.resources = []19options.console.subcommand = :run20}21end2223@options24end2526private2728# Parses msfconsole arguments into {#options}.29#30# @return [OptionParser]31def option_parser32unless @option_parser33super.tap { |option_parser|34option_parser.banner = "Usage: #{option_parser.program_name} [options]"3536option_parser.separator 'Console options:'3738option_parser.on('-a', '--ask', "Ask before exiting Metasploit or accept 'exit -y'") do39options.console.confirm_exit = true40end4142option_parser.on('-H', '--history-file FILE', 'Save command history to the specified file') do |file|43options.console.histfile = file44end4546option_parser.on('-l', '--logger STRING', "Specify a logger to use (#{Rex::Logging::LogSinkFactory.available_sinks.join(', ')})") do |logger|47options.console.logger = logger48end4950option_parser.on('--[no-]readline') do |readline|51options.console.readline = readline52end5354option_parser.on('-L', '--real-readline', 'Use the system Readline library instead of RbReadline') do55message = "The RealReadline option has been marked as deprecated, and is currently a noop.\n"56message << "Metasploit Framework now uses Reline exclusively as the input handling library.\n"57message << "If you require this functionality, please use the following link to tell us:\n"58message << ' https://github.com/rapid7/metasploit-framework/issues/19399'59warn message60end6162option_parser.on('-o', '--output FILE', 'Output to the specified file') do |file|63options.console.local_output = file64end6566option_parser.on('-p', '--plugin PLUGIN', 'Load a plugin on startup') do |plugin|67options.console.plugins << plugin68end6970option_parser.on('-q', '--quiet', 'Do not print the banner on startup') do71options.console.quiet = true72end7374option_parser.on('-r', '--resource FILE', 'Execute the specified resource file (- for stdin)') do |file|75options.console.resources << file76end7778option_parser.on(79'-x',80'--execute-command COMMAND',81'Execute the specified console commands (use ; for multiples)'82) do |commands|83options.console.commands += commands.split(/\s*;\s*/)84end85}86end8788@option_parser89end90end919293