SYSTEM_READY
ACCESS_LEVEL: AUTHORIZED // 2026.06.20 18:42:45

CHEAT SHEET: METASPLOIT FRAMEWORK

Metasploit Framework is one of the tools most widely used by security auditors and penetration testers. It includes a large collection of exploits and a development environment for creating custom exploits. It integrates easily with tools such as Nmap and vulnerability scanners and can be customized for specific needs.


BASIC DEFINITIONS

Exploit

Code written to take advantage of programming errors and obtain privileges on vulnerable systems or software. An exploit is used to gain control of a target machine.

Payload

The malicious part delivered by an exploit. It is the code executed on the victim machine after exploitation.

0-Day Exploit

Malicious code that allows an attacker to gain control of a vulnerable system before the vulnerability is known to users or vendors and before a patch is available.

Metasploit

A collection of tools that enables penetration testers to develop and execute exploits against target machines to evaluate security.

Modules

Features that make Metasploit easier to use. Common module types include:

  1. Auxiliary – External tools such as scanners and sniffers.
  2. Exploits – Contains exploit code.
  3. Payloads – Stores payloads to be used with exploits.

MSFVenom

A combination of msfpayload and msfencode, making it easier to generate and obfuscate payloads from a single console.


MSFCONSOLE COMMANDS

CommandDescription
backExit the current module/exploit context
checkCheck whether the target is vulnerable
connectConnect to a remote host
exploitRun the loaded exploit
runExecute the loaded module
irbStart the Ruby interpreter
jobsList background jobs
loadLoad a plugin
unloadUnload a plugin
loadpathLoad modules from a custom directory
resourceExecute commands from a script file
routeManage routing tables
infoDisplay module information
setSet module options
unsetRemove an option value
sessionsList/manage active sessions
searchSearch for modules
showShow exploits, payloads, options, etc.
setgSet global variables
saveSave configuration
useSelect a module

Examples:

show auxiliary
show exploits
show payloads
show options
show targets
show advanced
show encoders
show nops
show evasion

METERPRETER COMMANDS

CommandDescription
sysinfoDisplay system information
psList running processes
kill <PID>Terminate a process
getuidShow current user ID
uploadUpload a file
downloadDownload a file
pwd / lpwdShow working directory
cd / lcdChange directory
catDisplay file contents
bglistList background scripts
bgrunRun a script in background
bgkillKill a background script
backgroundSend session to background
editEdit a file
shellSpawn a system shell
migrateMove to another process
idletimeShow user idle time
screenshotTake a screenshot
clearevClear event logs
?Show help
exit / quitExit Meterpreter
shutdown / rebootRestart or shut down the system
useLoad an extension

Additional:

channel      Show active channels

NETWORK COMMANDS

CommandDescription
ipconfigShow network interface configuration
portfwdPort forwarding
routeView/edit routing table

USER INTERFACE / OUTPUT COMMANDS

CommandDescription
enumdesktopsList available desktops
getdesktopShow current desktop
keyscan_startStart keylogger
keyscan_stopStop keylogger
keyscan_dumpDump captured keystrokes
set_desktopChange desktop

PROCESS MANAGEMENT COMMANDS

CommandDescription
getpidShow process ID
getuidShow user ID
psList processes
killTerminate process
getprivsList privileges
regAccess system registry
shellOpen a shell
executeExecute a command
migrateMove into another process

MSFVENOM COMMAND OPTIONS

OptionDescription
-pPayload options
-lList modules (payloads, encoders)
-fOutput format
-eEncoder to use
-aTarget architecture
-sMaximum payload size
-bBad characters to avoid
-iNumber of encoding iterations
-xUse a custom template file
-oSave payload
-hHelp