Metasploit in Termux – Installation | Usage | Basic Commands

Metasploit is a tool that helps to find loopholes and vulnerabilities of systems and provides a platform to perform penetration testing and exploit the system security. Well, Metasploit is made to run on computers or laptops, but you can also run and use it on an Android phone with the Termux application, which provides a Linux repositories and environment on an Android phone.

In this article, I will give you new commands and methods to install Metasploit in Termux without any errors, and I will give you some basic Metasploit Termux commands so that you can use Metasploit easily.

Metasploit in Termux

Information available on this page is for education and learning purposes only. Using Metasploit on unauthorized systems is illegal. The author and www.achik.us are not responsible for any kind of damage or harmful actions.

What is Metasploit?

Metasploit is a computer tool that is used by many security experts, students, and ethical hackers to find or exploit weak points of systems, networks, and applications.

Metasploit has two important tools, msfconsole and msfvenom. Msfconsole is the home screen of Metasploit, where you can search modules, load exploits, set options, run tests, manage sessions, and do almost everything inside Metasploit, and msfvenom is the tool that creates many types of payload files in different formats like APK, EXE, and more.

Commands to install Metasploit in Termux

You can easily install Metasploit in Termux just by running some simple commands. Below are the commands to install Metasploit in Termux, you can copy these commands and paste them in Termux to install Metasploit:

Make sure that you have the latest version of Termux downloaded from the official Termux GitHub page or from Fdroid.

  • Open Termux and run these commands one by one:
pkg update -y
pkg upgrade -y
pkg install wget curl git -y
wget https://github.com/gushmazuko/metasploit_in_termux/raw/master/metasploit.sh
chmod +x metasploit.sh
./metasploit.sh

These commands will install and set up Metasploit in your Termux, and the installation process may take some time depending on your internet speed. After it, you should be able to run Metasploit using the msfconsole command.

msfconsole
Metasploit installed in Termux

How to use Metasploit in Termux

Let’s understand how you can use Metasploit in Termux. Below, I have provided some usage commands of Metasploit in Termux:

  • First open Termux and start Metasploit by running this command:
msfconsole
Metasploit start in Termux

You will see a black terminal with the “msf >” prompt, which is the main home screen of Metasploit, where you can type commands, and the first command you should run is the help command of Metasploit in Termux:

help

This will show a list of all available Metasploit commands, and if you want a specific module or related tools, then you can use the search command:

search android

This will show all modules and tools related to Android, and if you find the module you want to use, you can load the module with this command:

use <module-name>

for example:

use exploit/multi/handler

After loading a module, you can check what settings it needs by typing:

show options

Here you will see things like LHOST, LPORT, RHOSTS, and more. You must set these options with simple commands like:

set LHOST 192.168.1.5
set LPORT 4444

Once all options are set, you can run the module with this command:

run

or

exploit

Now Metasploit will start the task and wait for a connection or try the action you selected and if you want to see active connections, you can run this command:

sessions -l

and if you want to open a session, type:

sessions -i 1

This is how you can use Metasploit in Termux, these are some simple usage commands of Metasploit that you can use in Termux.

See also  Arch Linux Cheat Sheet - 100+ Commands with PDF

Basic Metasploit Commands

Basic Metasploit Commands

Metasploit is a large tool, so it contains many commands, but for beginners, it’s a good idea to start with some basic and important commands. Below is a list of basic Metasploit commands that are easy to understand and perfect for new users.

  • msfconsole — Start Metasploit
  • help — Show help and all commands
  • search <keyword> — Search for modules
  • use <module_path> — Load a module
  • show options — Show required settings
  • set <option> <value> — Set an option value
  • set RHOSTS <IP> — Set target IP
  • set LHOST <your_ip> — Set your IP
  • set LPORT <port> — Set your port
  • set PAYLOAD <payload_name> — Choose a payload
  • show payloads — List available payloads
  • show targets — Show module-supported targets
  • info — Get details about a module
  • run — Run the module
  • exploit — Start the exploit
  • sessions -l — List active sessions
  • sessions -i <id> — Interact with a session
  • sessions -k <id> — Kill a session
  • background — Move a session to background
  • jobs — Show running jobs
  • jobs -K — Kill all jobs
  • resource <file.rc> — Run commands from a script file
  • db_status — Show database status
  • check — Check if target is vulnerable (if module supports it)
  • back — Return to main console
  • exit — Quit Metasploit

