From f5a258e2d9c1732cb764cb5775d6158bb4d8723a Mon Sep 17 00:00:00 2001 From: Fazle Arefin <1625934+FazleArefin@users.noreply.github.com> Date: Fri, 13 Mar 2026 14:16:02 +1100 Subject: [PATCH] msfconsole: refresh page and add examples (#21447) Co-authored-by: Emmanuel Ferdman --- pages/common/msfconsole.md | 39 +++++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/pages/common/msfconsole.md b/pages/common/msfconsole.md index 77cd00a7d9..929a8ddb24 100644 --- a/pages/common/msfconsole.md +++ b/pages/common/msfconsole.md @@ -1,28 +1,37 @@ # msfconsole > Console for the Metasploit Framework. +> Note: Run `sudo msfdb init` to enable the Metasploit database backend prior to launching `msfconsole`. > More information: . -- Launch the console: +- Launch the interactive console (append `--quiet` to suppress the startup banner): -`msfconsole` - -- Launch the console quietly without any banner: - -`msfconsole {{[-q|--quiet]}}` - -- Do not enable database support: - -`msfconsole {{[-n|--no-database]}}` +`sudo msfconsole` - Execute console commands (Note: Use `;` for passing multiple commands): -`msfconsole {{[-x|--execute-command]}} "{{use auxiliary/server/capture/ftp; set SRVHOST 0.0.0.0; set SRVPORT 21; run}}"` +`sudo msfconsole {{[-x|--execute-command]}} "{{use auxiliary/scanner/portscan/tcp; set PORTS 80,443; set RHOSTS example.com; run; quit}}"` -- Display help: +- Run a specific resource file: -`msfconsole {{[-h|--help]}}` +`sudo msfconsole {{[-r|--resource]}} {{path/to/file.rc}}` -- Display version: +- [Interactive] Show specific type of modules: -`msfconsole {{[-v|--version]}}` +`show {{auxiliary|encoders|evasion|exploits|nops|payloads|post}}` + +- [Interactive] Use a module: + +`use {{auxiliary/scanner/portscan/syn}}` + +- [Interactive] Show module options (module needs to be loaded first): + +`show options` + +- [Interactive] Set value of variable: + +`set {{variable_name}} {{value}}` + +- [Interactive] Run a module (module needs to be loaded and options need to be set first): + +`{{run|exploit}}`