LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

msfconsole

metasploit Framework console

TLDR

Start Metasploit console
$ msfconsole
copy
Start without the banner
$ msfconsole -q
copy
Execute resource script
$ msfconsole -r [script.rc]
copy
Execute console commands on startup (separated by ;)
$ msfconsole -q -x "use exploit/multi/handler; set PAYLOAD [windows/x64/meterpreter/reverse_tcp]; set LHOST [ip]; run"
copy
Start without database support
$ msfconsole -n
copy
Log console output to a file
$ msfconsole -o [path/to/output.log]
copy
Load a plugin on startup
$ msfconsole -p [plugin_name]
copy
Load an additional module path
$ msfconsole -m [path/to/modules]
copy
Show version
$ msfconsole -v
copy

SYNOPSIS

msfconsole [options]

DESCRIPTION

msfconsole is the main interactive interface to the Metasploit Framework. It gives access to exploits, payloads, auxiliary scanners and post-exploitation modules, with tab completion and a command history.Common console commands include search, use, show options, set, run/exploit, sessions and db_nmap. Resource scripts (.rc) automate sequences of these commands. A PostgreSQL database, initialized with msfdb init, stores hosts, services and loot.

PARAMETERS

-q, --quiet

Do not print the banner on startup.
-r, --resource FILE
Execute the specified resource file (- for stdin).
-x, --execute-command COMMAND
Execute the specified console commands (use ; for multiples).
-n, --no-database
Disable database support.
-y, --yaml PATH
YAML file containing database settings.
-o, --output FILE
Output to the specified file.
-p, --plugin PLUGIN
Load a plugin on startup.
-m, --module-path DIR
Load an additional module path.
-H, --history-file FILE
Save command history to the specified file.
-a, --ask
Ask before exiting Metasploit or accept 'exit -y'.
-c FILE
Load the specified configuration file.
-E, --environment ENV
Set the environment (development, production, test).
--module-count
Print module counts and exit.
--[no-]defer-module-loads
Defer module loading unless explicitly asked.
-v, --version
Show version.
-h, --help
Display help information.

CAVEATS

Only use against systems you are authorized to test. Startup is slow while modules load. Antivirus software often quarantines Metasploit files.

HISTORY

msfconsole is part of the Metasploit Framework, created by H.D. Moore in 2003 in Perl and rewritten in Ruby in 2007. Rapid7 acquired the project in 2009.

SEE ALSO

RESOURCES

Copied to clipboard
Kai