Skip to content

Commit 3dd7fdf

Browse files
committed
Land rapid7#6055, @wvu-r7's -q option for msfd
* Fixes rapid7#5770
2 parents 352535e + 326141f commit 3dd7fdf

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

external/zsh/_msfconsole

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ _arguments \
3232
{-n,--no-database}"[Disable database support]" \
3333
{-o,--output}"[Output to the specified file]:output file" \
3434
{-p,--plugin}"[Load a plugin on startup]:plugin file:_files" \
35-
{-q,--quiet}"[Do not print the banner on start up]" \
35+
{-q,--quiet}"[Do not print the banner on startup]" \
3636
{-r,--resource}"[Execute the specified resource file (- for stdin)]:resource file:_files" \
3737
{-v,--version}"[Show version]" \
3838
{-x,--execute-command}"[Execute the specified string as console commands]:commands" \

lib/metasploit/framework/parsed_options/console.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def option_parser
5656
options.console.plugins << plugin
5757
end
5858

59-
option_parser.on('-q', '--quiet', 'Do not print the banner on start up') do
59+
option_parser.on('-q', '--quiet', 'Do not print the banner on startup') do
6060
options.console.quiet = true
6161
end
6262

msfd

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,13 @@ arguments = Rex::Parser::Arguments.new(
3434
"-f" => [ false, "Run the daemon in the foreground" ],
3535
"-A" => [ true, "Specify list of hosts allowed to connect" ],
3636
"-D" => [ true, "Specify list of hosts not allowed to connect" ],
37+
"-q" => [ false, "Do not print the banner on startup" ],
3738
"-h" => [ false, "Help banner" ])
3839

39-
opts = { 'RunInForeground' => true }
40+
opts = {
41+
'RunInForeground' => true,
42+
'DisableBanner' => false
43+
}
4044
foreground = false
4145

4246
# Parse command line arguments.
@@ -68,6 +72,8 @@ arguments.parse(ARGV) { |opt, idx, val|
6872
$stderr.puts "Bad argument for -D: #{$!}"
6973
exit
7074
end
75+
when "-q"
76+
opts['DisableBanner'] = true
7177
when "-h"
7278
print(
7379
"\nUsage: #{File.basename(__FILE__)} <options>\n" +

plugins/msfd.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@ def run(opts={})
127127
'Framework' => framework,
128128
'LocalInput' => Rex::Ui::Text::Input::Socket.new(cli),
129129
'LocalOutput' => Rex::Ui::Text::Output::Socket.new(cli),
130-
'AllowCommandPassthru' => false).run
130+
'AllowCommandPassthru' => false,
131+
'DisableBanner' => opts['DisableBanner'] ? true : false).run
131132
rescue
132133
elog("Msfd: Client error: #{$!}\n\n#{$@.join("\n")}", 'core')
133134
ensure

0 commit comments

Comments
 (0)