Page cover

Metasploit

Basic Sheet

Basic
Check Modules
ls /opt/metasploit/modules
Check Existent Plugins
ls /opt/metasploit/plugins
Check Existent Scripts
ls /opt/metasploit/scripts
Check Existent Tools
ls /opt/metasploit/tools
Search Examples
search cve:2009 type:exploit platform:-linux
search type:exploit platform:windows cve:2021 rank:excellent microsoft
search cve:2009 -s name
search type:exploit -s type -r
Display options
options
Module Information
info
Display all available vulnerable targets for that specific exploit
show targets

Meterpreter

background
Use
use <number>
Set options
set <option>
Set options permanently until the program is restarted
setg
List active sessions
sessions
Set session
set session <sessionID>
Muli handler
use exploit/multi/handler
Recon
use post/multi/recon
Local exploits
use post/multi/recon/local_exploit_suggester
Payloads

There are three different types of payload modules:

  • Single: Contains the exploit and the entire shellcode for the selected task.

  • Stager: They work with Stage payloads to perform a specific task. They live on the attacker machine, ready to establish a connection to the victim host once the stage completes its run.

  • Stages: Payload components that are downloaded by stager modules. Comprehends the entire exploitation process.

The Meterpreter payload is a specific type of multi-faceted payload that uses DLL injection to ensure the connection to the victim host is stable, hard to detect and persistent

Meterpreter resides completely in the memory of the remote host and leaves no traces on the hard drive.

In addition, scripts and plugins can be loaded and unloaded dynamically as required.

You can also use grep to look for payloads
grep meterpreter show payloads
grep meterpreter grep reverse_tcp show payloads
msfvenom

Last updated