How to: Install Metasploit Framework on Android | Part #1 - in TermuX

Image via googleusercontent.com

Hi My Fellow H4ck3Rs!

In this Thread, I`m gonna show you how to install Metasploit Framework in TermuX. You can use it for Android to Android/Windows hacking. It is the best way to hack another android like WATCH_DOGS Style :)

_Little Note:

The following method is a little out-dated. So, Please follow the first script under the NO LUCK !? section, only if the following method doesn't work!_

So, lets start...

Requirements

1). Android 5.0 + (For older Androids, visit this Thread.)

2). TermuX (Download it from Google Play or Play Store)
3). About 500mbs of internal storage (For proper installation of Metasploit)

Step 1: Installation of TermuX

Install TermuX from Google Play or Download latest APK file from HERE.

After Installing TermuX , follow these steps :

Step 2: Installing a Script for Metasploit

To install Metasploit-Framework in TermuX, enter the following commands carefully and one by one in the TermuX (After entering a single command line, don`t forget to press enter, and wait for the process to complete if any).

  • First of all, we have to install some scripts, for this, enter:

pkg update && pkg upgrade -y && pkg install wget curl openssh git -y

— These pkgs are required for further steps

(Wait till it is Completely installed)

  • Now we have to go to HOME directory, for this enter:

cd $HOME

— Only, if you are not at Home Directory
  • Now, we have to install a script for Completely Installing All-in-One Metasploit Package. For this, enter:

wget Auxilus.github.io/metasploit.sh

— Auxilus' Script

Step 3: Installing Metasploit Framework

  • To run the newly installed script for installing Metasploit Framework, enter this command:

bash metasploit.sh

  • This script will install the latest version of Metasploit-Framework script also include some extras to make updating Metasploit faster. If all goes well, i.e. No red colored warnings, you can start Metasploit using the following simple steps:
  • Now, after the complete installation, you can run Metasploit, by entering this command (anywhere, because shortcut is created by the Script) :

msfconsole

  • (Optional) This is an all in one script for the installation of MSF in TermuX. Use it if you are busy in other work. Enter the following command, and wait for its complete installation:

pkg update && pkg upgrade -y && pkg install curl wget tsu wget git && wget Auxilus.github.io/metasploit.sh && bash metasploit.sh

— By Auxilus

No Luck !?

If the above method is causing any errors or something like it, then use the following other (one-step) commands to install Metasploit:

  • R3tr0 Gh0s7 'S Original Method:

apt update && apt upgrade && apt install unstable-repo && apt install metasploit

— This installs MSF Latest Version
  • All.in.One Script of Hax4Us :

pkg update && pkg upgrade && pkg install git curl wget nmap -y && curl -LO raw.githubusercontent.com/Hax4us/Metasploit_termux/master/metasploit.sh && chmod 777 metasploit.sh && ./metasploit.sh

— Thanks To : OMM
  • V3rluchie's Method :

pkg update && pkg upgrade && pkg install curl wget git && git clone github.com/verluchie/termux-metasploit && chmod 777 termux-metasploit/install.sh && sh termux-metasploit/install.sh

— By V3rluchie
  • Tech-X3 's Trick

apt update && apt upgrade && apt install curl && curl -LO raw.githubusercontent.com/1Tech-X/Metasploit-4.16.12/master/metasploit.sh && chmod 777 metasploit.sh && sh metasploit.sh

— This script will not create any shortcut commands

???... A Common Problem ...???

  • Some people are experiencing this problem, that they are not able to open metasploit framework console via msfconsole command. So, I`ve made two solutions for that.
  • 1). Manual Way

Just open a New Session and go to metasploit-framework directory, and enter ./msfconsole command, Like This (same for msfvenom):

cd metasploit-framework
./msfconsole
OR
./msfvenom

— 1st command will take U 2 the MSF Directory, and 2nd 1 is 2 start MSF.
  • 2). Shortcut Method

Those people who are not satisfied with the first one, and want to create a shortcut command, as the other programs set, enter the following commands one by one in a new session (msfvenom included):

ln -s /data/data/com.termux/files/home/metasploit-framework/msfconsole
mv msfconsole $PREFIX/bin

ln -s /data/data/com.termux/files/home/metasploit-framework/msfvenom
mv msfvenom $PREFIX/bin

— This process is also called Symlinking [Updated]

Note:-

This Thread is created for education purposes only. I`ll not be responsible of any Illegal use of this information.

