From fe14601dfcb665049e2d620765e7eec37bf3e50f Mon Sep 17 00:00:00 2001 From: Christian Frichot Date: Sun, 27 Apr 2014 07:12:53 +0800 Subject: [PATCH] Added -i --interactive option at commandline to launch console shell --- beef | 5 +++++ core/main/console/commandline.rb | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/beef b/beef index 2aa781350..30f446051 100755 --- a/beef +++ b/beef @@ -58,6 +58,11 @@ unless BeEF::Core::Console::CommandLine.parse[:ws_port].empty? config.set('beef.http.websocket.port', BeEF::Core::Console::CommandLine.parse[:ws_port]) end +# @note Check if interactive was specified from the command line, therefore override the extension to enable +if BeEF::Core::Console::CommandLine.parse[:interactive] == true + config.set('beef.extension.console.shell.enable',true) +end + # @note Prints BeEF welcome message BeEF::Core::Console::Banners.print_welcome_msg diff --git a/core/main/console/commandline.rb b/core/main/console/commandline.rb index f61af94b1..5dadde941 100644 --- a/core/main/console/commandline.rb +++ b/core/main/console/commandline.rb @@ -18,6 +18,7 @@ module BeEF @options[:ext_config] = "" @options[:port] = "" @options[:ws_port] = "" + @options[:interactive] = false @already_parsed = false @@ -54,6 +55,10 @@ module BeEF opts.on('-w', '--wsport WS_PORT', 'Change the default BeEF WebSocket listening port') do |ws_port| @options[:ws_port] = ws_port end + + opts.on('-i', '--interactive', 'Starts with the Console Shell activated') do + @options[:interactive] = true + end end optparse.parse!