
How to Install Metasploit in Termux: A Complete Step-by-Step Guide (2024)
Table of Contents
Introduction
If you’re looking for a way to install Metasploit in Termux, you’ve come to the right place. Metasploit is one of the most powerful penetration testing frameworks used by cybersecurity professionals and ethical hackers to identify and exploit vulnerabilities in systems. Termux, on the other hand, is an Android terminal emulator that allows you to run Linux commands and tools on your smartphone.
By combining these two, you can turn your Android device into a portable hacking machine. In this step-by-step guide, we’ll walk you through the entire process of installing Metasploit on Termux, configuring it, and running basic tests.
Why Install Metasploit in Termux?
Before we proceed, let’s understand why you might want to install Metasploit on Termux:
✅ Portability – Run penetration testing tools directly from your Android device.
✅ No need for a PC – Perform security assessments on the go.
✅ Learning & Practice – Great for cybersecurity students and ethical hackers.
✅ Free & Open-Source – Metasploit Framework is freely available.
However, remember that Metasploit should only be used ethically and legally. Unauthorized hacking is illegal.
Prerequisites for Installing Metasploit in Termux
Before starting, ensure you have:
✔ An Android device (with at least 2GB RAM for smooth performance).
✔ Stable internet connection (required for downloading packages).
✔ At least 500MB free storage (Metasploit requires space).
✔ Basic knowledge of Linux commands (helpful for troubleshooting).
Step 1: Install Termux (Correctly)
Many guides suggest installing Termux from the Google Play Store, but the Play Store version is outdated. Instead, use F-Droid for the latest version:
- Download F-Droid from https://f-droid.org.
- Open F-Droid, search for Termux, and install it.
- Open Termux and grant storage permissions when prompted.
Step 2: Update & Upgrade Termux Packages
Before installing Metasploit, update Termux to avoid compatibility issues:
pkg update && pkg upgrade -y
This ensures all packages are up to date.
Step 3: Install Required Dependencies
Metasploit needs several dependencies to work. Run:
pkg install git wget python python2 ruby -y
gem install lolcat
Step 4: Install Metasploit in Termux
Then, install lolcat
(for colorful output):
Since the official Metasploit installation is complex, we’ll use a pre-made installer script:
- Clone the Metasploit-Termux repository:
git clone https://github.com/h4ck3r0/Metasploit-termux
- Navigate into the directory:
cd Metasploit-termux
- Run the installer script:
bash metasploit.sh
- Wait for the installation to complete (may take 10-20 minutes).
Step 5: Launching Metasploit
Once installed, start Metasploit with:
msfconsole
The first launch will take longer as it initializes the database.
Step 6: Testing Metasploit (Basic Commands)
To ensure Metasploit works, try these commands:
- Search for an exploit:
search ssh
- Use a scanner module:
use auxiliary/scanner/portscan/tcp
- Set a target IP (for testing):
set RHOSTS 192.168.1.1
- Run the scan:
run
If everything works, Metasploit is successfully installed!
Common Errors & Fixes
❌ “Metasploit not found” → Reinstall using the script.
❌ Database not initialized → Run msfdb init
.
❌ Dependency errors → Reinstall dependencies with pkg install [package]
.
FAQs About Installing Metasploit in Termux
Q1: Is Metasploit still working on Termux in 2024?
Yes, but installation may require extra steps due to Termux updates.
Q2: Can I use Metasploit for hacking?
Only for legal penetration testing with proper authorization.
Q3: Why does Metasploit take so long to install?
It downloads multiple dependencies (~500MB).
Q4: What is a payload in Metasploit, and how do I select one?
A payload is the code that gets executed on the target system after successful exploitation. You can select a payload using the set PAYLOAD command, followed by the desired payload name (e.g., android/meterpreter/reverse_tcp).
Q5: What is Metasploit, and why is it used?
Metasploit is an open-source penetration testing framework that helps security professionals find and exploit vulnerabilities in computer systems, applications, and networks. It’s widely used for ethical hacking, security testing, and vulnerability assessment.
Conclusion
You’ve now successfully learned how to install Metasploit in Termux! This setup allows you to perform security testing directly from your Android device.
Key Takeaways:
✔ Use F-Droid for the latest Termux version.
✔ Always update Termux before installing Metasploit.
✔ Use GitHub scripts for easier installation.
✔ Test with msfconsole
to confirm it works.
If you found this guide helpful, share it with others interested in ethical hacking! 🚀
🔗 Need help? Join our Telegram Group for support.