Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Path: blob/master/lib/metasploit/framework/parsed_options/console.rb
Views: 15919
# 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 << "If you require this functionality, please use the following link to tell us:\n"57message << ' https://github.com/rapid7/metasploit-framework/issues/19399'58warn message59end6061option_parser.on('-o', '--output FILE', 'Output to the specified file') do |file|62options.console.local_output = file63end6465option_parser.on('-p', '--plugin PLUGIN', 'Load a plugin on startup') do |plugin|66options.console.plugins << plugin67end6869option_parser.on('-q', '--quiet', 'Do not print the banner on startup') do70options.console.quiet = true71end7273option_parser.on('-r', '--resource FILE', 'Execute the specified resource file (- for stdin)') do |file|74options.console.resources << file75end7677option_parser.on(78'-x',79'--execute-command COMMAND',80'Execute the specified console commands (use ; for multiples)'81) do |commands|82options.console.commands += commands.split(/\s*;\s*/)83end84}85end8687@option_parser88end89end909192