- by x32x01 ||
Metasploit Framework is a popular penetration testing platform used to develop, test, and validate security exploits. You can install it on Android using Termux, but the installation process requires a few additional steps because Metasploit is no longer available in the official Termux package repositories.
This guide covers two community-maintained installation methods, including a recommended Debian-based installation using Proot-Distro.
However, this command is no longer a reliable installation method because Metasploit has been removed from the official Termux repositories.
You can instead use a community-maintained installation script.
Step 1: Install the required packages
Step 2: Download the installation script
Clone the community repository:
Step 3: Run the installer
Wait for the installation to finish. Depending on your device and internet connection, this process may take some time.
Step 4: Launch Metasploit
If the console starts successfully, Metasploit is ready to use.
If you encounter Ruby, Nokogiri, or Bundler errors with direct installation, the Proot-Distro method is a practical alternative.
It runs Metasploit inside a Debian environment on your Android device and uses Rapid7's prebuilt package rather than compiling all the dependencies directly in Termux.
Step 1: Install Git
Step 2: Clone the installation repository
Step 3: Run the installer
Step 4: Select the installation method
When the installation menu appears, choose:
This method avoids many of the Ruby gem compilation problems associated with direct installation.
Step 5: Start Metasploit
After installation, launch the console:
The installer is designed to configure the Debian environment and provide the necessary launch commands.
💡 Final Tip: If you're installing Metasploit on a modern Android device, start with the Proot-Distro method. It provides a more predictable environment and avoids many of the dependency issues associated with compiling Metasploit directly on Android.
This guide covers two community-maintained installation methods, including a recommended Debian-based installation using Proot-Distro.
📱 Prerequisites
Before installing Metasploit, make sure you have:- An Android device running Android 7.0 or later for the recommended Proot method.
- The latest version of Termux.
- At least 2-3 GB of free storage.
- A stable internet connection.
Method 1: Direct Installation Using Termux
The traditional installation command was: Bash:
pkg install unstable-repo -y && pkg install metasploit -y You can instead use a community-maintained installation script.
Step 1: Install the required packages
Bash:
pkg update && pkg upgrade -y
pkg install git wget curl ruby python ncurses-utils -y Clone the community repository:
Bash:
git clone https://github.com/gushmazuko/metasploit_in_termux.git Bash:
cd metasploit_in_termux
chmod +x metasploit.sh
bash metasploit.sh Step 4: Launch Metasploit
Bash:
msfconsole Method 2: Install Metasploit Using Proot-Distro (Recommended)
Recommended methodIf you encounter Ruby, Nokogiri, or Bundler errors with direct installation, the Proot-Distro method is a practical alternative.
It runs Metasploit inside a Debian environment on your Android device and uses Rapid7's prebuilt package rather than compiling all the dependencies directly in Termux.
Step 1: Install Git
Bash:
pkg update && pkg upgrade -y
pkg install git -y Bash:
git clone [URL]https://github.com/h4ck3r0/Metasploit-termux.git[/URL] Bash:
cd Metasploit-termux
chmod +x metasploit.sh
bash metasploit.sh When the installation menu appears, choose:
- Select option 1 - Metasploit Installation.
- Select option 3 - Proot-Distro / Debian.
This method avoids many of the Ruby gem compilation problems associated with direct installation.
Step 5: Start Metasploit
After installation, launch the console:
Bash:
msfconsole 🔧 Common Installation Problems
| Problem | Possible solution |
|---|---|
msfconsole: command not found | Check whether the installation completed successfully. |
| Nokogiri installation errors | Try the Proot-Distro method. |
| Bundler errors | Check Ruby compatibility or use the Debian installation. |
| PostgreSQL startup errors | Check the database configuration and follow the installer's repair instructions. |
| Termux process keeps stopping | Disable battery optimization for Termux. |
⚠️ Important Security Notes
- Download installation scripts only from repositories you trust.
- Review scripts before executing them, especially when they request extensive system permissions.
- Community-maintained installers are not official Rapid7 products.
- Keep Metasploit and its dependencies updated.
- Only perform penetration testing on systems you own or have explicit permission to test.
Frequently Asked Questions
------------------Can I install Metasploit directly using pkg?
Not through the oldpkg install metasploit command because the package is no longer available in the official Termux repositories.Which installation method is more reliable?
The Proot-Distro method is generally the better option when direct installation encounters Ruby or dependency compilation problems.Can Metasploit run on Android?
Yes. You can run Metasploit through Termux, either directly or inside a Linux environment using Proot-Distro. Performance depends on your device's hardware and available storage.How do I open Metasploit after installation?
Open Termux and execute: Bash:
msfconsole 💡 Final Tip: If you're installing Metasploit on a modern Android device, start with the Proot-Distro method. It provides a more predictable environment and avoids many of the dependency issues associated with compiling Metasploit directly on Android.