add help command
This commit is contained in:
4
beef
4
beef
@@ -39,6 +39,10 @@ $root_dir = File.join(File.expand_path(File.dirname(File.realpath(__FILE__))), '
|
|||||||
$:.unshift($root_dir)
|
$:.unshift($root_dir)
|
||||||
$home_dir = File.expand_path("#{Dir.home}/.beef/", __FILE__).freeze
|
$home_dir = File.expand_path("#{Dir.home}/.beef/", __FILE__).freeze
|
||||||
|
|
||||||
|
# @note Parse BeEF CLI options early (prevents Rack help from taking over)
|
||||||
|
require 'core/main/console/commandline'
|
||||||
|
BeEF::Core::Console::CommandLine.parse
|
||||||
|
|
||||||
#
|
#
|
||||||
# @note Require core loader
|
# @note Require core loader
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
# Browser Exploitation Framework (BeEF) - https://beefproject.com
|
# Browser Exploitation Framework (BeEF) - https://beefproject.com
|
||||||
# See the file 'doc/COPYING' for copying permission
|
# See the file 'doc/COPYING' for copying permission
|
||||||
#
|
#
|
||||||
|
require 'optparse'
|
||||||
|
|
||||||
module BeEF
|
module BeEF
|
||||||
module Core
|
module Core
|
||||||
module Console
|
module Console
|
||||||
@@ -38,7 +40,7 @@ module BeEF
|
|||||||
@options[:verbose] = true
|
@options[:verbose] = true
|
||||||
end
|
end
|
||||||
|
|
||||||
opts.on('-a', '--ascii_art', 'Prints BeEF ascii art') do
|
opts.on('-a', '--ascii-art', 'Prints BeEF ascii art') do
|
||||||
@options[:ascii_art] = true
|
@options[:ascii_art] = true
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -54,14 +56,22 @@ module BeEF
|
|||||||
@options[:ws_port] = ws_port
|
@options[:ws_port] = ws_port
|
||||||
end
|
end
|
||||||
|
|
||||||
opts.on('-ud', '--update_disabled', 'Skips update') do
|
opts.on('-d', '--update-disabled', 'Skips update') do
|
||||||
@options[:update_disabled] = true
|
@options[:update_disabled] = true
|
||||||
end
|
end
|
||||||
|
|
||||||
opts.on('-ua', '--update_auto', 'Automatic update with no prompt') do
|
opts.on('-u', '--update-auto', 'Automatic update with no prompt') do
|
||||||
@options[:update_auto] = true
|
@options[:update_auto] = true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
opts.on('-h', '--help', 'Show this help') do
|
||||||
|
puts opts
|
||||||
|
exit 0
|
||||||
|
end
|
||||||
|
|
||||||
|
# opts.on('-i', '--interactive', 'Starts with the Console Shell activated') do
|
||||||
|
# @options[:interactive] = true
|
||||||
|
# end
|
||||||
end
|
end
|
||||||
|
|
||||||
optparse.parse!
|
optparse.parse!
|
||||||
|
|||||||
Reference in New Issue
Block a user