If you have any problems or getting any type of error or you think that I`ve missed something , then please inform me in Comments Section. I`ll fix that soon...

Moreover, this Guide is originally taken from TermuX Official Website , for more information (specially for manual installation of Metasploit on TermuX) visit their Official website.

Anyway, Thanks for reading my thread (You can also join our WhatsApp Group (Link Updated) for more information and Guides.

Thread about: "Hacking Android By Using Metasploit in TermuX" can be found HERE & HERE

  • H4ck3R _777

82 Responses

Brother can u tell me how to use nmap -sS scan without root privileges..

Hi My bro, actually I'm new on hacking devices. So, you can start a new forum, by asking your Question on that forum. I h0pe that may help.

When I discover a new trick or method about hacking or cracking, I`ll immediately post that here at Null-Byte.

I'll also do some research on your problem, and tell you if I found a Solution :)

If You Liked My Guide, Then Don't Forget to Give Feedback ...!!!

!!!... Best Of Luck ...!!!

Could not locate Gemfile

Please help me..

can run metasploit problem with bundler

Hi brother , can u please explain me how i should to do after i installed metasploit on my Android then when i typed msfconsole on termux the answer were not command found

  • I`m gonna post two alternate methods of opening msfconsole in my Tutorial. Here they are:

1). Go to metasploit framework directory, and enter msfconsole. Like this:

cd metasploit-framework
./msfconsole

— Check out Method #2 too...

2). To make a shortcut command for msfconsole manually, enter the following commands one by one:

ln -s metasploit-framework/msfconsole
cp msfconsole $PREFIX/bin
rm msfconsole

— This process is also called Symlinking

Please help me..It says failed to connect to the database..this happens on my pc too..

  • Bro... I`ve already posted the solution of this problem. Plz check Common Problems Section of THIS Guide .

After i enter this command
bash metasploit.sh
I got this.. so the metasploit is obsolete as it says.. any alternative?!

Thanx in advance boss

If you are using android pie you will get this issue because pie uses ruby ver 2.60.3. and the repository has gemfile ver 2.60.0

I ain't using Pie, still facing same problem. I'm on oreo.

Thanks your instructions were easy to follow! Will you be doing android to android hack?

Your Welcome RAIN S ...!!!

  • Actually my Android to Android hacking tutorial is in WORK IN PROGRESS State. It is almost complete. I`ll publish it soon...
  • It will look like this:

Bro can u tell me how to hack instagram account and online games on termux plz....

Can't wait thank you!

when running ./msfconsole, i get:
Could not find i18n-0.9.5 in any of the sources
Run `bundle install` to install missing gems.

after install i get this error:
segmentation fault

  • Bro, Actually in your case, Metasploit is not Properly installed on TermuX.You have to Re-install TermuX and Metasploit in it. It will definitely fix the problem. I also faced this problem, when I first installed the Metasploit in TermuX. But later, it was fixed automatically, when I reinstalled Metasploit and Termux.

thank you, I reinstalled as you said in your newer post:
"HACK Android Device with TermuX on Android | Part #1 - Over the Internet Ultimate Guide"

now I can access Metasploit if I do those steps as you mentioned:

2). Metasploit is successfully installed, but was unable to create the shortcut. To manage this, just enter:

cd metasploit-framework

then, enter msfvenom command with ./ at start. i.e

just wanted to know if there is a way to not go through directory each time I want to run Metasploit.

I also wanted to thank you, for sharing your knowledge. I started to learn hacking online and your guides are the best so far.

Your Welcome ...!!!

  • Yeah bro, there is a manual way to create a ``shortcut command`` like thing. Only you have to do, is to explore metasploit.py script with your computer (PC), and find shortcut related commands there. I`ll also check that. If I found something, then I`ll update my Guide.
  • Again, Thanks for your Appreciation. GOOD LUCK ...!!!

dont know what have i missed