These basic Metasploit Termux commands will help a beginner to search modules, set options, choose payloads, and run tests in a safe way.

Usage of Metasploit in Termux

When you install Metasploit in Termux, you get a powerful security tool on your Android phone. It helps you learn about computer safety, test devices you own, and understand how hacking works so you can protect yourself. Below, I have provided some use cases of Metasploit in Termux.

Learn Cyber Security

Metasploit is one of the most popular tools in the world for cybersecurity, and by installing it in Termux, you can learn how to find and fix security vulnerabilities just using your phone.

Scan Devices for Weaknesses

Metasploit has many exploit modules that you can use to scan systems and Wi-Fi networks directly from your phone to see if there are any security issues, and this process will help you to learn how cybersecurity experts find vulnerabilities in systems.

Create and Test Payloads

You can use Metasploit to create payloads for learning and using tools like msfvenom, which is good for understanding reverse shells, connections, and how hackers gain system access, but make sure that you test payloads inside your own devices for learning purposes only.

Access Target Device

Metasploit has a special tool called Meterpreter that gives a platform to access the target device. Meterpreter helps to get target device information, read files, run shell commands, take screenshots, record microphone audio, and control the full device.

Learn About Networking

You will automatically gain the basics of networking, as Metasploit requires many networking-related information, like IP addresses, ports, protocols and more. These gains will help you to use Metasploit more easily.

These are some use cases of Metasploit in Termux, but the possibilities are endless, you will find more use cases by practicing and using Metasploit on a regular basis. Make sure you have permission before testing the target system.

See also  How to Install Arch Linux on Android Without Root

Uninstall Metasploit in Termux

If you don’t want to use Metasploit in Termux anymore, you can easily uninstall it from your phone. Here are the commands to uninstall Metasploit in Termux and to remove all related files.

rm -rf $HOME/metasploit-framework
rm -f metasploit.sh
pkg uninstall ruby postgresql -y
pkg clean

These commands will uninstall Metasploit and delete all related files from your Termux. If you want to install Metasploit again, you need to rerun the installation in your Termux.

Conclusion

Metasploit in Termux is a powerful way to learn about computer security, penetration testing, exploiting, and system scanning. You can easily install Metasploit in Termux just by typing some commands. This article covers everything about Metasploit in Termux and is specially written for beginners.

From Metasploit installation commands to basic usage commands, everything you will find in this article. Remember, never use Metasploit on systems or devices that you do not have permission for.

What is metasploit termux?

Metasploit Termux means running the Metasploit framework inside the Termux application on an Android phone.

How to download Metasploit in Termux?

First, open Termux and update it and then download the installer script using this command: wget https://github.com/gushmazuko/metasploit_in_termux/raw/master/metasploit.sh This will download the Metasploit installer file into Termux.

How to install Metasploit in Termux?

After downloading the Metasploit installer script, run this commands: chmod +x metasploit.sh && ./metasploit.sh This command will install Metasploit in your Termux and this may take some time.

How to check if Metasploit is installed in Termux?

After installation type msfconsole command, if Metasploit opens and shows a welcome message, then it is successfully installed and If it says “command not found,” then Metasploit is not installed.

How to open Metasploit in Termux?

Simply run the msfconsole command to open Metasploit in Termux.

How to start Metasploit in Termux?

You just need to run the msfconsole command to start Metasploit in Termux.

How to use Metasploit in Termux?

After starting Metasploit, you can use simple commands like:
help
search <name>
use <module>
show options
set <option> <value>
run
These are basic metasploit commands that help you search modules, set options, and run tests in a safe learning environment.

SHARE THIS POST:

Leave a Reply

Your email address will not be published. Required fields are marked *