-
Notifications
You must be signed in to change notification settings - Fork 11
/
massc.js
66 lines (58 loc) · 1.69 KB
/
massc.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
const fetch = require('node-fetch');
const fs = require('fs');
const readlineSync = require('readline-sync');
const colors = require('colors');
const CreateFiles = fs.createWriteStream('massc.txt', {
flags: 'a'
});
async function chechDomain(domain)
{
let response = await fetch(domain);
return response;
}
if(process.argv[2] == null){
console.log("[+] Command : node massc domain.com");
return false;
}
function wait(time) {
return new Promise(resolve => {
setTimeout(() => {
resolve();
}, time);
});
}
function lanjutkan(respons)
{
CreateFiles.write(respons.url+'\r\n');
console.log(colors.green(respons.url) , (respons.status + " - " + respons.statusText));
}
function periksa(respons)
{
console.log(colors.red(respons.message));
}
function shiftArray(arr , start_to , end_to) {
return arr.splice(end_to, end_to);
}
const fileName = 'database/subdomains.txt';
fs.readFile(fileName, async function(err, data) {
const list_array = data.toString().replace(/\r\n|\r|\n/g, " ").split(" ");
var i = 0;
var threads = 10;
var delay = 2000;
var start = 0;
var idata = 0;
var last = 0;
for (; i < data.length; ) {
if(i == threads){
var subdomain = shiftArray(list_array , last , idata );
subdomain.forEach(function(itemtext){
chechDomain("https://"+itemtext+"."+process.argv[2]).then(lanjutkan).catch(periksa);
});
await wait(delay);
last = idata;
i = 0;
}
i++;
idata++;
}
});