Of-Course, You are right Brother ...!!!

  • In your 1st screenshot, you know you have to first go to metasploit-framework directory, then enter ./msfvenom -p ... , and ./msfconsole commands (We will soon find a suitable solution for that).
  • In you 2nd screenshot, there is metasploit connection to database problem. I`ve recently Updated my Guide (1 or 2). You can check the solution. If you are still facing anytype of problem, then tell me.

Getting load error while symlinking
Any help in this???

  • Oookay.... I'll try to find the solution... if I got something, I'll Tell you.

Thank you . Could you at some time talk about creating a database for use with metasploit framework?

!!!... Your Welcome Bro ...!!!

  • Yeah sure , If you have WhatsApp account, then join me to start discussion (PRIVATELY)...
  • I think I`ve found a way to solve your problem (which you reported above). Just try to enter this series of commands one by one:

rm $PREFIX/bin/msfconsole
rm $PREFIX/bin/msfvenom
ls -s /data/data/com.termux/files/home/metasploit-framework/msfconsole
ls -s /data/data/com.termux/files/home/metasploit-framework/msfvenom
mv msfconsole $PREFIX/bin
mv msfvenom $PREFIX/bin

— Now try msfconsole or msfvenom

If that worked then tell me. I`ll UPDATE the commands (which I posted on the Thread).

Yeah it worked bro thanks!!

O Thank God....! , Your Welcome...!!!

  • Good Luck Bro ...!!!

Great work bro!! Now everything works for me in this tutorial

can we similarly install social engineering toolkit in termux. If we can install please tell how to do so??
Thanks!!

Thank You for Your Appreciation...!!!

  • You asked about Social Engineering Toolkit. You can not install everything on TermuX, that are able to install Kali LinuX. Actually, Kali LinuX is a complete set of softwares , required for installation and proper working of Other Softwares.
  • If you want to install a specific Program (software) in TermuX, you have to first check a specific Tutorial for installation of THAT Program, on Google.
  • As you can see, Metasploit can not be installed on TermuX so easily. It requires much effort to find a specific Tutorial. But, thanks to TermuX official website, that they already posted a suitable Tutorial for that.
  • I Recommend you to first google it, to find a suitable tutorial for installation of Social Engineering Toolkit. Anyway, Best Of Luck ...!!!

Thanks bro!!! I will try it

Can we create a payload in msfvenom so that the app auto triggers every 5 min(trying to establish meterpreter session). In actual exploit we have to click the main activity in order to establish a meterpreter session. If I Closed this session and want to open another session then I need to click on the main activity app again.

Can we create an app that auto triggers for every 5 min that is trying to establish a connection for meterpreter session

If we can do can you give some insight on this..
Thanks!!

!!!... Your Welcome ...!!!

  • You asked about a Persistent Backdoor, which automatically trigger about every 5mins, so here is the Tutorial by F.E.A.R. Actually, I've not tested it before (due to shortage of time), but don't worry, I'll test it later, and add the Tutorial in (my) this Guide.
  • Good Luck ...!!!

.

Thanks bro!!
I'll try it

bro it is really that load error is solved by the given commands

I have a one step one line command metasploit install i.e.
.
.
.
.
.

pkg upgrade && pkg install git && pkg install curl && pkg install wget && pkg install nmap && curl -LO raw.githubusercontent.com/Hax4us/Metasploit_termux/master/metasploit.sh && chmod 777 metasploit.sh && ./metasploit.sh

.
.
.
.

I know it's lengthy but just copy it and paste it in your termux terminal and hit enter. It will take some time but it will successfully install the metasploit framework.

Hope it helps.

  • WoW --- Awesome! Thanks Brother!

Sir, I have this type of difficulty . What should I do for it plzz give me solution , I can't run the msfconsole (metasploit) . When I type msfconsole this types of error it is showing me plzz help me in that case .

  • Actually, your Metasploit is not installed correctly, please reinstall TermuX and Metasploit. If this don't work, then use another script of Metasploit (metasploit.sh) . I'm gonna post it now in my Tutorial

I have nokogiri problem pls help me

I just got in a same problem, have you sovled it sir ??

Hey Friend I have a same problem , if you have solved it ,help me please!

plz help me

Hey i had same issue i resolve it by.

Ls
rm Gemfile.lock
bundle install -j5
./msfconsole

Im having same issue as above please help me bro

Resolved all good

Sir I faces some problems to install msfconole
Plz help

Whoever has issues with gem bundler,here is a quick FIX !

Step 1: Install the 1.17.2 Version Bundler

gem install bundler -v 1.17.2

Step 2: ENJOY

that worked for me :)

Hey h4ck 3R_777,

I want to ask you something that "how termux app downloaded metasploit by just typing a command???.... from where did termux downloaded metasploit???...I mean how termux is working??

Please reply!!!!

Pls pls pls help kememmeemmeememememememmememememememe i reinstalled everything but it dont work first time it works but when i installed tmvenom its says now segmentation fault

Pls help

Hey bros!

I have not been able to properly install metasploit on my device, I have tried all solutions in this guide and a couple other tutorials but no luck yet

I have reinstalled both termux and metasploit multiple times as well.
Please Help!

Hloo frnd can u help mee?
Im getting this erroe while running msfconsole

When i use bundle install command i get
I get these errors

I alredy used the gem install nokogiri -v '1.10.1' nd updated packages and gemfiles. But no use..please help me someone.

I am getting below errors after following above steps please help
server started
metasploit-credential not in the bundle, so Metasploit::Credential creation will fail for Msf::DBManager
Traceback (most recent call last):
36: from /data/data/com.termux/files/home/metasploit-framework/msfconsole:48:in `<main>'
35: from /data/data/com.termux/files/home/metasploit-framework/msfconsole:48:in `require'

34: from /data/data/com.termux/files/home/metasploit-framework/lib/msf/core/payload_generator.rb:2:in `<top (required)>'

