msfconsole
A workspace is a container for organizing and managing penetration testing data.
Use workspace to create, switch, or delete workspaces.
Example:
msf6> workspace -a NewWorkspace # Add a new workspace
msf6> workspace NewWorkspace # Switch to the new workspace
setg is used to set global variables that persist across modules and sessions.
msf6> setg RHOSTS 192.168.1.1 # Set global target IP
Importing Nmap Results
Metasploit can import Nmap scan results to populate target information.
msf6> db_import /path/to/nmap_scan.xml
web application vulnerability scanner integrated into Metasploit. It is used to identify vulnerabilities in web applications.
msf6> load wmap
msf6> wmap_sites -a http://example.com
msf6> wmap_run -t
Working with Modules
Metasploit is modular, allowing users to perform specific tasks. The main types of modules are:
Auxiliary Modules: Perform information gathering, enumeration, and other non-exploit tasks (e.g., sniffing, fuzzing, or brute-forcing).
Exploit Modules: Designed to exploit vulnerabilities in target systems.
Post-Exploitation Modules: Used after gaining access to a system (e.g., privilege escalation, data extraction).
Use the search command to find modules based on keywords, type, or platform.
After identifying a module, use the use command to select it.
Use options to view required and optional parameters. Set parameters using the set command.
Use run or exploit to execute the module.
Post-Exploitation
Upgrading to Meterpreter:
After gaining a basic shell, upgrade it to a Meterpreter session for advanced post-exploitation capabilities.
Meterpreter:
A powerful, extensible payload that provides advanced features like file manipulation, keylogging, and privilege escalation.
Example Workflow
Use the module and set options:
Perform post-exploitation tasks:
Last updated