Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/lib/metasploit/framework/parsed_options/console.rb
Views: 11784
# 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.real_readline = false19options.console.resources = []20options.console.subcommand = :run21}22end2324@options25end2627private2829# Parses msfconsole arguments into {#options}.30#31# @return [OptionParser]32def option_parser33unless @option_parser34super.tap { |option_parser|35option_parser.banner = "Usage: #{option_parser.program_name} [options]"3637option_parser.separator 'Console options:'3839option_parser.on('-a', '--ask', "Ask before exiting Metasploit or accept 'exit -y'") do40options.console.confirm_exit = true41end4243option_parser.on('-H', '--history-file FILE', 'Save command history to the specified file') do |file|44options.console.histfile = file45end4647option_parser.on('-l', '--logger STRING', "Specify a logger to use (#{Rex::Logging::LogSinkFactory.available_sinks.join(', ')})") do |logger|48options.console.logger = logger49end5051option_parser.on('--[no-]readline') do |readline|52options.console.readline = readline53end5455option_parser.on('-L', '--real-readline', 'Use the system Readline library instead of RbReadline') do56options.console.real_readline = true57end5859option_parser.on('-o', '--output FILE', 'Output to the specified file') do |file|60options.console.local_output = file61end6263option_parser.on('-p', '--plugin PLUGIN', 'Load a plugin on startup') do |plugin|64options.console.plugins << plugin65end6667option_parser.on('-q', '--quiet', 'Do not print the banner on startup') do68options.console.quiet = true69end7071option_parser.on('-r', '--resource FILE', 'Execute the specified resource file (- for stdin)') do |file|72options.console.resources << file73end7475option_parser.on(76'-x',77'--execute-command COMMAND',78'Execute the specified console commands (use ; for multiples)'79) do |commands|80options.console.commands += commands.split(/\s*;\s*/)81end82}83end8485@option_parser86end87end888990