xutil.dev
Login

Metasploit Cheatsheet

Quick reference for Metasploit Framework covering msfconsole, modules, exploits, payloads, post-exploitation, auxiliary, Meterpreter, and database commands

Related Categories:Security

58 commands

msfconsole

Launch the Metasploit Framework console

msfconsole -q

Launch msfconsole without banner

msfconsole -r

Launch msfconsole with a resource script

help

Display help for available commands

version

Display Metasploit version information

exit / quit

Exit msfconsole

banner

Display Metasploit banner

search

Search modules by keyword

use

Select a module to use

info

Display detailed module information

show options

Display current module options

show targets

Display available targets for the module

show payloads

Display compatible payloads

back

Leave the current module

previous

Return to the previously used module

set RHOSTS

Set target IP address

set RPORT

Set target port number

set LHOST

Set listener IP address

set LPORT

Set listener port number

exploit / run

Execute the exploit

exploit -j

Execute exploit as a background job

check

Check if target is vulnerable

set TARGET

Specify target OS/architecture

set PAYLOAD

Set the payload to use

msfvenom -p

Generate a standalone payload

msfvenom --list formats

List available output formats

msfvenom --list payloads

List available payloads

msfvenom -e

Encode payload with specified encoder

msfvenom --list encoders

List available encoders

post/multi/recon/local_exploit_suggester

Suggest local privilege escalation exploits

post/windows/gather/hashdump

Dump Windows password hashes

post/multi/manage/shell_to_meterpreter

Upgrade shell session to Meterpreter

post/windows/gather/enum_logged_on_users

Enumerate currently logged-on users

post/linux/gather/enum_configs

Collect Linux configuration files

post/windows/gather/credentials/credential_collector

Collect credentials from various sources

auxiliary/scanner/portscan/tcp

Execute TCP port scan

auxiliary/scanner/smb/smb_version

Scan SMB version

auxiliary/scanner/http/http_version

Detect HTTP server version

auxiliary/scanner/ssh/ssh_login

Execute SSH login brute force

auxiliary/scanner/ftp/ftp_anonymous

Check FTP anonymous access availability

auxiliary/server/capture/http_basic

Capture HTTP Basic authentication credentials

sysinfo

Display target system information

getuid

Display current user ID

getsystem

Attempt to escalate to SYSTEM privileges

hashdump

Dump hashes from SAM database

shell

Get target system shell

upload / download

Transfer files to/from target

screenshot

Take a screenshot of target screen

keyscan_start / keyscan_dump

Start keylogger and dump results

portfwd

Set up port forwarding

migrate

Migrate Meterpreter to another process

db_status

Check database connection status

db_nmap

Run Nmap scan and store results in database

hosts

Display hosts stored in database

services

Display services stored in database

vulns

Display vulnerabilities stored in database

creds

Display credentials stored in database

workspace

Manage workspaces (project isolation)