Version check to ensure BeEF is running Ruby 2.0+

This commit is contained in:
Brendan Coles
2016-01-29 16:25:16 +00:00
parent 5a1b64b97b
commit 485049f4c8
3 changed files with 12 additions and 23 deletions

16
beef
View File

@@ -9,25 +9,17 @@
# stop deprecation warning from being displayed
$VERBOSE = nil
# @note Version check to ensure BeEF is running Ruby 1.9 >
if RUBY_VERSION < '1.9'
# @note Version check to ensure BeEF is running Ruby 2.0+
if RUBY_VERSION < '2.0'
puts "\n"
puts "Ruby version " + RUBY_VERSION + " is no longer supported. Please upgrade 1.9 or later."
puts "OSX:"
puts "See Readme"
puts "Ruby version #{RUBY_VERSION} is no longer supported. Please upgrade to Ruby version 2.0 or later."
puts "\n"
exit
exit 1
end
$:.unshift(File.join(File.expand_path(File.dirname(__FILE__)), '.'))
$root_dir = File.expand_path('..', __FILE__)
# @note Prevent some errors on encoding: encoding handling changed (improved) from 1.8.7 to 1.9.1/2.
if RUBY_VERSION =~ /1.9/
Encoding.default_external = Encoding::UTF_8
Encoding.default_internal = Encoding::UTF_8
end
# @note Require core loader's
require 'core/loader'

11
install
View File

@@ -8,14 +8,11 @@
puts "\nWelcome to the BeEF installer!"
if RUBY_VERSION < '1.9'
if RUBY_VERSION < '2.0'
puts "\n"
puts "Ruby version " + RUBY_VERSION + " is no longer supported. Please upgrade 1.9 or later."
puts ""
puts "OSX:"
puts "See README"
puts "Ruby version #{RUBY_VERSION} is no longer supported. Please upgrade to Ruby version 2.0 or later."
puts "\n"
exit
exit 1
end
puts "\nPlease make sure you have installed SQLite before proceeding. For instructions on how to do this please see the README file"
@@ -26,4 +23,4 @@ puts "\nRun bundler in your BeEF folder: bundle install"
puts "\nRun BeEF: ./beef"
#Testing fork regroup
#Testing fork regroup

View File

@@ -4,12 +4,12 @@
# See the file 'doc/COPYING' for copying permission
#
# @note Version check to ensure BeEF is running Ruby 1.9 >
if RUBY_VERSION < '1.9'
# @note Version check to ensure BeEF is running Ruby 2.0+
if RUBY_VERSION < '2.0'
puts "\n"
puts "Ruby version " + RUBY_VERSION + " is no longer supported. Please upgrade 1.9 or later."
puts "Ruby version #{RUBY_VERSION} is no longer supported. Please upgrade to Ruby version 2.0 or later."
puts "\n"
exit
exit 1
end
begin