Skip to content

h4ck3r0/Metasploit-termux

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

144 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Metasploit-Framework Installer for Termux

Banner


๐Ÿ›ก๏ธ About

Since Metasploit was removed from the official Termux repositories, installing it became difficult due to Ruby gem compilation errors (Nokogiri/Gumbo, bundler conflicts, Ruby version mismatches). This script provides three installation methods โ€” including the new recommended proot-distro approach which completely bypasses all gem errors using Rapid7's official pre-built package.


๐Ÿ“Š Installation Methods

Method Android Stability Disk Recommended
๐Ÿ† Proot-Distro (Debian) 7.0+ โญโญโญโญโญ ~300MB โœ… YES
โš™๏ธ Direct Install (Modern) 7.0+ โญโญโญ ~150MB โš ๏ธ May have gem errors
๐Ÿ•น๏ธ Legacy Install 4.4โ€“6.0 โญโญ ~150MB For old devices only

Why Proot? Debian proot uses Rapid7's official omnibus package โ€” a pre-compiled binary with its own embedded Ruby. No gem compilation, no Nokogiri errors, no bundler issues. Ever.


๐Ÿ› ๏ธ Requirements

  • Termux latest version from F-Droid (NOT Play Store)
  • Minimum 2GB free internal storage (3GB+ recommended for proot)
  • Stable internet connection
  • Android 7.0+ for proot method / Android 4.4+ for legacy

๐Ÿ“ฅ Installation

# 1. Update Termux
apt update && apt upgrade -y

# 2. Install git
apt install git -y

# 3. Clone this repository
git clone https://github.com/h4ck3r0/Metasploit-termux

# 4. Enter directory
cd Metasploit-termux

# 5. Grant permissions
chmod +x *

# 6. Run installer
bash metasploit.sh

Menu Options

[1] Metasploit Installation
    โ”œโ”€โ”€ [1] Legacy (Android 4.4 - 6.0)
    โ”œโ”€โ”€ [2] Modern Direct (Android 7.0+)
    โ””โ”€โ”€ [3] Proot-Distro / Debian  โ† RECOMMENDED
[2] Repair
[3] Backup
[4] Restore
[5] Update
[6] Exit

๐Ÿ’ก Select Option 1 โ†’ then Option 3 for the most stable installation.


๐ŸŽฎ Usage Guide

Launching Metasploit Console

msfconsole

This automatically:

  • Starts PostgreSQL database
  • Enters the Debian environment (proot method)
  • Launches msfconsole

๐Ÿ“ Storage & File Access Guide

All paths below work inside the Debian proot environment.

Inside Debian Maps to Access from Android
/sdcard/ Phone internal storage File Manager root
/sdcard/MSF/payloads/ Payload output folder Internal Storage โ†’ MSF โ†’ payloads
/sdcard/MSF/loot/ Loot/captured data Internal Storage โ†’ MSF โ†’ loot
/sdcard/MSF/backups/ Backup storage Internal Storage โ†’ MSF โ†’ backups
/root/msf-output/ Alias for /sdcard/MSF/ Same as above

Entering the Debian shell

# Drop into a full Debian shell
msf-shell

# Inside Debian โ€” build a tool, then copy to phone:
gcc exploit.c -o exploit
cp exploit /sdcard/MSF/exploit

# Exit back to Termux
exit

Copy files between Debian and phone

# From inside Debian (msf-shell):
cp /root/myfile.apk /sdcard/MSF/myfile.apk

# From Termux (outside proot):
cp ~/proot-distro/installed-rootfs/debian/root/myfile /sdcard/MSF/

๐Ÿ”ง Repair

If Metasploit breaks after a Termux update:

bash metasploit.sh
# Choose Option 2 โ†’ Repair

The repair script will:

  • Reinstall all dependencies
  • Fix Nokogiri gem (Gumbo disabled)
  • Reinstall bundle gems
  • Fix PostgreSQL PID issues

๐Ÿ’พ Backup & Restore

Creating a Backup

bash metasploit.sh
# Choose Option 3 โ†’ Backup

Backup is saved to: Internal Storage โ†’ MSF โ†’ backups/
You can view it from any Android file manager.

Restoring a Backup

bash metasploit.sh
# Choose Option 4 โ†’ Restore
# Select backup from the numbered list

๐Ÿ”„ Update

bash metasploit.sh
# Choose Option 5 โ†’ Update

Or manually update MSF inside Debian (proot method):

msf-shell
apt update && apt upgrade metasploit-framework -y
exit

โšก Android 12+ Fix (Phantom Process Killer)

Android 12+ aggressively kills background processes. To disable this:

# Requires ADB from a PC:
adb shell device_config set_sync_disabled_for_tests persistent
adb shell device_config put activity_manager max_phantom_processes 2147483647

Also: Go to Android Settings โ†’ Apps โ†’ Termux โ†’ Battery โ†’ Unrestricted


โ“ Troubleshooting

Problem Fix
msfconsole: command not found Re-run installer or check ls $PREFIX/bin/msfconsole
Could not start server (PostgreSQL) rm ~/proot-distro/installed-rootfs/debian/var/run/postgresql/.s.* then retry
Gem::LoadError on startup Run Repair from main menu
bundle install fails Use proot method โ€” bypasses all gem issues
Process killed by Android Disable battery optimization for Termux
/sdcard not accessible Run termux-setup-storage in Termux
proot-distro: command not found pkg install proot-distro

๐Ÿ“ข Legal Disclaimer

This tool is for educational and authorized penetration testing purposes only.
Unauthorized access to systems is illegal. The author is not responsible for misuse.
Always get written permission before testing any system you do not own.


๐ŸŒ Connect

Website Telegram Instagram

Buy Me A Coffee

Developed by Raj Aryan (h4ck3r0) โ€” Give a โญ if this helped you!

About

Install Latest Metrasploit In Termux (2026). Features automatic Ruby 3.4+ Nokogiri/Gumbo patches, PostgreSQL auto-fix, and silent installation logic. Maintained by @h4ck3r0.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

 
 
 

Contributors

Languages