Install Metasploit on Android with Termux | Best 2 Steps
This tutorial aims to guide you through the process of how to Install Metasploit on Android with Termux. Metasploit is a powerful framework used for penetration testing, security auditing, and vulnerability assessment. It provides a robust platform for discovering and exploiting security weaknesses in systems and networks. On Android devices, Termux serves as a terminal emulator and Linux environment, allowing you to execute command-line tools and scripts, making it an ideal platform for running Metasploit.
Now you can follow the rest of the article on the Orcacore website to Install Metasploit on Android with Termux.
Before proceeding to Install Metasploit on Android with Termux, ensure you have Termux installed. The version available on the Play Store is deprecated. Andronix is recommended for installing an updated version. Refer to this guide on Setting up a Linux Distro on Android with Termux for instructions.
Also, you need 1GB-2GB space in your device for installing this framework.
Once Termux is set up, follow these steps to Install Metasploit on Android with Termux.

Step 1 – Set Up Metasploit on Android Manually in Termux
First, update and upgrade your Termux system using the following commands:
$ pkg update && pkg upgrade
Next, install the necessary packages:
$ pkg install git curl wget nmap -y
Download the Metasploit installation script using the curl
command:
$ curl -LO raw.githubusercontent.com/Hax4us/Metasploit_termux/master/metasploit.sh
Make the downloaded script executable:
$ chmod 777 metasploit.sh
Finally, execute the script to install Metasploit:
$ ./metasploit.sh
This installation process may take a considerable amount of time. Please be patient and wait for it to complete.
Step 2 – Start Metasploit on Android with Termux
After the installation is complete, initialize the database and start the PostgreSQL server with these commands:
$ msdb init
$ systemctl start postgresql
Now, you can launch the Metasploit console using:
$ msfconsole
To access Metasploit’s built-in documentation, type help
to view the available commands:
$ help show
You can now begin using Metasploit within your Termux environment on your Android device.
For further information about Termux, refer to the Termux Wiki.
Conclusion
Metasploit is a widely-used open-source penetration testing framework for identifying, exploiting, and validating vulnerabilities in systems. Termux provides a Linux-like environment on Android, allowing you to run command-line tools without rooting your device. Combining these tools allows you to Install Metasploit on Android with Termux.
By following these steps, you have successfully learned how to Install Metasploit on Android with Termux. Remember to install Termux via Andronix, then proceed with the outlined instructions to set up Metasploit within Termux.
Hope you enjoy it. Also, you may like to read the following articles:
Termux Desktop GUI on Android
Termux Commands For Android Devices
Remote Windows via Android Device
FAQs
Can I install Metasploit on Android?
Yes, you can install Metasploit on Android using Termux which allows running Linux packages and scripts on Android devices.
Can Metasploit be used on all Android devices?
Yes, Metasploit can run on most Android devices with Android 5.0 or later, but performance may vary depending on the hardware specifications of your device.
How do I update Metasploit in Termux?
To update Metasploit in Termux, you can run:pkg update && pkg upgrade
Alternative Approaches to Installing Metasploit on Android
While the above method of using a dedicated script for installation is common, here are two alternative methods to achieve the same goal of getting Metasploit running on your Android device via Termux.
1. Utilizing Docker within Termux
Docker provides a way to containerize applications, making them portable and isolated. We can leverage Docker within Termux to run Metasploit in a container. This method offers better isolation and potentially easier management.
Explanation:
Docker containers encapsulate the Metasploit environment, including all its dependencies. This eliminates dependency conflicts and simplifies the installation process. Termux, with its Linux-like environment, can run Docker, allowing us to deploy Metasploit within a container.
Steps:
-
Install Docker on Termux: This can be achieved using scripts specifically designed for Termux, or by using a Linux distribution chroot environment within Termux and installing Docker through the distribution’s package manager. A common approach involves using a script specifically tailored for Termux.
pkg update && pkg upgrade pkg install git git clone https://github.com/Neo-Oli/termux-ubuntu cd termux-ubuntu chmod +x ubuntu.sh ./ubuntu.sh
This script installs Ubuntu within Termux. After installation, you can start the Ubuntu environment. Once inside, you can install Docker using the standard Ubuntu Docker installation instructions.
-
Install Docker within the Chroot Environment: Follow the standard Docker installation instructions for the Linux distribution you installed (e.g., Ubuntu, Debian). This typically involves adding the Docker repository and installing the Docker packages using
apt
.# Example for Ubuntu sudo apt update sudo apt install apt-transport-https ca-certificates curl software-properties-common curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null sudo apt update sudo apt install docker-ce docker-ce-cli containerd.io
-
Pull the Metasploit Docker Image: Docker Hub hosts official and community-maintained Metasploit images. Pull the latest official image.
docker pull rapid7/metasploit-framework
-
Run the Metasploit Container: Start the Metasploit container, mapping necessary ports and volumes.
docker run -it -v msf_data:/data -p 443:443 -p 8080:8080 -p 3790:3790 rapid7/metasploit-framework msfconsole
-it
: Runs the container in interactive mode.-v msf_data:/data
: Creates a volume namedmsf_data
to persist Metasploit data.-p 443:443 -p 8080:8080 -p 3790:3790
: Exposes ports for Metasploit services.rapid7/metasploit-framework
: Specifies the Docker image to use.msfconsole
: Executes the Metasploit console upon container startup.
2. Installing Metasploit via a Linux Distribution Chroot Environment
Another approach involves creating a complete Linux distribution environment within Termux using a chroot. This provides a more native Linux experience, making the installation process similar to that on a standard Linux system.
Explanation:
Chroot (change root) creates an isolated file system environment. By installing a Linux distribution within a chroot environment in Termux, we can then use the distribution’s package manager (e.g., apt
for Debian-based distributions) to install Metasploit directly.
Steps:
-
Install a Linux Distribution Chroot Environment: Several tools and scripts are available to create a Linux chroot environment in Termux. Andronix, as mentioned in the original article, is one such tool. Alternatively, you can manually create a chroot environment. We’ll use the same Ubuntu example as above.
pkg update && pkg upgrade pkg install git git clone https://github.com/Neo-Oli/termux-ubuntu cd termux-ubuntu chmod +x ubuntu.sh ./ubuntu.sh
-
Start the Chroot Environment: After installing the distribution, start it.
./start-ubuntu.sh # or similar command depending on the chroot setup
-
Install Metasploit using the Distribution’s Package Manager: Once inside the chroot environment, use the distribution’s package manager to install Metasploit. You might need to add the Rapid7 Metasploit repository first.
# Example for Debian/Ubuntu wget http://apt.metasploit.com/metasploit-framework.gpg.key apt-key add metasploit-framework.gpg.key echo "deb http://apt.metasploit.com/ kali main" > /etc/apt/sources.list.d/metasploit.list apt update apt install metasploit-framework
-
Run Metasploit: After installation, you can start Metasploit by running
msfconsole
.
These alternative methods offer different approaches to achieving the same goal. The Docker method provides better isolation, while the chroot method offers a more native Linux experience. Choose the method that best suits your needs and technical expertise.