How to install Metasploit in Termux – Easiest Way(No root!)

How to install Metasploit in Termux

To install Metasploit in Termux without root, install Termux from F-Droid or GitHub, then run the install script from the gushmazuko/metasploit_in_termux repository with bash metasploit.sh. When it finishes, start Metasploit with msfconsole.

Short version

Terminalbash
pkg install wget
wget https://github.com/gushmazuko/metasploit_in_termux/raw/master/metasploit.sh
chmod +x metasploit.sh
./metasploit.sh
msfconsole

Welcome back, fellow security enthusiasts! Termux, a free Terminal Emulator for Android has gained a lot of attention lately. The first thing that came to my mind after installing it was: Can it run our favorite Penetration Testing Tool Metasploit?! And sure enough, it can! One of the best parts is, it doesn’t even require a rooted device! The installation is also very easy, thanks to a script provided by a Github user named “gushmazuko”. Let’s start, I’ll show you how to install Metasploit in Termux.

The main Termux package repository does not carry a Metasploit package, so there are two ways to install it: using the gushmazuko script, or going the manual way. Out of convenience, we only cover the easy way here. The script clones the Metasploit Framework from GitHub and builds its Ruby dependencies on your phone, so expect it to take a while.

Table of Contents

Step 1 - Installing Termux

If you haven’t already, go ahead and install Termux first. Install it from F-Droid or from the GitHub releases, which are the supported sources. Open Termux once so it can initialize.

The screenshot below shows the old Google Play install. Termux’s own docs now describe the Google Play build as experimental and recommend F-Droid or GitHub instead. If you installed Termux from Google Play in the past, clear its data, uninstall it and reinstall from F-Droid before you continue.

How to install Metasploit in Termux

Step 2 - Installing wget and downloading the Script

First, make sure you are in the home directory by typing:

Terminalbash
cd $HOME

Followed by:

Terminalbash
pkg install wget

To install wget.

Termux terminal running pkg install wget and asking to continue with Y/N prompt

Now we need to download Auxilus’s script from Github using wget:

Terminalbash
wget https://github.com/gushmazuko/metasploit_in_termux/raw/master/metasploit.sh
chmod +x metasploit.sh
How to install Metasploit in Termux

Step 3 - Install Metasploit in Termux

To run the installer simply type:

Terminalbash
bash metasploit.sh

Alternatively:

Terminalbash
./metasploit.sh

The repository also offers a one-liner that downloads and runs the script: source <(curl -fsSL https://kutt.it/msf).

This starts the Metasploit installation, doing all the jobs for you-you otherwise would have to do manually.

How to install Metasploit in Termux

Step 4 - Starting Metasploit

You are already done! To start Metasploit type:

Terminalbash
msfconsole
How to install Metasploit in Termux

FAQ

Can I install Metasploit in Termux with pkg install?

No. The main Termux repository has no Metasploit package. That is why the script installs the dependencies with pkg, clones the Metasploit Framework from GitHub and builds the Ruby gems itself.

Do I need a rooted phone to run Metasploit in Termux?

No. Termux runs as a normal Android app, and the script installs everything in its own prefix. Features that need hardware access, like Wi-Fi monitor mode, are a different story and will not work on a stock phone.

Why should I not use the Termux version from Google Play?

Termux’s documentation calls the Google Play build experimental, and the script’s README says the Play Store version is outdated. Install Termux from F-Droid or GitHub, and do not mix sources for Termux and its plugins.

How do I reinstall or update Metasploit in Termux?

Run the script again. It erases the old $PREFIX/opt/metasploit-framework folder and installs a fresh copy from GitHub.

Conclusion

How easy was that, right? Now you can run Metasploit from your Mobile Phone! I haven’t had time yet to dig deeper into it, but I’m definitely planning to try out a couple of things. I’m very interested if I can plug in my trusted ALFA AWUSH036H to my phone and run some Wi-Fi testing from there.

Once I get to test some stuff, future tutorials will follow. Stay tuned and stay curious!

whoami

Stefan founded Ceos3c in 2016 and has spent a decade teaching cybersecurity, Linux, and web development through hands-on tutorials. He builds and ships real products while sharing his journey: ProofSwap.me, XPMetric.com, and EasyEarningsTracker.com.

More about me

15 thoughts on “How to install Metasploit in Termux – Easiest Way(No root!)”

  1. pkg install metasploit
    No group of mirrors selected. You might want to select a group by running 'termux-change-repo' Checking availability of current mirror:
    [*] https://packages.termux.dev/apt/termux-main/: ok
    Reading package lists... Done Building dependency tree... Done
    Reading state information... Done E: Unable to locate package metasploit

  2. Recent versions of Ruby have serious problem related to how Android's linker works with shared libraries. We had to package Metasploit with all necessary fixes and now it is available in Unstable Termux repository. All other ways of Metasploit installation are no longer viable.

    Use the following commands to install the package:

    pkg install unstable-repo
    pkg install metasploit

  3. E: Unable to locate package metasploit-framework

    people I just came across this error can anyone assist me please.

Comments are closed. I keep the discussion here because the answers still help.