Hello Kali-Community,
After searching the web for a couple of days and following half a dozend different instructions without success, I'm hoping that you can help me to get metasploit working with oracle instant client.
Current Situation:
Code:
msf > use auxiliary/admin/oracle/oracle_login
msf auxiliary(oracle_login) > set rhost 127.0.0.1
rhost => 127.0.0.1
msf auxiliary(oracle_login) > run
[-] Failed to load the OCI library: cannot load such file -- oci8
[-] Try 'gem install ruby-oci8'[*] Auxiliary module execution completed
When I run the 'gem install ruby-oci8' I get the following:
Code:
msf auxiliary(oracle_login) > gem install ruby-oci8[*] exec: gem install ruby-oci8
Building native extensions. This could take a while...
ERROR: Error installing ruby-oci8:
ERROR: Failed to build gem native extension.
/opt/metasploit/ruby/bin/ruby extconf.rb
checking for load library path...
LD_LIBRARY_PATH...
checking /opt/metasploit/ruby/lib... no
checking /opt/oracle/instantclient_12_1... yes
/opt/oracle/instantclient_12_1/libclntsh.so.12.1 looks like an instant client.
checking for cc... *** 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=/opt/metasploit/ruby/bin/ruby
--with-instant-client
--without-instant-client
/opt/metasploit/ruby/lib/ruby/2.1.0/mkmf.rb:456:in `try_do': RuntimeError (RuntimeError)
from /opt/metasploit/ruby/lib/ruby/2.1.0/mkmf.rb:541:in `try_link0'
from /opt/metasploit/ruby/lib/ruby/2.1.0/mkmf.rb:834:in `try_run'
from /opt/metasploit/apps/pro/vendor/bundle/ruby/2.1.0/gems/ruby-oci8-2.1.8/ext/oci8/oraconf.rb:566:in `check_cc'
from /opt/metasploit/apps/pro/vendor/bundle/ruby/2.1.0/gems/ruby-oci8-2.1.8/ext/oci8/oraconf.rb:556:in `init'
from /opt/metasploit/apps/pro/vendor/bundle/ruby/2.1.0/gems/ruby-oci8-2.1.8/ext/oci8/oraconf.rb:933:in `initialize'
from /opt/metasploit/apps/pro/vendor/bundle/ruby/2.1.0/gems/ruby-oci8-2.1.8/ext/oci8/oraconf.rb:318:in `new'
from /opt/metasploit/apps/pro/vendor/bundle/ruby/2.1.0/gems/ruby-oci8-2.1.8/ext/oci8/oraconf.rb:318:in `get'
from extconf.rb:18:in `<main>'
---------------------------------------------------
Error Message:
The compiler failed to generate an executable file.
You have to install development tools first.
Backtrace:
/opt/metasploit/ruby/lib/ruby/2.1.0/mkmf.rb:456:in `try_do'
/opt/metasploit/ruby/lib/ruby/2.1.0/mkmf.rb:541:in `try_link0'
/opt/metasploit/ruby/lib/ruby/2.1.0/mkmf.rb:834:in `try_run'
/opt/metasploit/apps/pro/vendor/bundle/ruby/2.1.0/gems/ruby-oci8-2.1.8/ext/oci8/oraconf.rb:566:in `check_cc'
/opt/metasploit/apps/pro/vendor/bundle/ruby/2.1.0/gems/ruby-oci8-2.1.8/ext/oci8/oraconf.rb:556:in `init'
/opt/metasploit/apps/pro/vendor/bundle/ruby/2.1.0/gems/ruby-oci8-2.1.8/ext/oci8/oraconf.rb:933:in `initialize'
/opt/metasploit/apps/pro/vendor/bundle/ruby/2.1.0/gems/ruby-oci8-2.1.8/ext/oci8/oraconf.rb:318:in `new'
/opt/metasploit/apps/pro/vendor/bundle/ruby/2.1.0/gems/ruby-oci8-2.1.8/ext/oci8/oraconf.rb:318:in `get'
extconf.rb:18:in `<main>'
---------------------------------------------------
See:
* http://rubydoc.info/gems/ruby-oci8/file/docs/install-full-client.md for Oracle full client
* http://rubydoc.info/gems/ruby-oci8/file/docs/install-instant-client.md for Oracle instant client
* http://ruby-oci8.rubyforge.org/en/file.report-installation-issue.html to report an issue.
extconf failed, exit code 1
Gem files will remain installed in /opt/metasploit/apps/pro/vendor/bundle/ruby/2.1.0/gems/ruby-oci8-2.1.8 for inspection.
Results logged to /opt/metasploit/apps/pro/vendor/bundle/ruby/2.1.0/extensions/x86_64-linux/2.1.0/ruby-oci8-2.1.8/gem_make.out
And that's basically where I'm stuck.
As you can see, I extracted the latest instantclient files from Oracle (basic-linux / sdk / sqlplus in version 12.1.0.2) togehter with ruby-oci8-2.1.8.tar.gz to /opt/oracle/instantclient_12_1.
LD_LIBRARY_PATH, TNS_ADMIN, SQLPATH, ORACLE_HOME are set and PAHT has been extended to /opt/oracle/instantclient_12_1.
Many thanks in advance!
Any ideas would be highly welcome!