Logo
    Akhil Abraham
    Akhil Abraham
    📕

    Metasploit Cheat Sheet

    Tags
    Initial AccessPost Exploitation
    image

    Table of Contents

    • Table of Contents
    • Basic Commands
    • Working with Sessions
    • Database Commands
    • Exploit and Payload Commands
    • Advanced Commands
    • Networking Commands

    Basic Commands

    1. msfconsole: Launch Metasploit console.
    2. help: Display help for core commands in msfconsole.
    3. search [keyword]: Search for modules (exploits, payloads, etc.) related to the keyword.
    4. use [module path]: Select a module by path.
    5. info: Display information about the current module.
    6. show options: Show options for the current module.
    7. set [option] [value]: Set a value for a module option.
    8. exploit: Run the selected exploit module.
    9. run or execute: Run auxiliary modules.

    Working with Sessions

    1. sessions: List all active sessions.
    2. sessions -i [session id]: Interact with a specific session.
    3. background: Background the current session.

    Database Commands

    1. db_status: Show the current database status.
    2. db_connect [string]: Connect to a database.
    3. hosts: List all hosts in the database.
    4. services: List all services in the database.
    5. vulns: List all vulnerabilities in the database.

    Exploit and Payload Commands

    1. show exploits: List all exploits in the database.
    2. show payloads: List all payloads in the database.
    3. set payload [payload path]: Choose a payload to use with an exploit.
    4. generate -t [format] -f [filename]: Generate a payload in a specific format.

    Advanced Commands

    1. setg [option] [value]: Set a global variable.
    2. save: Save the current configuration.
    3. edit [file]: Edit a module or script.
    4. reload_all: Reload all modules.

    Networking Commands

    1. route: View and modify the routing table.
    2. arp: Display ARP cache.
    3. netstat: Show network connections.
    Logo

    ©️ 2020-2026, Akhil Abraham.

    LinkedInGitHubMediumX