Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Beef doesn't run in Kali Rolling [18-03-2016] #1249

Closed
decode-dev opened this issue Apr 16, 2016 · 12 comments
Closed

Beef doesn't run in Kali Rolling [18-03-2016] #1249

decode-dev opened this issue Apr 16, 2016 · 12 comments
Assignees
Milestone

Comments

@decode-dev
Copy link

decode-dev commented Apr 16, 2016

The beef shows the Following Error when started from the command line.

Error :

/usr/lib/ruby/vendor_ruby/rubydns/server.rb:141:in run': wrong number of arguments (given 1, expected 0) (ArgumentError) from /usr/share/beef-xss/extensions/dns/dns.rb:128:inblock (3 levels) in run'
from /usr/lib/ruby/vendor_ruby/eventmachine.rb:968:in block in run_deferred_callbacks' from /usr/lib/ruby/vendor_ruby/eventmachine.rb:965:intimes'
from /usr/lib/ruby/vendor_ruby/eventmachine.rb:965:in run_deferred_callbacks' from /usr/lib/ruby/vendor_ruby/eventmachine.rb:187:inrun_machine'
from /usr/lib/ruby/vendor_ruby/eventmachine.rb:187:in run' from /usr/lib/ruby/vendor_ruby/thin/backends/base.rb:73:instart'
from /usr/lib/ruby/vendor_ruby/thin/server.rb:162:in start' from /usr/share/beef-xss/core/main/server.rb:127:instart'
from ./beef:154:in `

'

Environment

Beef Version : 0.4.6.1-alpha

Ruby Version : 2.3.0p0

Browser : Mozilla ESR 45.0.1

OS : Kali Debian x64

Summary :

Beef is executed with root privileges.

Steps to Reproduce :

Start the Beef from the Command line

@bcoles
Copy link
Collaborator

bcoles commented Apr 17, 2016

Hi @decode-dev

Thanks for the report. Seems a few people are having issues with BeEF on Kali.

Can you try disabling the DNS extension in /etc/beef-xss/config.yaml by setting beef.extension.dns.enabled: false and let us know how it goes?

If that doesn't work, in the short term you can try using BeEF from the git repo:

git clone https://github.com/beefproject/beef.git
cd beef
gem install bundler
bundle install
./beef

@decode-dev
Copy link
Author

decode-dev commented Apr 18, 2016

Hi @bcoles
After making
beef.extension.dns.enabled: false , it works.
Seems to be the DNS Extension is causing the problems in the latest Kali Edition.

@ziflar
Copy link

ziflar commented Apr 18, 2016

Yes the problem appears when ruby is updated to the 2.3.0 version
for the first installation of kali rolling, I proceeded as follows::
BEFORE DOING an apt-update,apt-upgrade,apt dist-upgrade.!!!!!!

             echo " ruby hold" | dpkg --set-selections
             echo " ruby2.2 hold" | dpkg --set-selections
             echo " ruby2.2-dev:amd64 hold" | dpkg --set-selections
             apt-get update && apt-get upgrade -y && apt-get dist-upgrade -y

I just block the ruby updating and it works fine

@bcoles
Copy link
Collaborator

bcoles commented Apr 21, 2016

Thanks @decode-dev and @ziflar

This is a dependency issue as the DNS extension requires an old version of the rubydns gem (version 0.7.0). The DNS extension needs to be updated to work with the latest version of the rubydns gem to prevent issues like this in the future.

The DNS extension is now disabled by default. Closing this issue.

@ziflar
Copy link

ziflar commented Apr 22, 2016

solution : there is 2 way to do it after upgrading kali rolling

solution 1: solve the authentification problem

leafpad /etc/beef-xss/config.yaml

and change

console:
shell:
enable: true

dns:
enable: false

save the file and open a terminal
service beef-xss force-reload
it's ok

solution 2: solve the hockeed browser's problem

first we do all steep's at the solution 1 and also we do as below

cd /usr/share/
rm -r beef-xss
git clone https://github.com/beefproject/beef.git
mv beef beef-xss
rm -r config.yaml
ln -s /etc/beef-xss/config.yaml /usr/share/beef-xss/config.yaml
ln -s /var/lib/beef-xss/ /usr/share/beef-xss/db
apt-get install libsqlite3-dev
bundle install
./beef
authenticate to the beef interface and leave

Now you can run beef from the favorite menu
it's ok

@bcoles
Copy link
Collaborator

bcoles commented Apr 22, 2016

@ziflar that makes sense. This is a gem dependency issue in the Kali environment. Installing from git will fix the issue.

However, your first patch won't work as you've enabled the console extension. This extension is currently broken and should be disabled, as should the dns extension.

@ziflar
Copy link

ziflar commented Apr 22, 2016

@bcoles 👍 thx for your help
the update is ok
i just run :
update-beef
beef-xss
it's ok

@sunilsong
Copy link

Disabling dns worked.!!

@ioquatix
Copy link

RubyDNS 2.0.0-rc1 is available and it should be suitable for your update as it no longer depends on celluloid. Let me know if I can provide any other help.

@Tikam02
Copy link

Tikam02 commented May 6, 2017

After installing and updating everything why isn't beef is running:

root@kali:/usr/share/beef-xss# gem install bundler
Successfully installed bundler-1.14.6
Parsing documentation for bundler-1.14.6
Done installing documentation for bundler after 4 seconds
1 gem installed

root@kali:/usr/share/beef-xss# bundle install
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and
installing your bundle as root will break this application for all non-root
users on this machine.
Warning: the running version of Bundler (1.13.6) is older than the version that created the lockfile (1.14.4). We suggest you upgrade to the latest version of Bundler by running gem install bundler.
Using public_suffix 2.0.5
Using ansi 1.5.0
Using chunky_png 1.3.8
Using daemons 1.2.4
Using json 1.8.6
Using json_pure 1.8.6
Using multi_json 1.12.1
Using eventmachine 1.0.9.1
Using http_parser.rb 0.6.0
Using erubis 2.7.0
Using espeak-ruby 1.0.4
Using execjs 2.7.0
Using fastercsv 1.5.5
Using filesize 0.1.1
Using geoip 1.6.3
Using rkelly-remix 0.0.7
Using libv8 3.16.14.19
Using metasm 1.0.3
Using mime-types-data 3.2016.0521
Using mini_portile2 2.1.0
Using mojo_magick 0.5.6
Using msgpack 1.1.0
Using rb-readline-r7 0.5.2.0
Using robots 0.10.1
Using parseconfig 1.0.8
Using rack 1.6.5
Using rainbow 2.2.1
Using ref 2.0.0
Using rubyzip 1.2.1
Using tilt 2.0.7
Using tins 1.13.2
Using bundler 1.13.6
Using addressable 2.5.1
Using rqrcode 0.10.1
Using em-websocket 0.5.1
Using uglifier 3.2.0
Using jsobfu 0.4.2
Using mime-types 3.1
Using nokogiri 1.7.1
Using rack-protection 1.5.3
Using thin 1.7.0
Using rexec 1.6.3
Using therubyracer 0.12.3
Using term-ansicolor 1.5.0
Using data_objects 0.10.17
Using dm-core 1.2.1
Using qr4r 0.4.1
Using rex 2.0.10
Using sinatra 1.4.8
Using rubydns 0.7.3
Using do_sqlite3 0.10.17
Using dm-do-adapter 1.2.0
Using dm-migrations 1.2.0
Using dm-serializer 1.2.2
Using msfrpc-client 1.1.0
Using dm-sqlite-adapter 1.2.0
Bundle complete! 26 Gemfile dependencies, 56 gems now installed.
Use bundle show [gemname] to see where a bundled gem is installed.

root@kali:/usr/share/beef-xss# ./beef
/usr/lib/ruby/vendor_ruby/bundler/runtime.rb:94:in rescue in block (2 levels) in require': There was an error while trying to load the gem 'uglifier'. (Bundler::GemRequireError) Gem Load Error is: wrong argument type Class (expected Module) Backtrace for gem load error is: /usr/lib/ruby/vendor_ruby/v8/conversion.rb:23:in include'
/usr/lib/ruby/vendor_ruby/v8/conversion.rb:23:in block (2 levels) in <top (required)>' /usr/lib/ruby/vendor_ruby/v8/conversion.rb:22:in class_eval'
/usr/lib/ruby/vendor_ruby/v8/conversion.rb:22:in block in <top (required)>' /usr/lib/ruby/vendor_ruby/v8/conversion.rb:21:in each'
/usr/lib/ruby/vendor_ruby/v8/conversion.rb:21:in <top (required)>' /var/lib/gems/2.3.0/gems/therubyracer-0.12.3/lib/v8.rb:22:in require'
/var/lib/gems/2.3.0/gems/therubyracer-0.12.3/lib/v8.rb:22:in <top (required)>' /var/lib/gems/2.3.0/gems/execjs-2.7.0/lib/execjs/ruby_racer_runtime.rb:108:in require'
/var/lib/gems/2.3.0/gems/execjs-2.7.0/lib/execjs/ruby_racer_runtime.rb:108:in available?' /var/lib/gems/2.3.0/gems/execjs-2.7.0/lib/execjs/runtimes.rb:63:in each'
/var/lib/gems/2.3.0/gems/execjs-2.7.0/lib/execjs/runtimes.rb:63:in find' /var/lib/gems/2.3.0/gems/execjs-2.7.0/lib/execjs/runtimes.rb:63:in best_available'
/var/lib/gems/2.3.0/gems/execjs-2.7.0/lib/execjs/runtimes.rb:57:in autodetect' /var/lib/gems/2.3.0/gems/execjs-2.7.0/lib/execjs.rb:5:in module:ExecJS'
/var/lib/gems/2.3.0/gems/execjs-2.7.0/lib/execjs.rb:4:in <top (required)>' /var/lib/gems/2.3.0/gems/uglifier-3.2.0/lib/uglifier.rb:5:in require'
/var/lib/gems/2.3.0/gems/uglifier-3.2.0/lib/uglifier.rb:5:in <top (required)>' /usr/lib/ruby/vendor_ruby/bundler/runtime.rb:91:in require'
/usr/lib/ruby/vendor_ruby/bundler/runtime.rb:91:in block (2 levels) in require' /usr/lib/ruby/vendor_ruby/bundler/runtime.rb:86:in each'
/usr/lib/ruby/vendor_ruby/bundler/runtime.rb:86:in block in require' /usr/lib/ruby/vendor_ruby/bundler/runtime.rb:75:in each'
/usr/lib/ruby/vendor_ruby/bundler/runtime.rb:75:in require' /usr/lib/ruby/vendor_ruby/bundler.rb:106:in require'
/usr/share/beef-xss/core/loader.rb:10:in <top (required)>' /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require'
/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require' ./beef:25:in

'
Bundler Error Backtrace:
from /usr/lib/ruby/vendor_ruby/bundler/runtime.rb:90:in block (2 levels) in require' from /usr/lib/ruby/vendor_ruby/bundler/runtime.rb:86:in each'
from /usr/lib/ruby/vendor_ruby/bundler/runtime.rb:86:in block in require' from /usr/lib/ruby/vendor_ruby/bundler/runtime.rb:75:in each'
from /usr/lib/ruby/vendor_ruby/bundler/runtime.rb:75:in require' from /usr/lib/ruby/vendor_ruby/bundler.rb:106:in require'
from /usr/share/beef-xss/core/loader.rb:10:in <top (required)>' from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require'
from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require' from ./beef:25:in '

root@kali:/usr/share/beef-xss# ./beef
/usr/lib/ruby/vendor_ruby/bundler/runtime.rb:94:in rescue in block (2 levels) in require': There was an error while trying to load the gem 'uglifier'. (Bundler::GemRequireError) Gem Load Error is: wrong argument type Class (expected Module) Backtrace for gem load error is: /usr/lib/ruby/vendor_ruby/v8/conversion.rb:23:in include'
/usr/lib/ruby/vendor_ruby/v8/conversion.rb:23:in block (2 levels) in <top (required)>' /usr/lib/ruby/vendor_ruby/v8/conversion.rb:22:in class_eval'
/usr/lib/ruby/vendor_ruby/v8/conversion.rb:22:in block in <top (required)>' /usr/lib/ruby/vendor_ruby/v8/conversion.rb:21:in each'
/usr/lib/ruby/vendor_ruby/v8/conversion.rb:21:in <top (required)>' /var/lib/gems/2.3.0/gems/therubyracer-0.12.3/lib/v8.rb:22:in require'
/var/lib/gems/2.3.0/gems/therubyracer-0.12.3/lib/v8.rb:22:in <top (required)>' /var/lib/gems/2.3.0/gems/execjs-2.7.0/lib/execjs/ruby_racer_runtime.rb:108:in require'
/var/lib/gems/2.3.0/gems/execjs-2.7.0/lib/execjs/ruby_racer_runtime.rb:108:in available?' /var/lib/gems/2.3.0/gems/execjs-2.7.0/lib/execjs/runtimes.rb:63:in each'
/var/lib/gems/2.3.0/gems/execjs-2.7.0/lib/execjs/runtimes.rb:63:in find' /var/lib/gems/2.3.0/gems/execjs-2.7.0/lib/execjs/runtimes.rb:63:in best_available'
/var/lib/gems/2.3.0/gems/execjs-2.7.0/lib/execjs/runtimes.rb:57:in autodetect' /var/lib/gems/2.3.0/gems/execjs-2.7.0/lib/execjs.rb:5:in module:ExecJS'
/var/lib/gems/2.3.0/gems/execjs-2.7.0/lib/execjs.rb:4:in <top (required)>' /var/lib/gems/2.3.0/gems/uglifier-3.2.0/lib/uglifier.rb:5:in require'
/var/lib/gems/2.3.0/gems/uglifier-3.2.0/lib/uglifier.rb:5:in <top (required)>' /usr/lib/ruby/vendor_ruby/bundler/runtime.rb:91:in require'
/usr/lib/ruby/vendor_ruby/bundler/runtime.rb:91:in block (2 levels) in require' /usr/lib/ruby/vendor_ruby/bundler/runtime.rb:86:in each'
/usr/lib/ruby/vendor_ruby/bundler/runtime.rb:86:in block in require' /usr/lib/ruby/vendor_ruby/bundler/runtime.rb:75:in each'
/usr/lib/ruby/vendor_ruby/bundler/runtime.rb:75:in require' /usr/lib/ruby/vendor_ruby/bundler.rb:106:in require'
/usr/share/beef-xss/core/loader.rb:10:in <top (required)>' /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require'
/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require' ./beef:25:in

'
Bundler Error Backtrace:
from /usr/lib/ruby/vendor_ruby/bundler/runtime.rb:90:in block (2 levels) in require' from /usr/lib/ruby/vendor_ruby/bundler/runtime.rb:86:in each'
from /usr/lib/ruby/vendor_ruby/bundler/runtime.rb:86:in block in require' from /usr/lib/ruby/vendor_ruby/bundler/runtime.rb:75:in each'
from /usr/lib/ruby/vendor_ruby/bundler/runtime.rb:75:in require' from /usr/lib/ruby/vendor_ruby/bundler.rb:106:in require'
from /usr/share/beef-xss/core/loader.rb:10:in <top (required)>' from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require'
from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require' from ./beef:25:in '
root@kali:/usr/share/beef-xss#

@baflove47
Copy link

The latest bundler is 1.16.1, but you are currently running 1.15.1.
To update, run gem install bundler
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory: /var/lib/gems/2.3.0/gems/do_sqlite3-0.10.17/ext/do_sqlite3

/usr/bin/ruby2.3 -r ./siteconf20180203-2632-gobo68.rb extconf.rb
checking for sqlite3.h... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.

Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/bin/$(RUBY_BASE_NAME)2.3
--with-sqlite3-dir
--without-sqlite3-dir
--with-sqlite3-include
--without-sqlite3-include=${sqlite3-dir}/include
--with-sqlite3-lib
--without-sqlite3-lib=${sqlite3-dir}/lib

To see why this extension failed to compile, please check the mkmf.log which can be found here:

/var/lib/gems/2.3.0/extensions/x86-linux/2.3.0/do_sqlite3-0.10.17/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /var/lib/gems/2.3.0/gems/do_sqlite3-0.10.17 for inspection.
Results logged to /var/lib/gems/2.3.0/extensions/x86-linux/2.3.0/do_sqlite3-0.10.17/gem_make.out

An error occurred while installing do_sqlite3 (0.10.17), and Bundler cannot continue.
Make sure that gem install do_sqlite3 -v '0.10.17' succeeds before bundling.

In Gemfile:
dm-sqlite-adapter was resolved to 1.2.0, which depends on
do_sqlite3

@bcoles
Copy link
Collaborator

bcoles commented Feb 3, 2018

@baflove47

You need to install several dependencies, including sqlite.

sudo apt-get install build-essential openssl libreadline6 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 subversion nodejs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants