I try to use security/metasploit on FreeBSD. It installs fine and I can run msfconsole, but metasploit cannot connect to the postgresql database: [...] [4mmsf[0m [0m> db_status [-] No database driver installed. Try 'gem install pg' [...] The suggested gem install pg doesn't work either: [...] [4mmsf[0m [0m> gem install pg [*] exec: gem install pg Building native extensions. This could take a while... ERROR: Error installing pg: ERROR: Failed to build gem native extension. current directory: /usr/local/lib/ruby/gems/2.4/gems/pg-1.0.0/ext /usr/local/bin/ruby24 -r ./siteconf20180602-31634-1qgflo4.rb extconf.rb /usr/local/lib/ruby/gems/2.4/gems/bundler-1.16.2/lib/bundler/spec_set.rb:91:in `block in materialize': Could not find pg-1.0.0 in any of the sources (Bundler::GemNotFound) from /usr/local/lib/ruby/gems/2.4/gems/bundler-1.16.2/lib/bundler/spec_set.rb:85:in `map!' from /usr/local/lib/ruby/gems/2.4/gems/bundler-1.16.2/lib/bundler/spec_set.rb:85:in `materialize' from /usr/local/lib/ruby/gems/2.4/gems/bundler-1.16.2/lib/bundler/definition.rb:171:in `specs' from /usr/local/lib/ruby/gems/2.4/gems/bundler-1.16.2/lib/bundler/definition.rb:238:in `specs_for' from /usr/local/lib/ruby/gems/2.4/gems/bundler-1.16.2/lib/bundler/definition.rb:227:in `requested_specs' from /usr/local/lib/ruby/gems/2.4/gems/bundler-1.16.2/lib/bundler/runtime.rb:108:in `block in definition_method' from /usr/local/lib/ruby/gems/2.4/gems/bundler-1.16.2/lib/bundler/runtime.rb:20:in `setup' from /usr/local/lib/ruby/gems/2.4/gems/bundler-1.16.2/lib/bundler.rb:107:in `setup' from /usr/local/lib/ruby/gems/2.4/gems/bundler-1.16.2/lib/bundler/setup.rb:20:in `<top (required)>' from /usr/local/lib/ruby/site_ruby/2.4/rubygems/core_ext/kernel_require.rb:59:in `require' from /usr/local/lib/ruby/site_ruby/2.4/rubygems/core_ext/kernel_require.rb:59:in `require' extconf failed, exit code 1 Gem files will remain installed in /usr/local/lib/ruby/gems/2.4/gems/pg-1.0.0 for inspection. Results logged to /usr/local/lib/ruby/gems/2.4/extensions/amd64-freebsd-11/2.4/pg-1.0.0/gem_make.out [...] The databases/rubygem-pg port is installed.
Perhaps I need to add that postgresql10 is running on FreeBSD 11.1: FreeBSD yokozuna 11.1-STABLE FreeBSD 11.1-STABLE #0 r328478: Sat Jan 27 22:31:28 CET 2018 root@yokozuna:/usr/obj/usr/src/sys/YOKOZUNA amd64
Btw: pkg check -dn Checking all packages: 100% metasploit is missing a required shared library: libstdc++.so
(In reply to w.schwarzenfeld from comment #2) A "pkg check -dn" shows that my system does seem to miss some shared libraries, but metasploit is not one of them: root@yokozuna:~# pkg check -dn Checking all packages: 100% cadaver is missing a required shared library: libreadline.so.6 tex-web2c has a missing dependency: openjpeg15 wdm is missing a required shared library: libwraster.so.5 wireshark-qt5 is missing a required shared library: libsmi.so.2 xorg has a missing dependency: dri
Acknowledged, working on repro and troubleshooting.
(In reply to Marco Beishuizen from comment #3) Thanks, I have to look. Maybe, it is error of my system.
"No database driver installed", exists still after update to 4.16.60. And: pkg check -dn metasploit is missing a required shared library: libstdc++.so rubygem-metasploit-payloads is missing a required shared library: libstdc++.so.
metasploit updated to 4.16.63. ports r 473314.
ports r473314
Once again , wrong revision number. ports r473315.
Still: No database driver installed. Try 'gem install pg'
Created attachment 195519 [details] msf.diff Please try attached patch.
This patch seems to work. "db_status" now shows: [...] [4mmsf[0m [0m> db_status [*] postgresql selected, no connection [...] Thanks!
A commit references this bug: Author: antoine Date: Sun Jul 29 15:17:37 UTC 2018 New revision: 475661 URL: https://svnweb.freebsd.org/changeset/ports/475661 Log: Metasploit database requires rubygem-pg version 0.2x PR: 228722 Reported and tested by: Marco Beishuizen MFH: 2018Q3 Changes: head/security/metasploit/Makefile head/security/rubygem-metasploit-credential/Makefile head/security/rubygem-metasploit_data_models/Makefile
A commit references this bug: Author: antoine Date: Sun Jul 29 15:20:19 UTC 2018 New revision: 475662 URL: https://svnweb.freebsd.org/changeset/ports/475662 Log: MFH: r475661 Metasploit database requires rubygem-pg version 0.2x PR: 228722 Reported and tested by: Marco Beishuizen Changes: _U branches/2018Q3/ branches/2018Q3/security/metasploit/Makefile branches/2018Q3/security/rubygem-metasploit-credential/Makefile branches/2018Q3/security/rubygem-metasploit_data_models/Makefile