-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Metasploit integration with BeEF fails on Kali Linux 2022.1 #2396
Comments
Yeah it's most likely Ruby 3 related. For what it's worth, I get a different error.
Loading the RPC service via msfconsole results in less issues.
But BeEF times out during connect.
|
Yep, I did not even reaching that point. In my case BeEF already crashes during the start. By the way, your zeitwerk errors looks pretty familiar. They also popup when you try to integrate |
Same here... how can we track down the issue and fix it ? |
also i thought that because port 55552 is closed but i have no idea , but when i check the port of beef 3000 it is open anyone can help please ? |
BeEF does not start Metasploit RPCd automatically. You can set it to start msfrpcd with https://github.com/beefproject/beef/blob/master/extensions/metasploit/config.yaml |
appears this error
|
any solution ? |
Still the same, can't even start normally. |
I was getting this same error. I realized that the Kali Linux beef package puts beef's configs all over the place, then symlinks around to consolidate into ┌──(root㉿kali)-[/usr/share/beef-xss]
└─# ll
total 40
drwxr-xr-x 3 root root 4096 Aug 3 11:47 arerules
-rwxr-xr-x 1 root root 7175 Jun 7 09:34 beef
-rw-r--r-- 1 root root 1460 Nov 9 2021 beef_cert.pem
-rw-r--r-- 1 root root 2484 Nov 9 2021 beef_key.pem
lrwxrwxrwx 1 root root 25 Jun 7 09:34 config.yaml -> /etc/beef-xss/config.yaml
drwxr-xr-x 6 root root 4096 Aug 3 11:47 core
lrwxrwxrwx 1 root root 17 Jun 7 09:34 db -> /var/lib/beef-xss
lrwxrwxrwx 1 root root 28 Jun 7 09:34 extensions -> /var/lib/beef-xss/extensions
-rw-r--r-- 1 root root 2074 Jun 7 09:34 Gemfile
drwxr-xr-x 14 root root 4096 Aug 3 11:47 modules
-rwxr-xr-x 1 root root 265 Jun 7 09:34 set-new-pass.rb
drwxr-xr-x 5 root root 4096 Aug 3 11:47 tools
lrwxrwxrwx 1 root root 21 Jun 7 09:34 update-geoipdb -> ../../bin/geoipupdate The problem is that the extensions are actually under Why not just follow the same pattern? I created a symlink from sudo ln -s /usr/share/beef-xss/core /var/lib/beef-xss/core |
I am trying to get the integation with Metasploit to work but it fails.
See failure below:
# ./beef
[21:26:03][] Browser Exploitation Framework (BeEF) 0.5.4.0-pre
[21:26:03] | Twit: @beefproject
[21:26:03] | Site: https://beefproject.com
[21:26:03] | Blog: http://blog.beefproject.com
[21:26:03] |_ Wiki: https://github.com/beefproject/beef/wiki
[21:26:03][] Project Creator: Wade Alcorn (@wadealcorn)
Traceback (most recent call last):
17: from ./beef:164:in
<main>
16: from /usr/share/beef-xss/core/extensions.rb:31:in load
15: from /usr/share/beef-xss/core/extensions.rb:31:in each
14: from /usr/share/beef-xss/core/extensions.rb:32:in block in load
13: from /usr/share/beef-xss/core/extension.rb:37:in load
12: from /usr/share/rubygems-integration/all/gems/activesupport-6.1.4.6/lib/active_support/dependencies.rb:332:in require
11: from /usr/share/rubygems-integration/all/gems/activesupport-6.1.4.6/lib/active_support/dependencies.rb:299:in load_dependency
10: from /usr/share/rubygems-integration/all/gems/activesupport-6.1.4.6/lib/active_support/dependencies.rb:332:in block in require
9: from /usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb:148:in require
8: from /usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb:148:in require
7: from /usr/share/beef-xss/extensions/metasploit/extension.rb:95:in <top (required)>
6: from /usr/share/rubygems-integration/all/gems/activesupport-6.1.4.6/lib/active_support/dependencies.rb:332:in require
5: from /usr/share/rubygems-integration/all/gems/activesupport-6.1.4.6/lib/active_support/dependencies.rb:299:in load_dependency
4: from /usr/share/rubygems-integration/all/gems/activesupport-6.1.4.6/lib/active_support/dependencies.rb:332:in block in require
3: from /usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb:148:in require
2: from /usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb:148:in require
1: from /usr/share/beef-xss/extensions/metasploit/rest/msf.rb:1:in <top (required)>
/usr/share/beef-xss/extensions/metasploit/rest/msf.rb:1:in `require_relative': cannot load such file -- /var/lib/beef-xss/core/main/router/router (LoadError)
Same happens if you use the
beef-xss
command to start.See log output below.
# journalctl -u beef-xss
Apr 16 18:47:23 cerberus systemd[1]: Started beef-xss.
Apr 16 18:47:27 cerberus beef[12995]: /usr/share/beef-xss/extensions/metasploit/rest/msf.rb:1:in require_relative': cannot load such file -- /var/lib/beef-xss/core/main/router/router (LoadError)
Apr 16 18:47:27 cerberus beef[12995]: from /usr/share/beef-xss/extensions/metasploit/rest/msf.rb:1:in <top (required)>
Apr 16 18:47:27 cerberus beef[12995]: from /usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb:148:in require
Apr 16 18:47:27 cerberus beef[12995]: from /usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb:148:in require
Apr 16 18:47:27 cerberus beef[12995]: from /usr/share/rubygems-integration/all/gems/activesupport-6.1.4.6/lib/active_support/dependencies.rb:332:in block in require
Apr 16 18:47:27 cerberus beef[12995]: from /usr/share/rubygems-integration/all/gems/activesupport-6.1.4.6/lib/active_support/dependencies.rb:299:in load_dependency
Apr 16 18:47:27 cerberus beef[12995]: from /usr/share/rubygems-integration/all/gems/activesupport-6.1.4.6/lib/active_support/dependencies.rb:332:in require
Apr 16 18:47:27 cerberus beef[12995]: from /usr/share/beef-xss/extensions/metasploit/extension.rb:95:in
<top (required)>
Apr 16 18:47:27 cerberus beef[12995]: from /usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb:148:in require
Apr 16 18:47:27 cerberus beef[12995]: from /usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb:148:in require
Apr 16 18:47:27 cerberus beef[12995]: from /usr/share/rubygems-integration/all/gems/activesupport-6.1.4.6/lib/active_support/dependencies.rb:332:in block in require
Apr 16 18:47:27 cerberus beef[12995]: from /usr/share/rubygems-integration/all/gems/activesupport-6.1.4.6/lib/active_support/dependencies.rb:299:in load_dependency
Apr 16 18:47:27 cerberus beef[12995]: from /usr/share/rubygems-integration/all/gems/activesupport-6.1.4.6/lib/active_support/dependencies.rb:332:in require
Apr 16 18:47:27 cerberus beef[12995]: from /usr/share/beef-xss/core/extension.rb:37:in load
Apr 16 18:47:27 cerberus beef[12995]: from /usr/share/beef-xss/core/extensions.rb:32:in block in load
Apr 16 18:47:27 cerberus beef[12995]: from /usr/share/beef-xss/core/extensions.rb:31:in each
Apr 16 18:47:27 cerberus beef[12995]: from /usr/share/beef-xss/core/extensions.rb:31:in load
Apr 16 18:47:27 cerberus beef[12995]: from /usr/share/beef-xss/beef:164:in
<main>
Apr 16 18:47:27 cerberus beef[12995]: [18:47:27][] Browser Exploitation Framework (BeEF) 0.5.4.0-pre
Apr 16 18:47:27 cerberus beef[12995]: [18:47:27] | Twit: @beefproject
Apr 16 18:47:27 cerberus beef[12995]: [18:47:27] | Site: https://beefproject.com
Apr 16 18:47:27 cerberus beef[12995]: [18:47:27] | Blog: http://blog.beefproject.com
Apr 16 18:47:27 cerberus beef[12995]: [18:47:27] |_ Wiki: https://github.com/beefproject/beef/wiki
Apr 16 18:47:27 cerberus beef[12995]: [18:47:27][] Project Creator: Wade Alcorn (@wadealcorn)
Apr 16 18:47:27 cerberus systemd[1]: beef-xss.service: Main process exited, code=exited, status=1/FAILURE
Apr 16 18:47:27 cerberus systemd[1]: beef-xss.service: Failed with result 'exit-code'.
Apr 16 18:47:27 cerberus systemd[1]: beef-xss.service: Consumed 4.333s CPU time.
This error happens when you change the /usr/share/beef-xss/config.yaml file and set metasploit enable to true.
Putting it back to false solves the issue and beef starts up normally.
I am running Kali Linux 2022.1 on a Rasberry PI
# uname -a
Linux cerberus 5.4.83-Re4son-v8l+ #4 SMP PREEMPT Debian kali-pi (2021-11-05) aarch64 GNU/Linux
Ruby version
# ruby -v
ruby 3.0.3p157 (2021-11-24 revision 3fb7d2cadc) [aarch64-linux-gnu]
Metasploit version:
msf6 auxiliary() > version
Framework: 6.1.37-dev
Console : 6.1.37-dev
It looks like a Ruby v3 issue, but i would appreciate if this can be fixed.
Having BeEF without a working Metasploit integration is a bit of a bummer...
The text was updated successfully, but these errors were encountered: