Skip to content

Commit 77fae28

Browse files
committed
Add -q option to msfd to disable banner
1 parent ddea0ea commit 77fae28

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
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: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ 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

3940
opts = { 'RunInForeground' => true }
@@ -68,6 +69,8 @@ arguments.parse(ARGV) { |opt, idx, val|
6869
$stderr.puts "Bad argument for -D: #{$!}"
6970
exit
7071
end
72+
when "-q"
73+
opts['DisableBanner'] = true
7174
when "-h"
7275
print(
7376
"\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)