Add -q option to msfd to disable banner

This commit is contained in:
William Vu
2015-10-07 01:50:36 -05:00
parent ddea0ea708
commit 77fae28cd4
4 changed files with 7 additions and 3 deletions
+1 -1
View File
@@ -32,7 +32,7 @@ _arguments \
{-n,--no-database}"[Disable database support]" \
{-o,--output}"[Output to the specified file]:output file" \
{-p,--plugin}"[Load a plugin on startup]:plugin file:_files" \
{-q,--quiet}"[Do not print the banner on start up]" \
{-q,--quiet}"[Do not print the banner on startup]" \
{-r,--resource}"[Execute the specified resource file (- for stdin)]:resource file:_files" \
{-v,--version}"[Show version]" \
{-x,--execute-command}"[Execute the specified string as console commands]:commands" \
@@ -56,7 +56,7 @@ class Metasploit::Framework::ParsedOptions::Console < Metasploit::Framework::Par
options.console.plugins << plugin
end
option_parser.on('-q', '--quiet', 'Do not print the banner on start up') do
option_parser.on('-q', '--quiet', 'Do not print the banner on startup') do
options.console.quiet = true
end
+3
View File
@@ -34,6 +34,7 @@ arguments = Rex::Parser::Arguments.new(
"-f" => [ false, "Run the daemon in the foreground" ],
"-A" => [ true, "Specify list of hosts allowed to connect" ],
"-D" => [ true, "Specify list of hosts not allowed to connect" ],
"-q" => [ false, "Do not print the banner on startup" ],
"-h" => [ false, "Help banner" ])
opts = { 'RunInForeground' => true }
@@ -68,6 +69,8 @@ arguments.parse(ARGV) { |opt, idx, val|
$stderr.puts "Bad argument for -D: #{$!}"
exit
end
when "-q"
opts['DisableBanner'] = true
when "-h"
print(
"\nUsage: #{File.basename(__FILE__)} <options>\n" +
+2 -1
View File
@@ -127,7 +127,8 @@ class Plugin::Msfd < Msf::Plugin
'Framework' => framework,
'LocalInput' => Rex::Ui::Text::Input::Socket.new(cli),
'LocalOutput' => Rex::Ui::Text::Output::Socket.new(cli),
'AllowCommandPassthru' => false).run
'AllowCommandPassthru' => false,
'DisableBanner' => opts['DisableBanner'] ? true : false).run
rescue
elog("Msfd: Client error: #{$!}\n\n#{$@.join("\n")}", 'core')
ensure