Metasploit Framework: The favorite tool of hackers
The Metasploit Project is a project security software that provides vulnerability information and tools for complete penetration testing. It is a tool used by penetration testers and security experts for post exploitation.
With the help of Metasploit Project, you can hack any Windows / Linux / Mac operating system that has built-in payloads and exploits, where you can also update by running the msfupdate command.
There are several interfaces for Metasploit. The most popular are maintained by Rapid7 and Strategic Cyber LLC.
1) Metasploit Framework Edition
The free version. Contains a command line view, third party input, manual exploitation and manual brute forcing.
2) Metasploit Community Edition
In October 2011, Rapid7 released the Metasploit Community Edition, a free web-based interface for Metasploit. Metasploit Community Edition is based on the commercial functionality of paid versions, with a reduced set of features such as network discovery, module browsing and manual exploitation. Metasploit Community Edition is included in the main installer.
3) Metasploit Express
In April 2010, Rapid7 released Metasploit Express, an open commercial version for vulnerabilities to verify vulnerabilities. It offers a graphical user interface, integrates nmap for needs detection and adds smart bruteforcing as well as an automated evidence collection.
4) Metasploit Pro
In October 2010, Rapid7 added Metasploit Pro, an open version of Metasploit for pentest testing. Metasploit Pro complements Metasploit Express with features such as Quick Start Wizards / MetaModules, creating and managing social engineering campaigns, web application testing, advanced Pro Console, dynamic payloads to prevent viruses, integration with Nexpose for ad-hoc vulnerability scanning, and VPN pivoting.
Armitage is a graphical attack management tool for Metasploit that displays targets and suggests exploits. It is a free open source network security tool, which is notable for its contribution to red teamers, allowing shared sessions, data and communication through a single Metasploit session.
6) Cobalt Strike
Cobalt Strike is a collection of threat simulation tools provided by Strategic Cyber LLC in partnership with the Metasploit Framework. Cobalt Strike includes all the features of Armitage and adds useful tools for after exploitation and also has the option to create reports.
HOW TO USE METASPLOIT
First of all, start the metasploit service
applications> kali linux> system services> metasploit> start
service metasploit start
just type msfconsole in your terminal
What is msfconsole?
Msfconsole is the main metasploit interface. There are GUI (armitage) interfaces and a web interface (websploit). With msfconsole, you can start exploitation, create listeners, configure payloads, etc.
Metasploit has built-in documentation. Type help to get a basic list of commands if you want to control which commands you can use. Just type help ή ?
- ? Help menu
- advanced Displays advanced options for one or more modules
- back Move back from the current context
- banner Display an awesome metasploit banner
- cd Change the current working directory
- color Toggle color
- connect Communicate with a host
- edit Edit the current module with $ VISUAL or $ EDITOR
- exit Exit the console
- get Gets the value of a context-specific variable
- getg Gets the value of a global variable
- grep Grep the output of another command
- help Help menu
- info Displays information about one or more modules
- irb Drop into irb scripting mode
- jobs Displays and manages jobs
- kill Kill a job
- load Load a framework plugin
- loadpath Searches for and loads modules from a path
- makerc Save commands entered since start to a file
- options Displays global options or for one or more modules
- pushm Pushes the active or list of modules onto the module stack
- quit Exit the console
- reload_all Reloads all modules from all defined module paths
- rename_job Rename a job
- resource Run the commands stored in a file
- route Route traffic through a session
- save Saves the active datastores
- search Searches module names and descriptions
- sessions Dump session listings and display information about sessions
- set Sets a context-specific variable to a value
- setg Sets a global variable to a value
- show Displays modules of a given type, or all modules
- sleep Do nothing for the specified number of seconds
- spool Write console output into a file as well the screen
- threads View and manipulate background threads
- unload Unload a framework plugin
- unset Unsets one or more context-specific variables
- unsetg Unsets one or more global variables
- use Selects a module by name
- version Show the framework and console library version numbers
Database Backend Commands
- creds List all credentials in the database
- db_connect Connect to an existing database
- db_disconnect Disconnect from the current database instance
- db_export Export a file containing the contents of the database
- db_nmap Executes nmap and records the output automatically
- db_rebuild_cache Rebuilds the database-stored module cache
- db_status Show the current database status
- hosts List all hosts in the database
- loot List all loot in the database
- notes List all notes in the database
- services List all services in the database
- vulns List all vulnerabilities in the database
- workspace Switch between database workspaces
Choose a vulnerability and use an exploit
Once you know what the remote host system is (nmap, lynix, maltego, wp-scan, etc.), you can select an exploit from Metasploit for testing. Rapid7 has an easy way to find exploits.
There is also a way to search through msfconsole for various exploits:
- search type: exploit
- search name: xxxx
- search CVE-xxx-xxx
- search cve: 2021