Land #6055, @wvu-r7's -q option for msfd

* Fixes #5770
bug/bundler_fix
jvazquez-r7 2015-10-08 14:10:27 -05:00
commit 3dd7fdfd95
No known key found for this signature in database
GPG Key ID: 38D99152B9352D83
4 changed files with 11 additions and 4 deletions

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" \

View File

@ -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

8
msfd
View File

@ -34,9 +34,13 @@ 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 }
opts = {
'RunInForeground' => true,
'DisableBanner' => false
}
foreground = false
# Parse command line arguments.
@ -68,6 +72,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" +

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