Install Metasploit on Termux (Android)

x32x01
  • by x32x01 ||
Install Metasploit on Termux (Android)
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.

📱 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.
Important: Install Termux from F-Droid or its official GitHub repository. Avoid the outdated Google Play version.



Method 1: Direct Installation Using Termux​

The traditional installation command was:
Bash:
pkg install unstable-repo -y && pkg install metasploit -y
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
Bash:
pkg update && pkg upgrade -y
pkg install git wget curl ruby python ncurses-utils -y
Step 2: Download the installation script
Clone the community repository:
Bash:
git clone https://github.com/gushmazuko/metasploit_in_termux.git
Step 3: Run the installer
Bash:
cd metasploit_in_termux
chmod +x metasploit.sh
bash metasploit.sh
Wait for the installation to finish. Depending on your device and internet connection, this process may take some time.
Step 4: Launch Metasploit
Bash:
msfconsole
If the console starts successfully, Metasploit is ready to use.



Method 2: Install Metasploit Using Proot-Distro (Recommended)​

Recommended method
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
Bash:
pkg update && pkg upgrade -y
pkg install git -y
Step 2: Clone the installation repository
Bash:
git clone [URL]https://github.com/h4ck3r0/Metasploit-termux.git[/URL]
Step 3: Run the installer
Bash:
cd Metasploit-termux
chmod +x metasploit.sh
bash metasploit.sh
Step 4: Select the installation method
When the installation menu appears, choose:
  1. Select option 1 - Metasploit Installation.
  2. Select option 3 - Proot-Distro / Debian.
Follow the on-screen instructions and wait for the installation to complete.
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
The installer is designed to configure the Debian environment and provide the necessary launch commands.



🔧 Common Installation Problems​

ProblemPossible solution
msfconsole: command not foundCheck whether the installation completed successfully.
Nokogiri installation errorsTry the Proot-Distro method.
Bundler errorsCheck Ruby compatibility or use the Debian installation.
PostgreSQL startup errorsCheck the database configuration and follow the installer's repair instructions.
Termux process keeps stoppingDisable 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 old pkg 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.
 
Similar threads
x32x01
Replies
0
Views
250
x32x01
x32x01
x32x01
Replies
0
Views
203
x32x01
x32x01
x32x01
Replies
0
Views
159
x32x01
x32x01
x32x01
Replies
0
Views
157
x32x01
x32x01
x32x01
Replies
0
Views
337
x32x01
x32x01
Register & Login Faster
Forgot your password?
Forum Statistics
Threads
1,227
Messages
1,235
Members
20
Latest Member
cositaricagerra
Back
Top