33: from /data/data/com.termux/files/home/metasploit-framework/lib/msf/core/payload_generator.rb:2:in `require'
32: from /data/data/com.termux/files/home/metasploit-framework/lib/msf/core/payload/apk.rb:3:in `<top (required)>'
31: from /data/data/com.termux/files/home/metasploit-framework/lib/msf/core/payload/apk.rb:3:in `require'
30: from /data/data/com.termux/files/home/metasploit-framework/lib/msf/core.rb:46:in `<top (required)>'

29: from /data/data/com.termux/files/usr/lib/ruby/gems/2.6.0/gems/backports-3.11.4/lib/backports/stdlib.rb:9:in `requirewith_backports'

28: from /data/data/com.termux/files/usr/lib/ruby/gems/2.6.0/ge

Mohon bantuan apa Yang Salah dengan ini

Please help me i have some issue starting metasploit

Thanks for the wisdom... everything that you have mentioned in your guide helped me out while installing properly so far . I will definitely keep your page on hand . Thanks again

Plz help how to fix this

I Can't use termux... Plz help bro... Its not upgrading... Plz help... And plz.. Share how to do.. Step by step..

Hi pls, I cant install nokogiri on termux

Hey bro,
I have this problem before this oi have got more few problem like nakgori is not instaaled pls. Help mee.

From the installation time my phone get switch of what will I do

This is seen what so I do

So this happened...

An error occurred while installing nokogiri (1.10.2), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.10.2' --source 'rubygems.org'` succeeds before bundling.

In Gemfile: factory_bot_rails was resolved to 5.0.2, which depends on railties was resolved to 4.2.11.1, which depends on

actionpack was resolved to 4.2.11.1, which depends on actionview was resolved to 4.2.11.1, which depends
on rails-dom-testing was resolved to 1.0.9, which depends on nokogiri

dpkg: error processing package metasploit (--configure): installed metasploit package post-installation script subprocess returned error exit status 5 Errors were encountered while processing: metasploit E: Sub-process /data/data/com.termux/files/usr/bin/dpkg returned an error code (1)

Hello mr
Please i need ur help..i get many errors while downloading and installing metasploit
So if you dont mind if theres a way to contact with you
Like msgs or whatsupp
Regards

Pls help me
I am using samsung grand prime
V 5.0
I had install metasploit several time but it's installing not consoling
Pls pls help me

Bro can u please say where that metasploit app is saved..???

Bt other than easy procedures... Hats off bro...

Pls I need the WhatsApp group link

I use kali in userland. I cant access internal storage in userland. Pls fix

Very exiting, installed very smooth. Thanks.

ou can directly use msfvenom or msfconsole rather than ./

Pls help me this is the message I keep getting making the installation incomplete pls guy I really need your help.

Share Your Thoughts

  • Hot
  • Active