Compare commits

...
Author SHA1 Message Date
marc 660ba64d0b healthcheck 2022-02-24 17:40:31 +01:00
dependabot[bot] 1c7a6e9fef Bump selenium-webdriver from 3.142.7 to 4.1.0 (#2260)
Bumps [selenium-webdriver](https://github.com/SeleniumHQ/selenium) from 3.142.7 to 4.1.0.
- [Release notes](https://github.com/SeleniumHQ/selenium/releases)
- [Changelog](https://github.com/SeleniumHQ/selenium/blob/trunk/rb/CHANGES)
- [Commits](https://github.com/SeleniumHQ/selenium/commits/selenium-4.1.0)

---
updated-dependencies:
- dependency-name: selenium-webdriver
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-22 22:29:00 +10:00
karlmanait f104a5daff Update ruby version in Dockerfile (#2305)
* Update ruby version in Dockerfile
2022-02-22 20:15:04 +10:00
dependabot[bot] 216d312ebe Bump sinatra from 2.1.0 to 2.2.0 (#2298)
Bumps [sinatra](https://github.com/sinatra/sinatra) from 2.1.0 to 2.2.0.
- [Release notes](https://github.com/sinatra/sinatra/releases)
- [Changelog](https://github.com/sinatra/sinatra/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sinatra/sinatra/compare/v2.1.0...v2.2.0)

---
updated-dependencies:
- dependency-name: sinatra
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-22 11:33:02 +10:00
Molese 9b277a0276 Format scripts with shfmt and fix two issues identified by shellcheck (#2303)
* install: format script with `shfmt`

Signed-off-by: molese <molese@protonmail.com>

* install: double quote `GITACTIONS` variable to prevent word splitting (SC2086)

Signed-off-by: molese <molese@protonmail.com>

* install: replace `! -z` with `-n` (SC2236)

Signed-off-by: molese <molese@protonmail.com>

* update-beef: format script with `shfmt`

Signed-off-by: molese <molese@protonmail.com>

* scripts/bump-version.sh: format script with `shfmt`

Signed-off-by: molese <molese@protonmail.com>
2022-02-18 19:01:47 +11:00
dependabot[bot] c7a3d4c032 Bump otr-activerecord from 2.0.4 to 2.1.1 (#2291)
Bumps [otr-activerecord](https://github.com/jhollinger/otr-activerecord) from 2.0.4 to 2.1.1.
- [Release notes](https://github.com/jhollinger/otr-activerecord/releases)
- [Changelog](https://github.com/jhollinger/otr-activerecord/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jhollinger/otr-activerecord/compare/v2.0.4...v2.1.1)

---
updated-dependencies:
- dependency-name: otr-activerecord
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-16 15:21:51 +10:00
dependabot[bot] 1c4ffa33d3 Bump rubocop from 1.25.0 to 1.25.1 (#2293)
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.25.0 to 1.25.1.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.25.0...v1.25.1)

---
updated-dependencies:
- dependency-name: rubocop
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-16 11:18:53 +10:00
dependabot[bot] 908b6a7a0c Bump rspec from 3.10.0 to 3.11.0 (#2294)
Bumps [rspec](https://github.com/rspec/rspec-metagem) from 3.10.0 to 3.11.0.
- [Release notes](https://github.com/rspec/rspec-metagem/releases)
- [Commits](https://github.com/rspec/rspec-metagem/compare/v3.10.0...v3.11.0)

---
updated-dependencies:
- dependency-name: rspec
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-16 10:11:19 +10:00
jcrew99 14d7975c7a Merge pull request #2290 from beefproject/removed_comment
Code Quality #2288 Removed a comment
2022-01-26 19:31:30 +10:00
6 changed files with 250 additions and 267 deletions
+9 -7
View File
@@ -10,20 +10,20 @@
###########################################################################################################
# ---------------------------- Start of Builder 0 - Gemset Build ------------------------------------------
FROM ruby:2.6.3-alpine AS builder
FROM ruby:2.7.5-alpine AS builder
LABEL maintainer="Beef Project: github.com/beefproject/beef"
# Install gems in parallel with 4 workers to expedite build process.=
ARG BUNDLER_ARGS="--jobs=4"
ARG BUNDLER_ARGS="--jobs=4"
# Set gemrc config to install gems without Ruby Index (ri) and Ruby Documentation (rdoc) files
RUN echo "gem: --no-ri --no-rdoc" > /etc/gemrc
COPY . /beef
# Add bundler/gem dependencies and then install
# Add bundler/gem dependencies and then install
RUN apk add --no-cache git curl libcurl curl-dev ruby-dev libffi-dev make g++ gcc musl-dev zlib-dev sqlite-dev && \
bundle install --system --clean --no-cache --gemfile=/beef/Gemfile $BUNDLER_ARGS && \
bundle install --gemfile=/beef/Gemfile $BUNDLER_ARGS && \
# Temp fix for https://github.com/bundler/bundler/issues/6680
rm -rf /usr/local/bundle/cache
@@ -35,7 +35,7 @@ RUN chmod -R a+r /usr/local/bundle
# ---------------------------- Start of Builder 1 - Final Build ------------------------------------------
FROM ruby:2.6.3-alpine
FROM ruby:2.7.5-alpine
LABEL maintainer="Beef Project: github.com/beefproject/beef"
# Create service account to run BeEF
@@ -50,7 +50,7 @@ COPY --from=builder /usr/local/bundle /usr/local/bundle
RUN chown -R beef:beef /beef
# Install BeEF's runtime dependencies
RUN apk add --no-cache curl git build-base openssl readline-dev zlib zlib-dev libressl-dev yaml-dev sqlite-dev sqlite libxml2-dev libxslt-dev autoconf libc6-compat ncurses5 automake libtool bison nodejs
RUN apk add --no-cache curl git build-base openssl readline-dev zlib zlib-dev libressl-dev yaml-dev sqlite-dev sqlite libxml2-dev libxslt-dev autoconf libc6-compat ncurses automake libtool bison nodejs
WORKDIR /beef
@@ -60,5 +60,7 @@ USER beef
# Expose UI, Proxy, WebSocket server, and WebSocketSecure server
EXPOSE 3000 6789 61985 61986
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 CMD [ "curl", "-fS", "localhost:3000" ]
ENTRYPOINT ["/beef/beef"]
# ------------------------------------- End of Builder 1 -------------------------------------------------
# ------------------------------------- End of Builder 1 -------------------------------------------------
+1 -1
View File
@@ -23,7 +23,7 @@ gem 'espeak-ruby', '>= 1.0.4' # Text-to-Voice
gem 'rake', '>= 12.3.3'
gem 'otr-activerecord', '>= 1.4.2'
gem 'sqlite3'
gem 'rubocop', '~> 1.25.0', require: false
gem 'rubocop', '~> 1.25.1', require: false
# Geolocation support
group :geoip do
+31 -30
View File
@@ -1,12 +1,12 @@
GEM
remote: https://rubygems.org/
specs:
activemodel (7.0.1)
activesupport (= 7.0.1)
activerecord (7.0.1)
activemodel (= 7.0.1)
activesupport (= 7.0.1)
activesupport (7.0.1)
activemodel (7.0.2.2)
activesupport (= 7.0.2.2)
activerecord (7.0.2.2)
activemodel (= 7.0.2.2)
activesupport (= 7.0.2.2)
activesupport (7.0.2.2)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
@@ -37,14 +37,14 @@ GEM
rack-test (>= 0.6.3)
regexp_parser (>= 1.5, < 3.0)
xpath (~> 3.2)
childprocess (3.0.0)
childprocess (4.1.0)
coderay (1.1.3)
concurrent-ruby (1.1.9)
console (1.13.1)
fiber-local
curb (1.0.0)
daemons (1.4.1)
diff-lcs (1.4.4)
diff-lcs (1.5.0)
domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0)
em-websocket (0.5.3)
@@ -78,7 +78,7 @@ GEM
http-parser (1.2.3)
ffi-compiler (>= 1.0, < 2.0)
http_parser.rb (0.6.0)
i18n (1.8.11)
i18n (1.10.0)
concurrent-ruby (~> 1.0)
io-console (0.5.9)
io-like (0.3.1)
@@ -109,7 +109,7 @@ GEM
nokogiri (1.12.5)
mini_portile2 (~> 2.6.1)
racc (~> 1.4)
otr-activerecord (2.0.4)
otr-activerecord (2.1.1)
activerecord (>= 4.0, < 7.1)
hashie-forbidden_attributes (~> 0.1)
parallel (1.21.0)
@@ -131,7 +131,7 @@ GEM
rqrcode_core (~> 0.1)
racc (1.6.0)
rack (2.2.3)
rack-protection (2.1.0)
rack-protection (2.2.0)
rack
rack-test (1.1.0)
rack (>= 1.0, < 3)
@@ -139,7 +139,7 @@ GEM
rake (13.0.6)
rdoc (6.4.0)
psych (>= 4.0.0)
regexp_parser (2.2.0)
regexp_parser (2.2.1)
reline (0.3.0)
io-console (~> 0.5)
rest-client (2.1.0)
@@ -150,20 +150,20 @@ GEM
rexml (3.2.5)
rqrcode_core (0.2.0)
rr (3.0.7)
rspec (3.10.0)
rspec-core (~> 3.10.0)
rspec-expectations (~> 3.10.0)
rspec-mocks (~> 3.10.0)
rspec-core (3.10.1)
rspec-support (~> 3.10.0)
rspec-expectations (3.10.1)
rspec (3.11.0)
rspec-core (~> 3.11.0)
rspec-expectations (~> 3.11.0)
rspec-mocks (~> 3.11.0)
rspec-core (3.11.0)
rspec-support (~> 3.11.0)
rspec-expectations (3.11.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0)
rspec-mocks (3.10.2)
rspec-support (~> 3.11.0)
rspec-mocks (3.11.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0)
rspec-support (3.10.2)
rubocop (1.25.0)
rspec-support (~> 3.11.0)
rspec-support (3.11.0)
rubocop (1.25.1)
parallel (~> 1.10)
parser (>= 3.1.0.0)
rainbow (>= 2.2.2, < 4.0)
@@ -172,7 +172,7 @@ GEM
rubocop-ast (>= 1.15.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.15.1)
rubocop-ast (1.15.2)
parser (>= 3.0.1.1)
ruby-progressbar (1.11.0)
ruby2_keywords (0.0.5)
@@ -180,14 +180,15 @@ GEM
rushover (0.3.0)
json
rest-client
selenium-webdriver (3.142.7)
childprocess (>= 0.5, < 4.0)
selenium-webdriver (4.1.0)
childprocess (>= 0.5, < 5.0)
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2)
simple_oauth (0.3.1)
sinatra (2.1.0)
sinatra (2.2.0)
mustermann (~> 1.0)
rack (~> 2.2)
rack-protection (= 2.1.0)
rack-protection (= 2.2.0)
tilt (~> 2.0)
slack-notifier (2.4.0)
sqlite3 (1.4.2)
@@ -280,7 +281,7 @@ DEPENDENCIES
rdoc
rest-client (>= 2.0.1)
rspec
rubocop (~> 1.25.0)
rubocop (~> 1.25.1)
rubyzip (>= 1.2.2)
rushover
selenium-webdriver
+206 -226
View File
@@ -8,285 +8,265 @@
set -euo pipefail
IFS=$'\n\t'
info() { echo -e "\\033[1;36m[INFO]\\033[0m $*"; }
warn() { echo -e "\\033[1;33m[WARNING]\\033[0m $*"; }
fatal() { echo -e "\\033[1;31m[FATAL]\\033[0m $*"; exit 1 ; }
info() { echo -e "\\033[1;36m[INFO]\\033[0m $*"; }
warn() { echo -e "\\033[1;33m[WARNING]\\033[0m $*"; }
fatal() {
echo -e "\\033[1;31m[FATAL]\\033[0m $*"
exit 1
}
RUBYSUFFIX=''
command_exists () {
command_exists() {
command -v "${1}" >/dev/null 2>&1
command -v "${1}" >/dev/null 2>&1
}
get_permission() {
get_permission () {
warn 'This script will install BeEF and its required dependencies (including operating system packages).'
warn 'This script will install BeEF and its required dependencies (including operating system packages).'
read -rp "Are you sure you wish to continue (Y/n)? "
if [ "$(echo "${REPLY}" | tr "[:upper:]" "[:lower:]")" = "n" ] ; then
fatal 'Installation aborted'
fi
read -rp "Are you sure you wish to continue (Y/n)? "
if [ "$(echo "${REPLY}" | tr "[:upper:]" "[:lower:]")" = "n" ]; then
fatal 'Installation aborted'
fi
}
check_os() {
check_os () {
info "Detecting OS..."
info "Detecting OS..."
OS=$(uname)
readonly OS
info "Operating System: $OS"
if [ "${OS}" = "Linux" ] ; then
info "Launching Linux install..."
install_linux
elif [ "${OS}" = "Darwin" ]; then
info "Launching Mac OSX install..."
install_mac
elif [ "${OS}" = "FreeBSD" ]; then
info "Launching FreeBSD install..."
for SUFX in 26 25 24 23
do
if command_exists ruby${SUFX}
then
RUBYSUFFIX=${SUFX}
break
fi
done
install_freebsd
elif [ "${OS}" = "OpenBSD" ]; then
info "Launching OpenBSD install..."
for SUFX in 26 25 24 23
do
if command_exists ruby${SUFX}
then
RUBYSUFFIX=${SUFX}
break
fi
done
install_openbsd
else
fatal "Unable to locate installer for your Operating system: $OS"
fi
OS=$(uname)
readonly OS
info "Operating System: $OS"
if [ "${OS}" = "Linux" ]; then
info "Launching Linux install..."
install_linux
elif [ "${OS}" = "Darwin" ]; then
info "Launching Mac OSX install..."
install_mac
elif [ "${OS}" = "FreeBSD" ]; then
info "Launching FreeBSD install..."
for SUFX in 26 25 24 23; do
if command_exists ruby${SUFX}; then
RUBYSUFFIX=${SUFX}
break
fi
done
install_freebsd
elif [ "${OS}" = "OpenBSD" ]; then
info "Launching OpenBSD install..."
for SUFX in 26 25 24 23; do
if command_exists ruby${SUFX}; then
RUBYSUFFIX=${SUFX}
break
fi
done
install_openbsd
else
fatal "Unable to locate installer for your Operating system: $OS"
fi
}
install_linux() {
install_linux () {
info "Detecting Linux OS distribution..."
info "Detecting Linux OS distribution..."
Distro=''
if [ -f /etc/blackPanther-release ]; then
Distro='blackPanther'
elif [ -f /etc/redhat-release ]; then
Distro='RedHat'
elif [ -f /etc/debian_version ]; then
Distro='Debian'
elif [ -f /etc/alpine-release ]; then
Distro='Alpine'
elif [ -f /etc/os-release ]; then
#DISTRO_ID=$(grep ^ID= /etc/os-release | cut -d= -f2-)
DISTRO_ID=$(cat /etc/os-release | grep ID= | grep -v "BUILD" | grep -v "IMAGE" | cut -d= -f2-)
if [ "${DISTRO_ID}" = 'kali' ]; then
Distro='Kali'
elif [ "${DISTRO_ID}" = 'arch' ] || [ "${DISTRO_ID}" = 'manjaro' ]; then
Distro='Arch'
fi
fi
Distro=''
if [ -f /etc/blackPanther-release ] ; then
Distro='blackPanther'
elif [ -f /etc/redhat-release ] ; then
Distro='RedHat'
elif [ -f /etc/debian_version ] ; then
Distro='Debian'
elif [ -f /etc/alpine-release ] ; then
Distro='Alpine'
elif [ -f /etc/os-release ] ; then
#DISTRO_ID=$(grep ^ID= /etc/os-release | cut -d= -f2-)
DISTRO_ID=$(cat /etc/os-release | grep ID= | grep -v "BUILD" | grep -v "IMAGE" | cut -d= -f2-)
if [ "${DISTRO_ID}" = 'kali' ] ; then
Distro='Kali'
elif [ "${DISTRO_ID}" = 'arch' ] || [ "${DISTRO_ID}" = 'manjaro' ] ; then
Distro='Arch'
fi
fi
if [ -z "${Distro}" ] ; then
fatal "Unable to locate installer for your ${OS} distribution"
fi
readonly Distro
info "OS Distribution: ${Distro}"
info "Installing ${Distro} prerequisite packages..."
if [ "${Distro}" = "Debian" ] || [ "${Distro}" = "Kali" ]; then
sudo apt-get update
sudo apt-get install curl git build-essential openssl libreadline6-dev zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev autoconf libc6-dev libncurses5-dev automake libtool bison nodejs libcurl4-openssl-dev
if command_exists rvm || command_exists rbenv version; then
info "Ruby package Manager exists - Ruby install skipped"
else
info "No Ruby package manager detected - will install Ruby"
sudo apt-get install ruby-dev
fi
elif [ "${Distro}" = "RedHat" ]; then
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 sqlite-devel nodejs
elif [ "${Distro}" = "blackPanther" ]; then
installing --auto git make gcc openssl-devel gcc-c++ patch readline-devel zlib-devel yaml-devel libffi-devel bzip2 autoconf automake libtool bison sqlite-devel nodejs sudo
elif [ "${Distro}" = "Arch" ]; then
sudo pacman -Syu # Updates repo, dependencies, etc.
sudo pacman -S curl git make openssl gcc readline zlib libyaml sqlite bzip2 autoconf automake libtool bison nodejs # Installs dependencies
if command_exists rvm || command_exists rbenv version; then
info "Ruby package Manager exists - Ruby install skipped"
else
info "No Ruby package manager detected - will install Ruby"
sudo pacman -S ruby ruby-rdoc
fi
elif [ "${Distro}" = "Alpine" ]; then
apk update # Updates repo, dependencies, etc.
apk add curl git build-base openssl readline-dev zlib zlib-dev libressl-dev yaml-dev sqlite-dev sqlite libxml2-dev libxslt-dev autoconf libc6-compat ncurses5 automake libtool bison nodejs # Installs dependencies
fi
if [ -z "${Distro}" ]; then
fatal "Unable to locate installer for your ${OS} distribution"
fi
readonly Distro
info "OS Distribution: ${Distro}"
info "Installing ${Distro} prerequisite packages..."
if [ "${Distro}" = "Debian" ] || [ "${Distro}" = "Kali" ]; then
sudo apt-get update
sudo apt-get install curl git build-essential openssl libreadline6-dev zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev autoconf libc6-dev libncurses5-dev automake libtool bison nodejs libcurl4-openssl-dev
if command_exists rvm || command_exists rbenv version; then
info "Ruby package Manager exists - Ruby install skipped"
else
info "No Ruby package manager detected - will install Ruby"
sudo apt-get install ruby-dev
fi
elif [ "${Distro}" = "RedHat" ]; then
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 sqlite-devel nodejs
elif [ "${Distro}" = "blackPanther" ]; then
installing --auto git make gcc openssl-devel gcc-c++ patch readline-devel zlib-devel yaml-devel libffi-devel bzip2 autoconf automake libtool bison sqlite-devel nodejs sudo
elif [ "${Distro}" = "Arch" ]; then
sudo pacman -Syu # Updates repo, dependencies, etc.
sudo pacman -S curl git make openssl gcc readline zlib libyaml sqlite bzip2 autoconf automake libtool bison nodejs # Installs dependencies
if command_exists rvm || command_exists rbenv version; then
info "Ruby package Manager exists - Ruby install skipped"
else
info "No Ruby package manager detected - will install Ruby"
sudo pacman -S ruby ruby-rdoc
fi
elif [ "${Distro}" = "Alpine" ]; then
apk update # Updates repo, dependencies, etc.
apk add curl git build-base openssl readline-dev zlib zlib-dev libressl-dev yaml-dev sqlite-dev sqlite libxml2-dev libxslt-dev autoconf libc6-compat ncurses5 automake libtool bison nodejs # Installs dependencies
fi
}
install_openbsd () {
install_openbsd() {
sudo pkg_add curl git libyaml libxml libxslt bison node ruby${RUBYSUFFIX}-bundler lame espeak
sudo pkg_add curl git libyaml libxml libxslt bison node ruby${RUBYSUFFIX}-bundler lame espeak
}
install_freebsd () {
install_freebsd() {
sudo pkg install curl git libyaml libxslt devel/ruby-gems bison node espeak
sudo pkg install curl git libyaml libxslt devel/ruby-gems bison node espeak
}
install_mac () {
install_mac() {
local mac_deps=(curl git nodejs python3 \
openssl readline libyaml sqlite3 libxml2 \
autoconf ncurses automake libtool \
bison wget)
local mac_deps=(curl git nodejs python3
openssl readline libyaml sqlite3 libxml2
autoconf ncurses automake libtool
bison wget)
if ! command_exists brew; then
fatal "Homebrew (https://brew.sh/) required to install dependencies"
fi
info "Installing dependencies via brew"
if ! command_exists brew; then
fatal "Homebrew (https://brew.sh/) required to install dependencies"
fi
brew update
info "Installing dependencies via brew"
for package in "${mac_deps[@]}"; do
brew update
if brew install "${package}"; then
info "${package} installed"
else
fatal "Failed to install ${package}"
fi
done
for package in "${mac_deps[@]}"; do
if brew install "${package}"; then
info "${package} installed"
else
fatal "Failed to install ${package}"
fi
done
}
check_ruby_version() {
check_ruby_version () {
info 'Detecting Ruby environment...'
info 'Detecting Ruby environment...'
MIN_RUBY_VER='2.5'
if command_exists rvm
then
RUBY_VERSION=$(rvm current | cut -d'-' -f 2)
info "Ruby version ${RUBY_VERSION} is installed"
if RUBY_VERSION -le MIN_RUBY_VER
then
fatal "Ruby version ${RUBY_VERSION} is not supported. Please install Ruby ${MIN_RUBY_VER} (or newer) and restart the installer."
fi
elif command_exists rbenv version
then
RUBY_VERSION=$(rbenv version | cut -d' ' -f 2)
info "Ruby version ${RUBY_VERSION} is installed"
if RUBY_VERSION -le MIN_RUBY_VER
then
fatal "Ruby version ${RUBY_VERSION} is not supported. Please install Ruby ${MIN_RUBY_VER} (or newer) and restart the installer."
fi
elif command_exists ruby${RUBYSUFFIX}
then
RUBY_VERSION=$(ruby${RUBYSUFFIX} -e "puts RUBY_VERSION")
info "Ruby version ${RUBY_VERSION} is installed"
if [ "$(ruby${RUBYSUFFIX} -e "puts RUBY_VERSION.to_f >= ${MIN_RUBY_VER}")" = 'false' ]
then
fatal "Ruby version ${RUBY_VERSION} is not supported. Please install Ruby ${MIN_RUBY_VER} (or newer) and restart the installer."
fi
else
fatal "Ruby is not installed. Please install Ruby ${MIN_RUBY_VER} (or newer) and restart the installer."
fi
MIN_RUBY_VER='2.5'
if command_exists rvm; then
RUBY_VERSION=$(rvm current | cut -d'-' -f 2)
info "Ruby version ${RUBY_VERSION} is installed"
if RUBY_VERSION -le MIN_RUBY_VER; then
fatal "Ruby version ${RUBY_VERSION} is not supported. Please install Ruby ${MIN_RUBY_VER} (or newer) and restart the installer."
fi
elif command_exists rbenv version; then
RUBY_VERSION=$(rbenv version | cut -d' ' -f 2)
info "Ruby version ${RUBY_VERSION} is installed"
if RUBY_VERSION -le MIN_RUBY_VER; then
fatal "Ruby version ${RUBY_VERSION} is not supported. Please install Ruby ${MIN_RUBY_VER} (or newer) and restart the installer."
fi
elif command_exists ruby${RUBYSUFFIX}; then
RUBY_VERSION=$(ruby${RUBYSUFFIX} -e "puts RUBY_VERSION")
info "Ruby version ${RUBY_VERSION} is installed"
if [ "$(ruby${RUBYSUFFIX} -e "puts RUBY_VERSION.to_f >= ${MIN_RUBY_VER}")" = 'false' ]; then
fatal "Ruby version ${RUBY_VERSION} is not supported. Please install Ruby ${MIN_RUBY_VER} (or newer) and restart the installer."
fi
else
fatal "Ruby is not installed. Please install Ruby ${MIN_RUBY_VER} (or newer) and restart the installer."
fi
}
check_rubygems () {
if command_exists gem${RUBYSUFFIX}
then
info 'Updating rubygems...'
sudo gem${RUBYSUFFIX} update --system
fi
check_rubygems() {
if command_exists gem${RUBYSUFFIX}; then
info 'Updating rubygems...'
sudo gem${RUBYSUFFIX} update --system
fi
}
check_bundler () {
check_bundler() {
info 'Detecting bundler gem...'
if command_exists bundler${RUBYSUFFIX}
then
info "bundler${RUBYSUFFIX} gem is installed"
else
info 'Installing bundler gem...'
sudo gem${RUBYSUFFIX} install bundler
fi
info 'Detecting bundler gem...'
if command_exists bundler${RUBYSUFFIX}; then
info "bundler${RUBYSUFFIX} gem is installed"
else
info 'Installing bundler gem...'
sudo gem${RUBYSUFFIX} install bundler
fi
}
install_beef() {
install_beef () {
echo "Installing required Ruby gems..."
echo "Installing required Ruby gems..."
if [ -w Gemfile.lock ]; then
/bin/rm Gemfile.lock
fi
if [ -w Gemfile.lock ]
then
/bin/rm Gemfile.lock
fi
if command_exists bundler${RUBYSUFFIX}
then
bundle${RUBYSUFFIX} install
else
bundle install
fi
if command_exists bundler${RUBYSUFFIX}; then
bundle${RUBYSUFFIX} install
else
bundle install
fi
}
finish () {
echo
echo "#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#"
echo
info "Install completed successfully!"
info "Run './beef' to launch BeEF"
echo
echo "Next steps:"
echo
echo "* Change the default password in config.yaml"
echo "* Configure geoipupdate to update the Maxmind GeoIP database."
echo "* Review the wiki for important configuration information:"
echo " https://github.com/beefproject/beef/wiki/Configuration"
echo
echo "#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#"
echo
finish() {
echo
echo "#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#"
echo
info "Install completed successfully!"
info "Run './beef' to launch BeEF"
echo
echo "Next steps:"
echo
echo "* Change the default password in config.yaml"
echo "* Configure geoipupdate to update the Maxmind GeoIP database."
echo "* Review the wiki for important configuration information:"
echo " https://github.com/beefproject/beef/wiki/Configuration"
echo
echo "#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#"
echo
}
main() {
main () {
clear
clear
if [ -f core/main/console/beef.ascii ]; then
cat core/main/console/beef.ascii
echo
fi
if [ -f core/main/console/beef.ascii ] ; then
cat core/main/console/beef.ascii
echo
fi
echo "#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#"
echo " -- [ BeEF Installer ] -- "
echo "#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#"
echo
echo "#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#"
echo " -- [ BeEF Installer ] -- "
echo "#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#"
echo
if [ ! -z ${GITACTIONS:-} ];
then
info "Skipping: Running on Github Actions"
else
get_permission
fi
check_os
check_ruby_version
check_rubygems
check_bundler
install_beef
finish
if [ -n "${GITACTIONS:-}" ]; then
info "Skipping: Running on Github Actions"
else
get_permission
fi
check_os
check_ruby_version
check_rubygems
check_bundler
install_beef
finish
}
main "$@"
+1 -1
View File
@@ -7,7 +7,7 @@ sed -i '' -e "s/\"version\": \"$1\"/\"version\": \"$2\"/g" package-lock.json
sed -i '' -e "s/\"version\": \"$1\"/\"version\": \"$2\"/g" config.yaml
if [[ "$1" != *"-pre"* ]]; then
sed -i '' -e "s/v$1/v$2/g" .github/ISSUE_TEMPLATE.md
sed -i '' -e "s/v$1/v$2/g" .github/ISSUE_TEMPLATE.md
fi
git add VERSION package.json package-lock.json config.yaml
+2 -2
View File
@@ -7,13 +7,13 @@
set -euo pipefail
IFS=$'\n\t'
info() { echo -e "\\033[1;36m[INFO]\\033[0m $*"; }
info() { echo -e "\\033[1;36m[INFO]\\033[0m $*"; }
info 'Updating BeEF from GitHub repository...'
git pull
info 'Updating dependencies...'
if [ -f Gemfile.lock ]; then
rm Gemfile.lock
rm Gemfile.lock
fi
bundle install