beefproject / beef

The Browser Exploitation Framework Project
https://beefproject.com
9.82k stars 2.18k forks source link

Issues with running ./beef (Termux) #2336

Closed Rehan587 closed 1 year ago

Rehan587 commented 2 years ago

I'm facing issues with this when I run this command below.

$ ./beef

/data/data/com.termux/files/usr/lib/ruby/gems/3.1.0/gems/eventmachine-1.2.7/lib/eventmachine.rb:8:in `require': dlopen failed: cannot find "libssl.so" from verneed[0] in DT_NEEDED list for "/data/data/com.termux/files/usr/lib/ruby/gems/3.1.0/gems/eventmachine-1.2.7/lib/rubyeventmachine.so" - /data/data/com.termux/files/usr/lib/ruby/gems/3.1.0/gems/eventmachine-1.2.7/lib/rubyeventmachine.so (LoadError)

   from /data/data/com.termux/files/usr/lib/ruby/gems/3.1.0/gems/eventmachine-1.2.7/lib/eventmachine.rb:8:in `<top (required)>'
        from /data/data/com.termux/files/usr/lib/ruby/site_ruby/3.1.0/bundler/runtime.rb:60:in `require'
        from /data/data/com.termux/files/usr/lib/ruby/site_ruby/3.1.0/bundler/runtime.rb:60:in `block (2 levels) in require'
        from /data/data/com.termux/files/usr/lib/ruby/site_ruby/3.1.0/bundler/runtime.rb:55:in `each'
        from /data/data/com.termux/files/usr/lib/ruby/site_ruby/3.1.0/bundler/runtime.rb:55:in `block in require'
        from /data/data/com.termux/files/usr/lib/ruby/site_ruby/3.1.0/bundler/runtime.rb:44:in `each'
        from /data/data/com.termux/files/usr/lib/ruby/site_ruby/3.1.0/bundler/runtime.rb:44:in `require'
        from /data/data/com.termux/files/usr/lib/ruby/site_ruby/3.1.0/bundler.rb:176:in `require'
        from /data/data/com.termux/files/home/beef/core/loader.rb:16:in `<top (required)>'
        from <internal:/data/data/com.termux/files/usr/lib/ruby/site_ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:/data/data/com.termux/files/usr/lib/ruby/site_ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from ./beef:45:in `<main>

Pls help

Here is my device info:-

Application version:
0.117
Packages CPU architecture:
aarch64
Subscribed repositories:
# sources.list
deb https://grimler.se/termux-packages-24 stable main
# x11-repo (sources.list.d/x11.list)
deb https://grimler.se/x11-packages x11 main
# sources.list.d/termuxblack.list
deb https://hax4us.github.io/TermuxBlack/ termuxblack main
Updatable packages:
All packages up to date
Android version:
11
Kernel build information:
Linux localhost 4.14.186-g4f65b02ee-dirty #1 SMP PREEMPT Thu Dec 16 18:28:32 CST 2021 aarch64 Android
Device manufacturer:
vivo
Device model:
vivo 1915

Extra mentions:-

Ruby version:- ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) [aarch64-linux-android]

Pls help

Did I make changes to the configuration files? Yes, i did change the "install" file to get it adjusted according to the termux environment

steps to reproduce This is what my current install file looks like:-

#!/bin/bash
#
# Copyright (c) 2006-2022 Wade Alcorn - wade@bindshell.net
# Browser Exploitation Framework (BeEF) - http://beefproject.com
# See the file 'doc/COPYING' for copying permission
#

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
}

RUBYSUFFIX=''

command_exists() {

        command -v "${1}" >/dev/null 2>&1
}

get_permission() {

        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

}

check_ruby_version() {

        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 re>
                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 re>
                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 re>
                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...'
                 gem ${RUBYSUFFIX} update --system
/       fi
}

check_bundler() {

        info 'Detecting bundler gem...'

        if command_exists bundler${RUBYSUFFIX}; then
                info "bundler${RUBYSUFFIX} gem is installed"
        else
                info 'Installing bundler gem...'
                gem${RUBYSUFFIX} install bundler
        fi
}

install_beef() {

        echo "Installing required Ruby gems..."

        if [ -w Gemfile.lock ]; then
                $PREFIX/bin/rm Gemfile.lock
        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
}

main() {

        clear

        if [ -f core/main/console/beef.ascii ]; then
                cat core/main/console/beef.ascii
                echo
        fi

        echo "#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#"
        echo "                   -- [ BeEF Installer ] --                      "
        echo "#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#"
        echo

        if [ -n "${GITACTIONS:-}" ]; then
                info "Skipping: Running on Github Actions"
        else
                get_permission
        fi
        check_ruby_version
        check_rubygems
        check_bundler
        install_beef
        finish
}

main "$@"
DeezyE commented 2 years ago

Can you elaborate on your setup? It's an Android phone correct? Are you able to use Ruby 2.7.4 instead of 3.1? We have not yet ironed out kinks with Ruby 3.x

theverygoodwebsite commented 2 years ago

What are you saying that when you put ./beef and then write 127.0.0.1:3000/ui/panel it is saying that it cannot connect

Rehan587 commented 2 years ago

Can you elaborate on your setup? It's an Android phone correct? Are you able to use Ruby 2.7.4 instead of 3.1? We have not yet ironed out kinks with Ruby 3.x

Yes, I'm using Android 11 I used to use Ruby 2.7 earlier and it used to work but with the recent updates in OpenSSL, they don't work out together anymore. Hence, i had to switch to Ruby 3 version.

Pls pardon my English I'm not a native

SGC-GamerZ commented 2 years ago

Can you elaborate on your setup? It's an Android phone correct? Are you able to use Ruby 2.7.4 instead of 3.1? We have not yet ironed out kinks with Ruby 3.x

Yes, I'm using Android 11 I used to use Ruby 2.7 earlier and it used to work but with the recent updates in OpenSSL, they don't work out together anymore. Hence, i had to switch to Ruby 3 version.

Pls pardon my English I'm not a native

Mate there is a full solved closed issue here... #2331... hope it helps!!

SGC-GamerZ commented 2 years ago

Can you elaborate on your setup? It's an Android phone correct? Are you able to use Ruby 2.7.4 instead of 3.1? We have not yet ironed out kinks with Ruby 3.x

Yes, I'm using Android 11 I used to use Ruby 2.7 earlier and it used to work but with the recent updates in OpenSSL, they don't work out together anymore. Hence, i had to switch to Ruby 3 version.

Pls pardon my English I'm not a native

Mate there is a full solved closed issue here... #2331... hope it helps u!

Rehan587 commented 2 years ago

Can you elaborate on your setup? It's an Android phone correct? Are you able to use Ruby 2.7.4 instead of 3.1? We have not yet ironed out kinks with Ruby 3.x

Yes, I'm using Android 11 I used to use Ruby 2.7 earlier and it used to work but with the recent updates in OpenSSL, they don't work out together anymore. Hence, i had to switch to Ruby 3 version.

Pls pardon my English I'm not a native

Mate there is a full solved closed issue here... #2331... hope it helps u!

Didn't work out 😕

SGC-GamerZ commented 2 years ago

Can you elaborate on your setup? It's an Android phone correct? Are you able to use Ruby 2.7.4 instead of 3.1? We have not yet ironed out kinks with Ruby 3.x

Yes, I'm using Android 11 I used to use Ruby 2.7 earlier and it used to work but with the recent updates in OpenSSL, they don't work out together anymore. Hence, i had to switch to Ruby 3 version. Pls pardon my English I'm not a native

Mate there is a full solved closed issue here... #2331... hope it helps u!

Didn't work out 😕

https://www.google.com/url?sa=t&source=web&rct=j&url=https://www.onlinehacking.in/how-to-install-beef-framework-in-termux-linux&ved=2ahUKEwi0iNSq1bb2AhV_73MBHQzsC-0QFnoECAQQAQ&usg=AOvVaw075akIqIDq-jedD2PzowmG

THIS MIGHT SURELY HELP!!

DeezyE commented 2 years ago

Now that's a very specific blog post :)

DeezyE commented 2 years ago

@Rehan587 have you been able to resolve the issue?

Rehan587 commented 2 years ago

@Rehan587 have you been able to resolve the issue?

Not yet unfortunately 😕

It won't be solved until it's not shifted to Ruby V3 or above i guess..

Rehan587 commented 2 years ago

Can you elaborate on your setup? It's an Android phone correct? Are you able to use Ruby 2.7.4 instead of 3.1? We have not yet ironed out kinks with Ruby 3.x

Yes, I'm using Android 11 I used to use Ruby 2.7 earlier and it used to work but with the recent updates in OpenSSL, they don't work out together anymore. Hence, i had to switch to Ruby 3 version. Pls pardon my English I'm not a native

Mate there is a full solved closed issue here... #2331... hope it helps u!

Didn't work out 😕

https://www.google.com/url?sa=t&source=web&rct=j&url=https://www.onlinehacking.in/how-to-install-beef-framework-in-termux-linux&ved=2ahUKEwi0iNSq1bb2AhV_73MBHQzsC-0QFnoECAQQAQ&usg=AOvVaw075akIqIDq-jedD2PzowmG

THIS MIGHT SURELY HELP!!

I've already done these steps..

DeezyE commented 2 years ago

@Rehan587 have you been able to resolve the issue?

Not yet unfortunately 😕

It won't be solved until it's not shifted to Ruby V3 or above i guess..

Others have made it work, though I have not attempted running with Termux, so I cannot comment on how.

Rehan587 commented 2 years ago

@Rehan587 have you been able to resolve the issue?

Not yet unfortunately 😕

It won't be solved until it's not shifted to Ruby V3 or above i guess..

Others have made it work, though I have not attempted running with Termux, so I cannot comment on how.

It used to work earlier, facing this issue since OpenSSL got upgraded.

wheatley commented 2 years ago

@Rehan587, would you be comfortable pull down a branch from our repo and installing manually?

We're currently in the works to upgrade to version 3.x (#2332), so this branch is in beta still, but it may help you with what you're trying to achieve.

Rehan587 commented 2 years ago

@Rehan587, would you be comfortable pull down a branch from our repo and installing manually?

We're currently in the works to upgrade to version 3.x (#2332), so this branch is in beta still, but it may help you with what you're trying to achieve.

How do I do that? I'll be more than happy to test it out but.. I'm sorry I'm a little dumb 😅 If you could provide me with the commands, It will be very nice of you.

DeezyE commented 2 years ago

@Rehan587 follow https://github.com/beefproject/beef/wiki/Installation which is basically clone repo, pull remote branches (https://git-scm.com/book/en/v2/Git-Branching-Remote-Branches) then switch to the remote branch #2332 and then run it.

Emadooz551 commented 2 years ago

~/beef $ ./beef [20:06:21][*] Browser Exploitation Framework (BeEF) 0.5.4.0 [20:06:21] | Twit: @beefproject [20:06:21] | Site: https://beefproject.com [20:06:21] | Blog: http://blog.beefproject.com [20:06:21] |_ Wiki: https://github.com/beefproject/beef/wiki [20:06:21][*] Project Creator: Wade Alcorn (@WadeAlcorn) /data/data/com.termux/files/home/beef/extensions/social_engineering/mass_mailer/mass_mailer.rb:10:inrequire': cannot load such file -- net/smtp (LoadError) from /data/data/com.termux/files/home/beef/extensions/social_engineering/mass_mailer/mass_mailer.rb:10:in <class:MassMailer>' from /data/data/com.termux/files/home/beef/extensions/social_engineering/mass_mailer/mass_mailer.rb:9:in' from /data/data/com.termux/files/home/beef/extensions/social_engineering/mass_mailer/mass_mailer.rb:8:in <module:Extension>' from /data/data/com.termux/files/home/beef/extensions/social_engineering/mass_mailer/mass_mailer.rb:7:in' from /data/data/com.termux/files/home/beef/extensions/social_engineering/mass_mailer/mass_mailer.rb:6:in <top (required)>' from /data/data/com.termux/files/home/beef/extensions/social_engineering/extension.rb:32:inrequire' from /data/data/com.termux/files/home/beef/extensions/social_engineering/extension.rb:32:in <top (required)>' from /data/data/com.termux/files/home/beef/core/extension.rb:38:inrequire' from /data/data/com.termux/files/home/beef/core/extension.rb:38:in load' from /data/data/com.termux/files/home/beef/core/extensions.rb:31:inblock in load' from /data/data/com.termux/files/home/beef/core/extensions.rb:30:in each' from /data/data/com.termux/files/home/beef/core/extensions.rb:30:inload' from ./beef:165:in <main>'

I NEED help please

wheatley commented 2 years ago

hey @Emadooz551 - we are currently working on updating the supported ruby version to 3 in the meantime please update your gemfile with the following

Add gem 'net-smtp', require: false to your Gemfile and run bundle.

Emadooz551 commented 2 years ago

@wheatley will I am bigginer please explain

bcoles commented 1 year ago

The install script does not support Termux. You will need to install the required dependencies manually.

BeEF is not designed for Termux nor tested on Termux.

However, as of 2019, apparently BeEF worked out of the box on Termux (#2128 #1680). I don't know if this has since changed.

The installation process on non-Termux systems is fairly straight forward. It is the same as any other Ruby tools.

You will need Ruby, and Ruby gems, and the bundle gem. You can then run bundle install. Some of the required gems require libraries to be installed. There are usually operating system packages for these.