From 6383f8670b7ae837c2e40397b78a2c5761584faf Mon Sep 17 00:00:00 2001 From: Ben Waugh Date: Sun, 6 May 2012 11:46:22 +1000 Subject: [PATCH] Install Script Script to install prerequisites for OSX/Debian/RHEL, download latest Beef script, install required gems and start beef --- install-beef | 147 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 147 insertions(+) create mode 100644 install-beef diff --git a/install-beef b/install-beef new file mode 100644 index 000000000..2c2401b20 --- /dev/null +++ b/install-beef @@ -0,0 +1,147 @@ +# +# Copyright 2012 Wade Alcorn wade@bindshell.net +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +clear +echo "======================================" +echo " BeEF Installer " +echo "======================================" +echo "" +echo "Detecting OS.."; + + +OS=`uname` + +if [ "${OS}" = "Linux" ] ; then + if [ -f /etc/redhat-release ] ; then + Distro='RedHat' + elif [ -f /etc/debian_version ] ; then + Distro='Debian' + fi + readonly OS + readonly Distro +fi + +if [ "$OS" == "Darwin" ]; then + echo "Mac OSX Detected" + echo "Installing Ruby Version Manager (RVM) & Ruby 1.9.3.." + bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer) + source ~/.bash_login + rvm install 1.9.3-p0 --with-gcc=clang + rvm use 1.9.3-p0 + echo "" + echo "Downloading BeEF.." + + git clone git://github.com/beefproject/beef.git + cd beef + + echo "" + echo "Installing Ruby Gems.." + bundle install + OK="yes" + + cd beef + ./beef + + echo "" + echo "==========================================" + echo " Install Complete" + echo "Please restart Terminal and Run BeEF with:" + echo " $ ./beef " + echo "==========================================" + echo "" + +fi + +if [ "$Distro" == "Debian" ]; then + echo "Debian/Ubuntu Detected" + echo "Installing Prerequisite Packages.." + sudo apt-get update + sudo apt-get install ruby1.9.1-dev build-essential libsqlite3-ruby libsqlite3-dev build-essential libsqlite3-ruby git libsqlite3-dev rake + + echo "Downloading BeEF.." + git clone git://github.com/beefproject/beef.git + cd beef + + echo "Installing Ruby Gems" + sudo gem install bundler + sudo bundle install + + cd beef + ./beef + + OK="yes" + echo "" + echo "==========================================" + echo " Install Complete" + echo "==========================================" + echo "" +fi + + +if [ "$Distro" == "RedHat" ]; then + echo "Redhat/Fedora Detected" + echo "Installing Prerequisite Packages.." + sudo yum install -y git make gcc openssl-devel gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel bzip2 autoconf automake libtool bison iconv-devel sqlite-devel + + echo "" + echo "Installing Ruby Version Manager (RVM) & Ruby 1.9.2" + wget https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer + bash ./rvm-installer + source ~/.rvm/scripts/rvm + rvm pkg install openssl + rvm install 1.9.2 --with-openssl-dir=$rvm_path/usr + source ~/.rvm/scripts/rvm + rvm use 1.9.2 --default + + echo "Downloading BeEF.." + git clone git://github.com/beefproject/beef.git + cd beef + + gem install bundler + bundle + + source ~/.bash_profile + + cd beef + ./beef + + OK="yes" + echo "" + echo "==========================================" + echo " Install Complete" + echo "==========================================" + echo "" + +fi + +if [ "$OK" == "yes" ]; then + +else + echo "" + echo "=======================================" + echo " Install Failed" + echo "Unable to locate installer for your OS:" + echo $OS + echo $Distro + echo "=======================================" + echo "" +fi + + + + + +